@metronome/sdk 0.3.0 → 1.0.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 (808) hide show
  1. package/CHANGELOG.md +48 -28
  2. package/README.md +123 -51
  3. package/api-promise.d.mts +2 -0
  4. package/api-promise.d.mts.map +1 -0
  5. package/api-promise.d.ts +2 -0
  6. package/api-promise.d.ts.map +1 -0
  7. package/api-promise.js +6 -0
  8. package/api-promise.js.map +1 -0
  9. package/api-promise.mjs +2 -0
  10. package/api-promise.mjs.map +1 -0
  11. package/bin/cli +53 -0
  12. package/bin/migration-config.json +6 -0
  13. package/client.d.mts +232 -0
  14. package/client.d.mts.map +1 -0
  15. package/client.d.ts +232 -0
  16. package/client.d.ts.map +1 -0
  17. package/client.js +464 -0
  18. package/client.js.map +1 -0
  19. package/client.mjs +460 -0
  20. package/client.mjs.map +1 -0
  21. package/core/api-promise.d.mts +46 -0
  22. package/core/api-promise.d.mts.map +1 -0
  23. package/core/api-promise.d.ts +46 -0
  24. package/core/api-promise.d.ts.map +1 -0
  25. package/core/api-promise.js +74 -0
  26. package/core/api-promise.js.map +1 -0
  27. package/core/api-promise.mjs +70 -0
  28. package/core/api-promise.mjs.map +1 -0
  29. package/core/error.d.mts +46 -0
  30. package/core/error.d.mts.map +1 -0
  31. package/core/error.d.ts +46 -0
  32. package/core/error.d.ts.map +1 -0
  33. package/core/error.js +113 -0
  34. package/core/error.js.map +1 -0
  35. package/core/error.mjs +97 -0
  36. package/core/error.mjs.map +1 -0
  37. package/core/pagination.d.mts +137 -0
  38. package/core/pagination.d.mts.map +1 -0
  39. package/core/pagination.d.ts +137 -0
  40. package/core/pagination.d.ts.map +1 -0
  41. package/core/pagination.js +158 -0
  42. package/core/pagination.js.map +1 -0
  43. package/core/pagination.mjs +150 -0
  44. package/core/pagination.mjs.map +1 -0
  45. package/core/resource.d.mts +6 -0
  46. package/core/resource.d.mts.map +1 -0
  47. package/core/resource.d.ts +6 -0
  48. package/core/resource.d.ts.map +1 -0
  49. package/core/resource.js +11 -0
  50. package/core/resource.js.map +1 -0
  51. package/core/resource.mjs +7 -0
  52. package/core/resource.mjs.map +1 -0
  53. package/core/uploads.d.mts +3 -0
  54. package/core/uploads.d.mts.map +1 -0
  55. package/core/uploads.d.ts +3 -0
  56. package/core/uploads.d.ts.map +1 -0
  57. package/core/uploads.js +6 -0
  58. package/core/uploads.js.map +1 -0
  59. package/core/uploads.mjs +2 -0
  60. package/core/uploads.mjs.map +1 -0
  61. package/error.d.mts +2 -0
  62. package/error.d.mts.map +1 -0
  63. package/error.d.ts +1 -46
  64. package/error.d.ts.map +1 -1
  65. package/error.js +3 -110
  66. package/error.js.map +1 -1
  67. package/error.mjs +1 -96
  68. package/error.mjs.map +1 -1
  69. package/index.d.mts +7 -144
  70. package/index.d.mts.map +1 -0
  71. package/index.d.ts +6 -143
  72. package/index.d.ts.map +1 -1
  73. package/index.js +14 -120
  74. package/index.js.map +1 -1
  75. package/index.mjs +6 -93
  76. package/index.mjs.map +1 -1
  77. package/internal/builtin-types.d.mts +73 -0
  78. package/internal/builtin-types.d.mts.map +1 -0
  79. package/internal/builtin-types.d.ts +73 -0
  80. package/internal/builtin-types.d.ts.map +1 -0
  81. package/internal/builtin-types.js +4 -0
  82. package/internal/builtin-types.js.map +1 -0
  83. package/internal/builtin-types.mjs +3 -0
  84. package/internal/builtin-types.mjs.map +1 -0
  85. package/internal/detect-platform.d.mts +15 -0
  86. package/internal/detect-platform.d.mts.map +1 -0
  87. package/internal/detect-platform.d.ts +15 -0
  88. package/internal/detect-platform.d.ts.map +1 -0
  89. package/internal/detect-platform.js +162 -0
  90. package/internal/detect-platform.js.map +1 -0
  91. package/internal/detect-platform.mjs +157 -0
  92. package/internal/detect-platform.mjs.map +1 -0
  93. package/internal/errors.d.mts +3 -0
  94. package/internal/errors.d.mts.map +1 -0
  95. package/internal/errors.d.ts +3 -0
  96. package/internal/errors.d.ts.map +1 -0
  97. package/internal/errors.js +41 -0
  98. package/internal/errors.js.map +1 -0
  99. package/internal/errors.mjs +36 -0
  100. package/internal/errors.mjs.map +1 -0
  101. package/internal/headers.d.mts +26 -0
  102. package/internal/headers.d.mts.map +1 -0
  103. package/internal/headers.d.ts +26 -0
  104. package/internal/headers.d.ts.map +1 -0
  105. package/internal/headers.js +120 -0
  106. package/internal/headers.js.map +1 -0
  107. package/internal/headers.mjs +112 -0
  108. package/internal/headers.mjs.map +1 -0
  109. package/internal/parse.d.mts +12 -0
  110. package/internal/parse.d.mts.map +1 -0
  111. package/internal/parse.d.ts +12 -0
  112. package/internal/parse.d.ts.map +1 -0
  113. package/internal/parse.js +35 -0
  114. package/internal/parse.js.map +1 -0
  115. package/internal/parse.mjs +32 -0
  116. package/internal/parse.mjs.map +1 -0
  117. package/internal/qs/formats.d.mts +7 -0
  118. package/internal/qs/formats.d.mts.map +1 -0
  119. package/internal/qs/formats.d.ts +1 -0
  120. package/internal/qs/formats.d.ts.map +1 -1
  121. package/internal/qs/formats.js +4 -2
  122. package/internal/qs/formats.js.map +1 -1
  123. package/internal/qs/formats.mjs +2 -1
  124. package/internal/qs/formats.mjs.map +1 -1
  125. package/internal/qs/index.d.mts +10 -0
  126. package/internal/qs/index.d.mts.map +1 -0
  127. package/internal/qs/index.d.ts.map +1 -1
  128. package/internal/qs/stringify.d.mts +3 -0
  129. package/internal/qs/stringify.d.mts.map +1 -0
  130. package/internal/qs/stringify.d.ts.map +1 -1
  131. package/internal/qs/stringify.js +16 -19
  132. package/internal/qs/stringify.js.map +1 -1
  133. package/internal/qs/stringify.mjs +17 -19
  134. package/internal/qs/stringify.mjs.map +1 -1
  135. package/internal/qs/types.d.mts +57 -0
  136. package/internal/qs/types.d.mts.map +1 -0
  137. package/internal/qs/utils.d.mts +15 -0
  138. package/internal/qs/utils.d.mts.map +1 -0
  139. package/internal/qs/utils.d.ts +1 -0
  140. package/internal/qs/utils.d.ts.map +1 -1
  141. package/internal/qs/utils.js +22 -21
  142. package/internal/qs/utils.js.map +1 -1
  143. package/internal/qs/utils.mjs +12 -12
  144. package/internal/qs/utils.mjs.map +1 -1
  145. package/internal/request-options.d.mts +75 -0
  146. package/internal/request-options.d.mts.map +1 -0
  147. package/internal/request-options.d.ts +75 -0
  148. package/internal/request-options.d.ts.map +1 -0
  149. package/internal/request-options.js +14 -0
  150. package/internal/request-options.js.map +1 -0
  151. package/internal/request-options.mjs +10 -0
  152. package/internal/request-options.mjs.map +1 -0
  153. package/internal/shim-types.d.mts +17 -0
  154. package/internal/shim-types.d.mts.map +1 -0
  155. package/internal/shim-types.d.ts +17 -0
  156. package/internal/shim-types.d.ts.map +1 -0
  157. package/internal/shim-types.js +4 -0
  158. package/internal/shim-types.js.map +1 -0
  159. package/internal/shim-types.mjs +3 -0
  160. package/internal/shim-types.mjs.map +1 -0
  161. package/internal/shims.d.mts +20 -0
  162. package/internal/shims.d.mts.map +1 -0
  163. package/internal/shims.d.ts +20 -0
  164. package/internal/shims.d.ts.map +1 -0
  165. package/internal/shims.js +92 -0
  166. package/internal/shims.js.map +1 -0
  167. package/internal/shims.mjs +85 -0
  168. package/internal/shims.mjs.map +1 -0
  169. package/internal/to-file.d.mts +45 -0
  170. package/internal/to-file.d.mts.map +1 -0
  171. package/internal/to-file.d.ts +45 -0
  172. package/internal/to-file.d.ts.map +1 -0
  173. package/internal/to-file.js +91 -0
  174. package/internal/to-file.js.map +1 -0
  175. package/internal/to-file.mjs +88 -0
  176. package/internal/to-file.mjs.map +1 -0
  177. package/internal/tslib.js +81 -0
  178. package/internal/tslib.mjs +17 -0
  179. package/internal/types.d.mts +69 -0
  180. package/internal/types.d.mts.map +1 -0
  181. package/internal/types.d.ts +69 -0
  182. package/internal/types.d.ts.map +1 -0
  183. package/internal/types.js +4 -0
  184. package/internal/types.js.map +1 -0
  185. package/internal/types.mjs +3 -0
  186. package/internal/types.mjs.map +1 -0
  187. package/internal/uploads.d.mts +42 -0
  188. package/internal/uploads.d.mts.map +1 -0
  189. package/internal/uploads.d.ts +42 -0
  190. package/internal/uploads.d.ts.map +1 -0
  191. package/internal/uploads.js +141 -0
  192. package/internal/uploads.js.map +1 -0
  193. package/internal/uploads.mjs +131 -0
  194. package/internal/uploads.mjs.map +1 -0
  195. package/internal/utils/base64.d.mts +3 -0
  196. package/internal/utils/base64.d.mts.map +1 -0
  197. package/internal/utils/base64.d.ts +3 -0
  198. package/internal/utils/base64.d.ts.map +1 -0
  199. package/internal/utils/base64.js +38 -0
  200. package/internal/utils/base64.js.map +1 -0
  201. package/internal/utils/base64.mjs +33 -0
  202. package/internal/utils/base64.mjs.map +1 -0
  203. package/internal/utils/bytes.d.mts +4 -0
  204. package/internal/utils/bytes.d.mts.map +1 -0
  205. package/internal/utils/bytes.d.ts +4 -0
  206. package/internal/utils/bytes.d.ts.map +1 -0
  207. package/internal/utils/bytes.js +31 -0
  208. package/internal/utils/bytes.js.map +1 -0
  209. package/internal/utils/bytes.mjs +26 -0
  210. package/internal/utils/bytes.mjs.map +1 -0
  211. package/internal/utils/env.d.mts +9 -0
  212. package/internal/utils/env.d.mts.map +1 -0
  213. package/internal/utils/env.d.ts +9 -0
  214. package/internal/utils/env.d.ts.map +1 -0
  215. package/internal/utils/env.js +22 -0
  216. package/internal/utils/env.js.map +1 -0
  217. package/internal/utils/env.mjs +18 -0
  218. package/internal/utils/env.mjs.map +1 -0
  219. package/internal/utils/log.d.mts +37 -0
  220. package/internal/utils/log.d.mts.map +1 -0
  221. package/internal/utils/log.d.ts +37 -0
  222. package/internal/utils/log.d.ts.map +1 -0
  223. package/internal/utils/log.js +85 -0
  224. package/internal/utils/log.js.map +1 -0
  225. package/internal/utils/log.mjs +79 -0
  226. package/internal/utils/log.mjs.map +1 -0
  227. package/internal/utils/path.d.mts +15 -0
  228. package/internal/utils/path.d.mts.map +1 -0
  229. package/internal/utils/path.d.ts +15 -0
  230. package/internal/utils/path.d.ts.map +1 -0
  231. package/internal/utils/path.js +79 -0
  232. package/internal/utils/path.js.map +1 -0
  233. package/internal/utils/path.mjs +74 -0
  234. package/internal/utils/path.mjs.map +1 -0
  235. package/internal/utils/sleep.d.mts +2 -0
  236. package/internal/utils/sleep.d.mts.map +1 -0
  237. package/internal/utils/sleep.d.ts +2 -0
  238. package/internal/utils/sleep.d.ts.map +1 -0
  239. package/internal/utils/sleep.js +7 -0
  240. package/internal/utils/sleep.js.map +1 -0
  241. package/internal/utils/sleep.mjs +3 -0
  242. package/internal/utils/sleep.mjs.map +1 -0
  243. package/internal/utils/uuid.d.mts +5 -0
  244. package/internal/utils/uuid.d.mts.map +1 -0
  245. package/internal/utils/uuid.d.ts +5 -0
  246. package/internal/utils/uuid.d.ts.map +1 -0
  247. package/internal/utils/uuid.js +19 -0
  248. package/internal/utils/uuid.js.map +1 -0
  249. package/internal/utils/uuid.mjs +15 -0
  250. package/internal/utils/uuid.mjs.map +1 -0
  251. package/internal/utils/values.d.mts +18 -0
  252. package/internal/utils/values.d.mts.map +1 -0
  253. package/internal/utils/values.d.ts +18 -0
  254. package/internal/utils/values.d.ts.map +1 -0
  255. package/internal/utils/values.js +112 -0
  256. package/internal/utils/values.js.map +1 -0
  257. package/internal/utils/values.mjs +94 -0
  258. package/internal/utils/values.mjs.map +1 -0
  259. package/internal/utils.d.mts +7 -0
  260. package/internal/utils.d.mts.map +1 -0
  261. package/internal/utils.d.ts +7 -0
  262. package/internal/utils.d.ts.map +1 -0
  263. package/internal/utils.js +11 -0
  264. package/internal/utils.js.map +1 -0
  265. package/internal/utils.mjs +8 -0
  266. package/internal/utils.mjs.map +1 -0
  267. package/package.json +113 -64
  268. package/pagination.d.mts +2 -0
  269. package/pagination.d.mts.map +1 -0
  270. package/pagination.d.ts +1 -36
  271. package/pagination.d.ts.map +1 -1
  272. package/pagination.js +3 -40
  273. package/pagination.js.map +1 -1
  274. package/pagination.mjs +1 -38
  275. package/pagination.mjs.map +1 -1
  276. package/resource.d.mts +2 -0
  277. package/resource.d.mts.map +1 -0
  278. package/resource.d.ts +1 -5
  279. package/resource.d.ts.map +1 -1
  280. package/resource.js +3 -8
  281. package/resource.js.map +1 -1
  282. package/resource.mjs +1 -6
  283. package/resource.mjs.map +1 -1
  284. package/resources/index.d.mts +5 -0
  285. package/resources/index.d.mts.map +1 -0
  286. package/resources/index.d.ts.map +1 -1
  287. package/resources/index.js +2 -15
  288. package/resources/index.js.map +1 -1
  289. package/resources/shared.d.mts +2239 -0
  290. package/resources/shared.d.mts.map +1 -0
  291. package/resources/shared.d.ts +1404 -523
  292. package/resources/shared.d.ts.map +1 -1
  293. package/resources/v1/alerts.d.mts +203 -0
  294. package/resources/v1/alerts.d.mts.map +1 -0
  295. package/resources/v1/alerts.d.ts +78 -7
  296. package/resources/v1/alerts.d.ts.map +1 -1
  297. package/resources/v1/alerts.js +73 -3
  298. package/resources/v1/alerts.js.map +1 -1
  299. package/resources/v1/alerts.mjs +73 -3
  300. package/resources/v1/alerts.mjs.map +1 -1
  301. package/resources/v1/audit-logs.d.mts +108 -0
  302. package/resources/v1/audit-logs.d.mts.map +1 -0
  303. package/resources/v1/audit-logs.d.ts +45 -12
  304. package/resources/v1/audit-logs.d.ts.map +1 -1
  305. package/resources/v1/audit-logs.js +53 -12
  306. package/resources/v1/audit-logs.js.map +1 -1
  307. package/resources/v1/audit-logs.mjs +52 -10
  308. package/resources/v1/audit-logs.mjs.map +1 -1
  309. package/resources/v1/billable-metrics.d.mts +293 -0
  310. package/resources/v1/billable-metrics.d.mts.map +1 -0
  311. package/resources/v1/billable-metrics.d.ts +70 -15
  312. package/resources/v1/billable-metrics.d.ts.map +1 -1
  313. package/resources/v1/billable-metrics.js +70 -16
  314. package/resources/v1/billable-metrics.js.map +1 -1
  315. package/resources/v1/billable-metrics.mjs +69 -14
  316. package/resources/v1/billable-metrics.mjs.map +1 -1
  317. package/resources/v1/contracts/contracts.d.mts +2984 -0
  318. package/resources/v1/contracts/contracts.d.mts.map +1 -0
  319. package/resources/v1/contracts/contracts.d.ts +401 -1294
  320. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  321. package/resources/v1/contracts/contracts.js +268 -50
  322. package/resources/v1/contracts/contracts.js.map +1 -1
  323. package/resources/v1/contracts/contracts.mjs +266 -26
  324. package/resources/v1/contracts/contracts.mjs.map +1 -1
  325. package/resources/v1/contracts/index.d.mts +5 -0
  326. package/resources/v1/contracts/index.d.mts.map +1 -0
  327. package/resources/v1/contracts/index.d.ts +3 -3
  328. package/resources/v1/contracts/index.d.ts.map +1 -1
  329. package/resources/v1/contracts/index.js +1 -3
  330. package/resources/v1/contracts/index.js.map +1 -1
  331. package/resources/v1/contracts/index.mjs +2 -2
  332. package/resources/v1/contracts/index.mjs.map +1 -1
  333. package/resources/v1/contracts/named-schedules.d.mts +82 -0
  334. package/resources/v1/contracts/named-schedules.d.mts.map +1 -0
  335. package/resources/v1/contracts/named-schedules.d.ts +5 -4
  336. package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
  337. package/resources/v1/contracts/named-schedules.js +3 -2
  338. package/resources/v1/contracts/named-schedules.js.map +1 -1
  339. package/resources/v1/contracts/named-schedules.mjs +3 -2
  340. package/resources/v1/contracts/named-schedules.mjs.map +1 -1
  341. package/resources/v1/contracts/products.d.mts +502 -0
  342. package/resources/v1/contracts/products.d.mts.map +1 -0
  343. package/resources/v1/contracts/products.d.ts +44 -17
  344. package/resources/v1/contracts/products.d.ts.map +1 -1
  345. package/resources/v1/contracts/products.js +41 -17
  346. package/resources/v1/contracts/products.js.map +1 -1
  347. package/resources/v1/contracts/products.mjs +40 -15
  348. package/resources/v1/contracts/products.mjs.map +1 -1
  349. package/resources/v1/contracts/rate-cards/index.d.mts +5 -0
  350. package/resources/v1/contracts/rate-cards/index.d.mts.map +1 -0
  351. package/resources/v1/contracts/rate-cards/index.d.ts +2 -2
  352. package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
  353. package/resources/v1/contracts/rate-cards/index.js +1 -3
  354. package/resources/v1/contracts/rate-cards/index.js.map +1 -1
  355. package/resources/v1/contracts/rate-cards/index.mjs +2 -2
  356. package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
  357. package/resources/v1/contracts/rate-cards/named-schedules.d.mts +94 -0
  358. package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -0
  359. package/resources/v1/contracts/rate-cards/named-schedules.d.ts +5 -4
  360. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
  361. package/resources/v1/contracts/rate-cards/named-schedules.js +3 -2
  362. package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
  363. package/resources/v1/contracts/rate-cards/named-schedules.mjs +3 -2
  364. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
  365. package/resources/v1/contracts/rate-cards/product-orders.d.mts +85 -0
  366. package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -0
  367. package/resources/v1/contracts/rate-cards/product-orders.d.ts +12 -6
  368. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
  369. package/resources/v1/contracts/rate-cards/product-orders.js +8 -3
  370. package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
  371. package/resources/v1/contracts/rate-cards/product-orders.mjs +8 -3
  372. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
  373. package/resources/v1/contracts/rate-cards/rate-cards.d.mts +452 -0
  374. package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -0
  375. package/resources/v1/contracts/rate-cards/rate-cards.d.ts +134 -41
  376. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
  377. package/resources/v1/contracts/rate-cards/rate-cards.js +127 -47
  378. package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
  379. package/resources/v1/contracts/rate-cards/rate-cards.mjs +123 -20
  380. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
  381. package/resources/v1/contracts/rate-cards/rates.d.mts +382 -0
  382. package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -0
  383. package/resources/v1/contracts/rate-cards/rates.d.ts +25 -82
  384. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  385. package/resources/v1/contracts/rate-cards/rates.js +13 -9
  386. package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
  387. package/resources/v1/contracts/rate-cards/rates.mjs +12 -7
  388. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  389. package/resources/v1/contracts/rate-cards.d.mts +2 -0
  390. package/resources/v1/contracts/rate-cards.d.mts.map +1 -0
  391. package/resources/v1/contracts/rate-cards.d.ts.map +1 -1
  392. package/resources/v1/contracts/rate-cards.js +2 -15
  393. package/resources/v1/contracts/rate-cards.js.map +1 -1
  394. package/resources/v1/contracts.d.mts +2 -0
  395. package/resources/v1/contracts.d.mts.map +1 -0
  396. package/resources/v1/contracts.d.ts.map +1 -1
  397. package/resources/v1/contracts.js +2 -15
  398. package/resources/v1/contracts.js.map +1 -1
  399. package/resources/v1/credit-grants.d.mts +505 -0
  400. package/resources/v1/credit-grants.d.mts.map +1 -0
  401. package/resources/v1/credit-grants.d.ts +73 -74
  402. package/resources/v1/credit-grants.d.ts.map +1 -1
  403. package/resources/v1/credit-grants.js +52 -18
  404. package/resources/v1/credit-grants.js.map +1 -1
  405. package/resources/v1/credit-grants.mjs +51 -16
  406. package/resources/v1/credit-grants.mjs.map +1 -1
  407. package/resources/v1/custom-fields.d.mts +151 -0
  408. package/resources/v1/custom-fields.d.mts.map +1 -0
  409. package/resources/v1/custom-fields.d.ts +69 -38
  410. package/resources/v1/custom-fields.d.ts.map +1 -1
  411. package/resources/v1/custom-fields.js +66 -22
  412. package/resources/v1/custom-fields.js.map +1 -1
  413. package/resources/v1/custom-fields.mjs +66 -22
  414. package/resources/v1/custom-fields.mjs.map +1 -1
  415. package/resources/v1/customers/alerts.d.mts +288 -0
  416. package/resources/v1/customers/alerts.d.mts.map +1 -0
  417. package/resources/v1/customers/alerts.d.ts +128 -23
  418. package/resources/v1/customers/alerts.d.ts.map +1 -1
  419. package/resources/v1/customers/alerts.js +112 -10
  420. package/resources/v1/customers/alerts.js.map +1 -1
  421. package/resources/v1/customers/alerts.mjs +112 -10
  422. package/resources/v1/customers/alerts.mjs.map +1 -1
  423. package/resources/v1/customers/billing-config.d.mts +125 -0
  424. package/resources/v1/customers/billing-config.d.mts.map +1 -0
  425. package/resources/v1/customers/billing-config.d.ts +8 -7
  426. package/resources/v1/customers/billing-config.d.ts.map +1 -1
  427. package/resources/v1/customers/billing-config.js +8 -6
  428. package/resources/v1/customers/billing-config.js.map +1 -1
  429. package/resources/v1/customers/billing-config.mjs +8 -6
  430. package/resources/v1/customers/billing-config.mjs.map +1 -1
  431. package/resources/v1/customers/commits.d.mts +456 -0
  432. package/resources/v1/customers/commits.d.mts.map +1 -0
  433. package/resources/v1/customers/commits.d.ts +139 -47
  434. package/resources/v1/customers/commits.d.ts.map +1 -1
  435. package/resources/v1/customers/commits.js +131 -12
  436. package/resources/v1/customers/commits.js.map +1 -1
  437. package/resources/v1/customers/commits.mjs +131 -12
  438. package/resources/v1/customers/commits.mjs.map +1 -1
  439. package/resources/v1/customers/credits.d.mts +310 -0
  440. package/resources/v1/customers/credits.d.mts.map +1 -0
  441. package/resources/v1/customers/credits.d.ts +124 -46
  442. package/resources/v1/customers/credits.d.ts.map +1 -1
  443. package/resources/v1/customers/credits.js +116 -11
  444. package/resources/v1/customers/credits.js.map +1 -1
  445. package/resources/v1/customers/credits.mjs +116 -11
  446. package/resources/v1/customers/credits.mjs.map +1 -1
  447. package/resources/v1/customers/customers.d.mts +818 -0
  448. package/resources/v1/customers/customers.d.mts.map +1 -0
  449. package/resources/v1/customers/customers.d.ts +304 -41
  450. package/resources/v1/customers/customers.d.ts.map +1 -1
  451. package/resources/v1/customers/customers.js +214 -73
  452. package/resources/v1/customers/customers.js.map +1 -1
  453. package/resources/v1/customers/customers.mjs +207 -41
  454. package/resources/v1/customers/customers.mjs.map +1 -1
  455. package/resources/v1/customers/index.d.mts +9 -0
  456. package/resources/v1/customers/index.d.mts.map +1 -0
  457. package/resources/v1/customers/index.d.ts +6 -6
  458. package/resources/v1/customers/index.d.ts.map +1 -1
  459. package/resources/v1/customers/index.js +1 -8
  460. package/resources/v1/customers/index.js.map +1 -1
  461. package/resources/v1/customers/index.mjs +3 -3
  462. package/resources/v1/customers/index.mjs.map +1 -1
  463. package/resources/v1/customers/invoices.d.mts +710 -0
  464. package/resources/v1/customers/invoices.d.mts.map +1 -0
  465. package/resources/v1/customers/invoices.d.ts +193 -24
  466. package/resources/v1/customers/invoices.d.ts.map +1 -1
  467. package/resources/v1/customers/invoices.js +131 -22
  468. package/resources/v1/customers/invoices.js.map +1 -1
  469. package/resources/v1/customers/invoices.mjs +130 -19
  470. package/resources/v1/customers/invoices.mjs.map +1 -1
  471. package/resources/v1/customers/named-schedules.d.mts +82 -0
  472. package/resources/v1/customers/named-schedules.d.mts.map +1 -0
  473. package/resources/v1/customers/named-schedules.d.ts +5 -4
  474. package/resources/v1/customers/named-schedules.d.ts.map +1 -1
  475. package/resources/v1/customers/named-schedules.js +3 -2
  476. package/resources/v1/customers/named-schedules.js.map +1 -1
  477. package/resources/v1/customers/named-schedules.mjs +3 -2
  478. package/resources/v1/customers/named-schedules.mjs.map +1 -1
  479. package/resources/v1/customers/plans.d.mts +281 -0
  480. package/resources/v1/customers/plans.d.mts.map +1 -0
  481. package/resources/v1/customers/plans.d.ts +14 -12
  482. package/resources/v1/customers/plans.d.ts.map +1 -1
  483. package/resources/v1/customers/plans.js +8 -15
  484. package/resources/v1/customers/plans.js.map +1 -1
  485. package/resources/v1/customers/plans.mjs +7 -12
  486. package/resources/v1/customers/plans.mjs.map +1 -1
  487. package/resources/v1/customers.d.mts +2 -0
  488. package/resources/v1/customers.d.mts.map +1 -0
  489. package/resources/v1/customers.d.ts.map +1 -1
  490. package/resources/v1/customers.js +2 -15
  491. package/resources/v1/customers.js.map +1 -1
  492. package/resources/v1/dashboards.d.mts +133 -0
  493. package/resources/v1/dashboards.d.mts.map +1 -0
  494. package/resources/v1/dashboards.d.ts +33 -6
  495. package/resources/v1/dashboards.d.ts.map +1 -1
  496. package/resources/v1/dashboards.js +30 -4
  497. package/resources/v1/dashboards.js.map +1 -1
  498. package/resources/v1/dashboards.mjs +30 -4
  499. package/resources/v1/dashboards.mjs.map +1 -1
  500. package/resources/v1/index.d.mts +15 -0
  501. package/resources/v1/index.d.mts.map +1 -0
  502. package/resources/v1/index.d.ts +9 -9
  503. package/resources/v1/index.d.ts.map +1 -1
  504. package/resources/v1/index.js +1 -12
  505. package/resources/v1/index.js.map +1 -1
  506. package/resources/v1/index.mjs +7 -7
  507. package/resources/v1/index.mjs.map +1 -1
  508. package/resources/v1/invoices.d.mts +83 -0
  509. package/resources/v1/invoices.d.mts.map +1 -0
  510. package/resources/v1/invoices.d.ts +28 -6
  511. package/resources/v1/invoices.d.ts.map +1 -1
  512. package/resources/v1/invoices.js +24 -3
  513. package/resources/v1/invoices.js.map +1 -1
  514. package/resources/v1/invoices.mjs +24 -3
  515. package/resources/v1/invoices.mjs.map +1 -1
  516. package/resources/v1/plans.d.mts +240 -0
  517. package/resources/v1/plans.d.mts.map +1 -0
  518. package/resources/v1/plans.d.ts +24 -15
  519. package/resources/v1/plans.d.ts.map +1 -1
  520. package/resources/v1/plans.js +19 -26
  521. package/resources/v1/plans.js.map +1 -1
  522. package/resources/v1/plans.mjs +18 -22
  523. package/resources/v1/plans.mjs.map +1 -1
  524. package/resources/v1/pricing-units.d.mts +34 -0
  525. package/resources/v1/pricing-units.d.mts.map +1 -0
  526. package/resources/v1/pricing-units.d.ts +12 -9
  527. package/resources/v1/pricing-units.d.ts.map +1 -1
  528. package/resources/v1/pricing-units.js +20 -12
  529. package/resources/v1/pricing-units.js.map +1 -1
  530. package/resources/v1/pricing-units.mjs +19 -10
  531. package/resources/v1/pricing-units.mjs.map +1 -1
  532. package/resources/v1/services.d.mts +33 -0
  533. package/resources/v1/services.d.mts.map +1 -0
  534. package/resources/v1/services.d.ts +10 -7
  535. package/resources/v1/services.d.ts.map +1 -1
  536. package/resources/v1/services.js +7 -5
  537. package/resources/v1/services.js.map +1 -1
  538. package/resources/v1/services.mjs +7 -5
  539. package/resources/v1/services.mjs.map +1 -1
  540. package/resources/v1/usage.d.mts +488 -0
  541. package/resources/v1/usage.d.mts.map +1 -0
  542. package/resources/v1/usage.d.ts +220 -57
  543. package/resources/v1/usage.d.ts.map +1 -1
  544. package/resources/v1/usage.js +212 -26
  545. package/resources/v1/usage.js.map +1 -1
  546. package/resources/v1/usage.mjs +211 -24
  547. package/resources/v1/usage.mjs.map +1 -1
  548. package/resources/v1/v1.d.mts +58 -0
  549. package/resources/v1/v1.d.mts.map +1 -0
  550. package/resources/v1/v1.d.ts +15 -15
  551. package/resources/v1/v1.d.ts.map +1 -1
  552. package/resources/v1/v1.js +15 -48
  553. package/resources/v1/v1.js.map +1 -1
  554. package/resources/v1/v1.mjs +8 -19
  555. package/resources/v1/v1.mjs.map +1 -1
  556. package/resources/v1.d.mts +2 -0
  557. package/resources/v1.d.mts.map +1 -0
  558. package/resources/v1.d.ts.map +1 -1
  559. package/resources/v1.js +2 -15
  560. package/resources/v1.js.map +1 -1
  561. package/resources/v2/contracts.d.mts +2794 -0
  562. package/resources/v2/contracts.d.mts.map +1 -0
  563. package/resources/v2/contracts.d.ts +333 -3870
  564. package/resources/v2/contracts.d.ts.map +1 -1
  565. package/resources/v2/contracts.js +102 -12
  566. package/resources/v2/contracts.js.map +1 -1
  567. package/resources/v2/contracts.mjs +102 -12
  568. package/resources/v2/contracts.mjs.map +1 -1
  569. package/resources/v2/index.d.mts +3 -0
  570. package/resources/v2/index.d.mts.map +1 -0
  571. package/resources/v2/index.d.ts.map +1 -1
  572. package/resources/v2/v2.d.mts +10 -0
  573. package/resources/v2/v2.d.mts.map +1 -0
  574. package/resources/v2/v2.d.ts +1 -1
  575. package/resources/v2/v2.d.ts.map +1 -1
  576. package/resources/v2/v2.js +3 -25
  577. package/resources/v2/v2.js.map +1 -1
  578. package/resources/v2/v2.mjs +1 -1
  579. package/resources/v2.d.mts +2 -0
  580. package/resources/v2.d.mts.map +1 -0
  581. package/resources/v2.d.ts.map +1 -1
  582. package/resources/v2.js +2 -15
  583. package/resources/v2.js.map +1 -1
  584. package/resources/webhooks.d.mts +22 -0
  585. package/resources/webhooks.d.mts.map +1 -0
  586. package/resources/webhooks.d.ts +1 -1
  587. package/resources/webhooks.d.ts.map +1 -1
  588. package/resources/webhooks.js +3 -3
  589. package/resources/webhooks.js.map +1 -1
  590. package/resources/webhooks.mjs +1 -1
  591. package/resources/webhooks.mjs.map +1 -1
  592. package/resources.d.mts +2 -0
  593. package/resources.d.mts.map +1 -0
  594. package/resources.d.ts.map +1 -1
  595. package/resources.js +2 -15
  596. package/resources.js.map +1 -1
  597. package/src/api-promise.ts +2 -0
  598. package/src/client.ts +809 -0
  599. package/src/core/README.md +3 -0
  600. package/src/core/api-promise.ts +92 -0
  601. package/src/core/error.ts +130 -0
  602. package/src/core/pagination.ts +319 -0
  603. package/src/core/resource.ts +11 -0
  604. package/src/core/uploads.ts +2 -0
  605. package/src/error.ts +2 -130
  606. package/src/index.ts +6 -221
  607. package/src/internal/README.md +3 -0
  608. package/src/internal/builtin-types.ts +93 -0
  609. package/src/internal/detect-platform.ts +196 -0
  610. package/src/internal/errors.ts +33 -0
  611. package/src/internal/headers.ts +144 -0
  612. package/src/internal/parse.ts +50 -0
  613. package/src/internal/qs/formats.ts +3 -2
  614. package/src/internal/qs/index.ts +3 -3
  615. package/src/internal/qs/stringify.ts +18 -21
  616. package/src/internal/qs/utils.ts +16 -16
  617. package/src/internal/request-options.ts +91 -0
  618. package/src/internal/shim-types.ts +26 -0
  619. package/src/internal/shims.ts +107 -0
  620. package/src/internal/to-file.ts +154 -0
  621. package/src/internal/types.ts +95 -0
  622. package/src/internal/uploads.ts +187 -0
  623. package/src/internal/utils/base64.ts +40 -0
  624. package/src/internal/utils/bytes.ts +32 -0
  625. package/src/internal/utils/env.ts +18 -0
  626. package/src/internal/utils/log.ts +126 -0
  627. package/src/internal/utils/path.ts +88 -0
  628. package/src/internal/utils/sleep.ts +3 -0
  629. package/src/internal/utils/uuid.ts +17 -0
  630. package/src/internal/utils/values.ts +105 -0
  631. package/src/internal/utils.ts +8 -0
  632. package/src/pagination.ts +2 -82
  633. package/src/resource.ts +2 -11
  634. package/src/resources/index.ts +4 -4
  635. package/src/resources/shared.ts +1794 -534
  636. package/src/resources/v1/alerts.ts +79 -8
  637. package/src/resources/v1/audit-logs.ts +48 -26
  638. package/src/resources/v1/billable-metrics.ts +79 -34
  639. package/src/resources/v1/contracts/contracts.ts +465 -1633
  640. package/src/resources/v1/contracts/index.ts +7 -6
  641. package/src/resources/v1/contracts/named-schedules.ts +8 -6
  642. package/src/resources/v1/contracts/products.ts +50 -38
  643. package/src/resources/v1/contracts/rate-cards/index.ts +6 -6
  644. package/src/resources/v1/contracts/rate-cards/named-schedules.ts +8 -6
  645. package/src/resources/v1/contracts/rate-cards/product-orders.ts +13 -10
  646. package/src/resources/v1/contracts/rate-cards/rate-cards.ts +145 -72
  647. package/src/resources/v1/contracts/rate-cards/rates.ts +28 -98
  648. package/src/resources/v1/contracts/rate-cards.ts +1 -1
  649. package/src/resources/v1/contracts.ts +1 -1
  650. package/src/resources/v1/credit-grants.ts +100 -112
  651. package/src/resources/v1/custom-fields.ts +106 -74
  652. package/src/resources/v1/customers/alerts.ts +147 -28
  653. package/src/resources/v1/customers/billing-config.ts +27 -13
  654. package/src/resources/v1/customers/commits.ts +146 -54
  655. package/src/resources/v1/customers/credits.ts +131 -53
  656. package/src/resources/v1/customers/customers.ts +390 -101
  657. package/src/resources/v1/customers/index.ts +19 -18
  658. package/src/resources/v1/customers/invoices.ts +202 -42
  659. package/src/resources/v1/customers/named-schedules.ts +8 -6
  660. package/src/resources/v1/customers/plans.ts +24 -22
  661. package/src/resources/v1/customers.ts +1 -1
  662. package/src/resources/v1/dashboards.ts +34 -7
  663. package/src/resources/v1/index.ts +32 -25
  664. package/src/resources/v1/invoices.ts +28 -9
  665. package/src/resources/v1/plans.ts +42 -43
  666. package/src/resources/v1/pricing-units.ts +15 -23
  667. package/src/resources/v1/services.ts +10 -7
  668. package/src/resources/v1/usage.ts +244 -72
  669. package/src/resources/v1/v1.ts +52 -49
  670. package/src/resources/v1.ts +1 -1
  671. package/src/resources/v2/contracts.ts +420 -5022
  672. package/src/resources/v2/index.ts +2 -2
  673. package/src/resources/v2/v2.ts +3 -3
  674. package/src/resources/v2.ts +1 -1
  675. package/src/resources/webhooks.ts +2 -2
  676. package/src/resources.ts +1 -1
  677. package/src/tsconfig.json +2 -2
  678. package/src/uploads.ts +2 -255
  679. package/src/version.ts +1 -1
  680. package/uploads.d.mts +2 -0
  681. package/uploads.d.mts.map +1 -0
  682. package/uploads.d.ts +1 -74
  683. package/uploads.d.ts.map +1 -1
  684. package/uploads.js +3 -168
  685. package/uploads.js.map +1 -1
  686. package/uploads.mjs +1 -157
  687. package/uploads.mjs.map +1 -1
  688. package/version.d.mts +2 -0
  689. package/version.d.mts.map +1 -0
  690. package/version.d.ts +1 -1
  691. package/version.js +1 -1
  692. package/version.mjs +1 -1
  693. package/_shims/MultipartBody.d.ts +0 -9
  694. package/_shims/MultipartBody.d.ts.map +0 -1
  695. package/_shims/MultipartBody.js +0 -16
  696. package/_shims/MultipartBody.js.map +0 -1
  697. package/_shims/MultipartBody.mjs +0 -12
  698. package/_shims/MultipartBody.mjs.map +0 -1
  699. package/_shims/README.md +0 -46
  700. package/_shims/auto/runtime-bun.d.ts +0 -5
  701. package/_shims/auto/runtime-bun.d.ts.map +0 -1
  702. package/_shims/auto/runtime-bun.js +0 -21
  703. package/_shims/auto/runtime-bun.js.map +0 -1
  704. package/_shims/auto/runtime-bun.mjs +0 -2
  705. package/_shims/auto/runtime-bun.mjs.map +0 -1
  706. package/_shims/auto/runtime-node.d.ts +0 -5
  707. package/_shims/auto/runtime-node.d.ts.map +0 -1
  708. package/_shims/auto/runtime-node.js +0 -21
  709. package/_shims/auto/runtime-node.js.map +0 -1
  710. package/_shims/auto/runtime-node.mjs +0 -2
  711. package/_shims/auto/runtime-node.mjs.map +0 -1
  712. package/_shims/auto/runtime.d.ts +0 -5
  713. package/_shims/auto/runtime.d.ts.map +0 -1
  714. package/_shims/auto/runtime.js +0 -21
  715. package/_shims/auto/runtime.js.map +0 -1
  716. package/_shims/auto/runtime.mjs +0 -2
  717. package/_shims/auto/runtime.mjs.map +0 -1
  718. package/_shims/auto/types-node.d.ts +0 -5
  719. package/_shims/auto/types-node.d.ts.map +0 -1
  720. package/_shims/auto/types-node.js +0 -21
  721. package/_shims/auto/types-node.js.map +0 -1
  722. package/_shims/auto/types-node.mjs +0 -2
  723. package/_shims/auto/types-node.mjs.map +0 -1
  724. package/_shims/auto/types.d.ts +0 -101
  725. package/_shims/auto/types.js +0 -3
  726. package/_shims/auto/types.mjs +0 -3
  727. package/_shims/bun-runtime.d.ts +0 -6
  728. package/_shims/bun-runtime.d.ts.map +0 -1
  729. package/_shims/bun-runtime.js +0 -14
  730. package/_shims/bun-runtime.js.map +0 -1
  731. package/_shims/bun-runtime.mjs +0 -10
  732. package/_shims/bun-runtime.mjs.map +0 -1
  733. package/_shims/index.d.ts +0 -83
  734. package/_shims/index.js +0 -17
  735. package/_shims/index.mjs +0 -11
  736. package/_shims/manual-types.d.ts +0 -12
  737. package/_shims/manual-types.js +0 -3
  738. package/_shims/manual-types.mjs +0 -3
  739. package/_shims/node-runtime.d.ts +0 -3
  740. package/_shims/node-runtime.d.ts.map +0 -1
  741. package/_shims/node-runtime.js +0 -89
  742. package/_shims/node-runtime.js.map +0 -1
  743. package/_shims/node-runtime.mjs +0 -56
  744. package/_shims/node-runtime.mjs.map +0 -1
  745. package/_shims/node-types.d.ts +0 -42
  746. package/_shims/node-types.js +0 -3
  747. package/_shims/node-types.mjs +0 -3
  748. package/_shims/registry.d.ts +0 -37
  749. package/_shims/registry.d.ts.map +0 -1
  750. package/_shims/registry.js +0 -41
  751. package/_shims/registry.js.map +0 -1
  752. package/_shims/registry.mjs +0 -37
  753. package/_shims/registry.mjs.map +0 -1
  754. package/_shims/web-runtime.d.ts +0 -5
  755. package/_shims/web-runtime.d.ts.map +0 -1
  756. package/_shims/web-runtime.js +0 -78
  757. package/_shims/web-runtime.js.map +0 -1
  758. package/_shims/web-runtime.mjs +0 -71
  759. package/_shims/web-runtime.mjs.map +0 -1
  760. package/_shims/web-types.d.ts +0 -83
  761. package/_shims/web-types.js +0 -3
  762. package/_shims/web-types.mjs +0 -3
  763. package/core.d.ts +0 -255
  764. package/core.d.ts.map +0 -1
  765. package/core.js +0 -924
  766. package/core.js.map +0 -1
  767. package/core.mjs +0 -892
  768. package/core.mjs.map +0 -1
  769. package/shims/node.d.ts +0 -30
  770. package/shims/node.d.ts.map +0 -1
  771. package/shims/node.js +0 -31
  772. package/shims/node.js.map +0 -1
  773. package/shims/node.mjs +0 -5
  774. package/shims/node.mjs.map +0 -1
  775. package/shims/web.d.ts +0 -26
  776. package/shims/web.d.ts.map +0 -1
  777. package/shims/web.js +0 -31
  778. package/shims/web.js.map +0 -1
  779. package/shims/web.mjs +0 -5
  780. package/shims/web.mjs.map +0 -1
  781. package/src/_shims/MultipartBody.ts +0 -9
  782. package/src/_shims/README.md +0 -46
  783. package/src/_shims/auto/runtime-bun.ts +0 -4
  784. package/src/_shims/auto/runtime-node.ts +0 -4
  785. package/src/_shims/auto/runtime.ts +0 -4
  786. package/src/_shims/auto/types-node.ts +0 -4
  787. package/src/_shims/auto/types.d.ts +0 -101
  788. package/src/_shims/auto/types.js +0 -3
  789. package/src/_shims/auto/types.mjs +0 -3
  790. package/src/_shims/bun-runtime.ts +0 -14
  791. package/src/_shims/index.d.ts +0 -83
  792. package/src/_shims/index.js +0 -17
  793. package/src/_shims/index.mjs +0 -11
  794. package/src/_shims/manual-types.d.ts +0 -12
  795. package/src/_shims/manual-types.js +0 -3
  796. package/src/_shims/manual-types.mjs +0 -3
  797. package/src/_shims/node-runtime.ts +0 -81
  798. package/src/_shims/node-types.d.ts +0 -42
  799. package/src/_shims/node-types.js +0 -3
  800. package/src/_shims/node-types.mjs +0 -3
  801. package/src/_shims/registry.ts +0 -67
  802. package/src/_shims/web-runtime.ts +0 -103
  803. package/src/_shims/web-types.d.ts +0 -83
  804. package/src/_shims/web-types.js +0 -3
  805. package/src/_shims/web-types.mjs +0 -3
  806. package/src/core.ts +0 -1236
  807. package/src/shims/node.ts +0 -50
  808. package/src/shims/web.ts +0 -50
@@ -1,10 +1,26 @@
1
- import { APIResource } from "../../resource.js";
2
- import * as Core from "../../core.js";
1
+ import { APIResource } from "../../core/resource.js";
3
2
  import * as Shared from "../shared.js";
3
+ import { APIPromise } from "../../core/api-promise.js";
4
+ import { RequestOptions } from "../../internal/request-options.js";
4
5
  export declare class Contracts extends APIResource {
5
6
  /**
6
- * Get a specific contract. New clients should use this endpoint rather than the v1
7
- * endpoint.
7
+ * Gets the details for a specific contract, including contract term, rate card
8
+ * information, credits and commits, and more.
9
+ *
10
+ * ### Use this endpoint to:
11
+ *
12
+ * - Check the duration of a customer's current contract
13
+ * - Get details on contract terms, including access schedule amounts for
14
+ * commitments and credits
15
+ * - Understand the state of a contract at a past time. As you can evolve the terms
16
+ * of a contract over time through editing, use the `as_of_date` parameter to
17
+ * view the full contract configuration as of that point in time.
18
+ *
19
+ * ### Usage guidelines:
20
+ *
21
+ * - Optionally, use the `include_balance` and `include_ledger` fields to include
22
+ * balances and ledgers in the credit and commit responses. Using these fields
23
+ * will cause the query to be slower.
8
24
  *
9
25
  * @example
10
26
  * ```ts
@@ -14,10 +30,23 @@ export declare class Contracts extends APIResource {
14
30
  * });
15
31
  * ```
16
32
  */
17
- retrieve(body: ContractRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<ContractRetrieveResponse>;
33
+ retrieve(body: ContractRetrieveParams, options?: RequestOptions): APIPromise<ContractRetrieveResponse>;
18
34
  /**
19
- * List all contracts for a customer in chronological order. New clients should use
20
- * this endpoint rather than the v1 endpoint.
35
+ * For a given customer, lists all of their contracts in chronological order.
36
+ *
37
+ * ### Use this endpoint to:
38
+ *
39
+ * - Check if a customer is provisioned with any contract, and at which tier
40
+ * - Check the duration and terms of a customer's current contract
41
+ * - Power a page in your end customer experience that shows the customer's history
42
+ * of tiers (e.g. this customer started out on the Pro Plan, then downgraded to
43
+ * the Starter plan).
44
+ *
45
+ * ### Usage guidelines:
46
+ *
47
+ * Use the `starting_at`, `covering_date`, and `include_archived` parameters to
48
+ * filter the list of returned contracts. For example, to list only currently
49
+ * active contracts, pass `covering_date` equal to the current time.
21
50
  *
22
51
  * @example
23
52
  * ```ts
@@ -26,9 +55,30 @@ export declare class Contracts extends APIResource {
26
55
  * });
27
56
  * ```
28
57
  */
29
- list(body: ContractListParams, options?: Core.RequestOptions): Core.APIPromise<ContractListResponse>;
58
+ list(body: ContractListParams, options?: RequestOptions): APIPromise<ContractListResponse>;
30
59
  /**
31
- * Edit a contract. Contract editing must be enabled to use this endpoint.
60
+ * The ability to edit a contract helps you react quickly to the needs of your
61
+ * customers and your business.
62
+ *
63
+ * ### Use this endpoint to:
64
+ *
65
+ * - Encode mid-term commitment and discount changes
66
+ * - Fix configuration mistakes and easily roll back packaging changes
67
+ *
68
+ * ### Key response fields:
69
+ *
70
+ * - The `id` of the edit
71
+ * - Complete edit details. For example, if you edited the contract to add new
72
+ * overrides and credits, you will receive the IDs of those overrides and credits
73
+ * in the response.
74
+ *
75
+ * ### Usage guidelines:
76
+ *
77
+ * - When you edit a contract, any draft invoices update immediately to reflect
78
+ * that edit. Finalized invoices remain unchanged - you must void and regenerate
79
+ * them in the UI or API to reflect the edit.
80
+ * - Contract editing must be enabled to use this endpoint. Reach out to your
81
+ * Metronome representative to learn more.
32
82
  *
33
83
  * @example
34
84
  * ```ts
@@ -61,10 +111,24 @@ export declare class Contracts extends APIResource {
61
111
  * });
62
112
  * ```
63
113
  */
64
- edit(body: ContractEditParams, options?: Core.RequestOptions): Core.APIPromise<ContractEditResponse>;
114
+ edit(body: ContractEditParams, options?: RequestOptions): APIPromise<ContractEditResponse>;
65
115
  /**
66
- * Edit a customer or contract commit. Contract commits can only be edited using
67
- * this endpoint if contract editing is enabled.
116
+ * Edit specific details for a contract-level or customer-level commit. Use this
117
+ * endpoint to modify individual commit access schedules, invoice schedules,
118
+ * applicable products, invoicing contracts, or other fields.
119
+ *
120
+ * ### Usage guidelines:
121
+ *
122
+ * - As with all edits in Metronome, draft invoices will reflect the edit
123
+ * immediately, while finalized invoices are untouched unless voided and
124
+ * regenerated.
125
+ * - If a commit's invoice schedule item is associated with a finalized invoice,
126
+ * you cannot remove or update the invoice schedule item.
127
+ * - If a commit's invoice schedule item is associated with a voided invoice, you
128
+ * cannot remove the invoice schedule item.
129
+ * - You cannot remove an commit access schedule segment that was applied to a
130
+ * finalized invoice. You can void the invoice beforehand and then remove the
131
+ * access schedule segment.
68
132
  *
69
133
  * @example
70
134
  * ```ts
@@ -82,10 +146,24 @@ export declare class Contracts extends APIResource {
82
146
  * });
83
147
  * ```
84
148
  */
85
- editCommit(body: ContractEditCommitParams, options?: Core.RequestOptions): Core.APIPromise<ContractEditCommitResponse>;
149
+ editCommit(body: ContractEditCommitParams, options?: RequestOptions): APIPromise<ContractEditCommitResponse>;
86
150
  /**
87
- * Edit a customer or contract credit. Contract credits can only be edited using
88
- * this endpoint if contract editing is enabled.
151
+ * Edit details for a contract-level or customer-level credit.
152
+ *
153
+ * ### Use this endpoint to:
154
+ *
155
+ * - Extend the duration or the amount of an existing free credit like a trial
156
+ * - Modify individual credit access schedules, applicable products, priority, or
157
+ * other fields.
158
+ *
159
+ * ### Usage guidelines:
160
+ *
161
+ * - As with all edits in Metronome, draft invoices will reflect the edit
162
+ * immediately, while finalized invoices are untouched unless voided and
163
+ * regenerated.
164
+ * - You cannot remove an access schedule segment that was applied to a finalized
165
+ * invoice. You can void the invoice beforehand and then remove the access
166
+ * schedule segment.
89
167
  *
90
168
  * @example
91
169
  * ```ts
@@ -103,2464 +181,39 @@ export declare class Contracts extends APIResource {
103
181
  * });
104
182
  * ```
105
183
  */
106
- editCredit(body: ContractEditCreditParams, options?: Core.RequestOptions): Core.APIPromise<ContractEditCreditResponse>;
184
+ editCredit(body: ContractEditCreditParams, options?: RequestOptions): APIPromise<ContractEditCreditResponse>;
107
185
  /**
108
- * Get the edit history of a specific contract. Contract editing must be enabled to
109
- * use this endpoint.
186
+ * List all the edits made to a contract over time. In Metronome, you can edit a
187
+ * contract at any point after it's created to fix mistakes or reflect changes in
188
+ * terms. Metronome stores a full history of all edits that were ever made to a
189
+ * contract, whether through the UI, `editContract` endpoint, or other endpoints
190
+ * like `updateContractEndDate`.
110
191
  *
111
- * @example
112
- * ```ts
113
- * const response = await client.v2.contracts.getEditHistory({
114
- * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
115
- * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
116
- * });
117
- * ```
118
- */
119
- getEditHistory(body: ContractGetEditHistoryParams, options?: Core.RequestOptions): Core.APIPromise<ContractGetEditHistoryResponse>;
120
- }
121
- export interface ContractRetrieveResponse {
122
- data: ContractRetrieveResponse.Data;
123
- }
124
- export declare namespace ContractRetrieveResponse {
125
- interface Data {
126
- id: string;
127
- commits: Array<Data.Commit>;
128
- created_at: string;
129
- created_by: string;
130
- customer_id: string;
131
- overrides: Array<Data.Override>;
132
- scheduled_charges: Array<Shared.ScheduledCharge>;
133
- starting_at: string;
134
- transitions: Array<Data.Transition>;
135
- usage_filter: Array<Data.UsageFilter>;
136
- usage_statement_schedule: Data.UsageStatementSchedule;
137
- archived_at?: string;
138
- credits?: Array<Data.Credit>;
139
- custom_fields?: {
140
- [key: string]: string;
141
- };
142
- /**
143
- * This field's availability is dependent on your client's configuration.
144
- */
145
- customer_billing_provider_configuration?: Data.CustomerBillingProviderConfiguration;
146
- /**
147
- * This field's availability is dependent on your client's configuration.
148
- */
149
- discounts?: Array<Shared.Discount>;
150
- ending_before?: string;
151
- /**
152
- * Indicates whether there are more items than the limit for this endpoint. Use the
153
- * respective list endpoints to get the full lists.
154
- */
155
- has_more?: Data.HasMore;
156
- /**
157
- * Either a **parent** configuration with a list of children or a **child**
158
- * configuration with a single parent.
159
- */
160
- hierarchy_configuration?: Data.ParentHierarchyConfiguration | Data.ChildHierarchyConfiguration;
161
- /**
162
- * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
163
- * prices automatically. EXPLICIT prioritization requires specifying priorities for
164
- * each multiplier; the one with the lowest priority value will be prioritized
165
- * first.
166
- */
167
- multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';
168
- name?: string;
169
- net_payment_terms_days?: number;
170
- /**
171
- * This field's availability is dependent on your client's configuration.
172
- */
173
- netsuite_sales_order_id?: string;
174
- prepaid_balance_threshold_configuration?: Data.PrepaidBalanceThresholdConfiguration;
175
- /**
176
- * Priority of the contract.
177
- */
178
- priority?: number;
179
- /**
180
- * This field's availability is dependent on your client's configuration.
181
- */
182
- professional_services?: Array<Shared.ProService>;
183
- rate_card_id?: string;
184
- recurring_commits?: Array<Data.RecurringCommit>;
185
- recurring_credits?: Array<Data.RecurringCredit>;
186
- /**
187
- * This field's availability is dependent on your client's configuration.
188
- */
189
- reseller_royalties?: Array<Data.ResellerRoyalty>;
190
- /**
191
- * This field's availability is dependent on your client's configuration.
192
- */
193
- salesforce_opportunity_id?: string;
194
- /**
195
- * Determines which scheduled and commit charges to consolidate onto the Contract's
196
- * usage invoice. The charge's `timestamp` must match the usage invoice's
197
- * `ending_before` date for consolidation to occur. This field cannot be modified
198
- * after a Contract has been created. If this field is omitted, charges will appear
199
- * on a separate invoice from usage charges.
200
- */
201
- scheduled_charges_on_usage_invoices?: 'ALL';
202
- spend_threshold_configuration?: Data.SpendThresholdConfiguration;
203
- /**
204
- * List of subscriptions on the contract.
205
- */
206
- subscriptions?: Array<Data.Subscription>;
207
- total_contract_value?: number;
208
- /**
209
- * Prevents the creation of duplicates. If a request to create a record is made
210
- * with a previously used uniqueness key, a new record will not be created and the
211
- * request will fail with a 409 error.
212
- */
213
- uniqueness_key?: string;
214
- }
215
- namespace Data {
216
- interface Commit {
217
- id: string;
218
- product: Commit.Product;
219
- type: 'PREPAID' | 'POSTPAID';
220
- /**
221
- * The schedule that the customer will gain access to the credits purposed with
222
- * this commit.
223
- */
224
- access_schedule?: Shared.ScheduleDuration;
225
- applicable_contract_ids?: Array<string>;
226
- applicable_product_ids?: Array<string>;
227
- applicable_product_tags?: Array<string>;
228
- archived_at?: string;
229
- /**
230
- * The current balance of the credit or commit. This balance reflects the amount of
231
- * credit or commit that the customer has access to use at this moment - thus,
232
- * expired and upcoming credit or commit segments contribute 0 to the balance. The
233
- * balance will match the sum of all ledger entries with the exception of the case
234
- * where the sum of negative manual ledger entries exceeds the positive amount
235
- * remaining on the credit or commit - in that case, the balance will be 0. All
236
- * manual ledger entries associated with active credit or commit segments are
237
- * included in the balance, including future-dated manual ledger entries.
238
- */
239
- balance?: number;
240
- contract?: Commit.Contract;
241
- custom_fields?: {
242
- [key: string]: string;
243
- };
244
- description?: string;
245
- /**
246
- * Optional configuration for commit hierarchy access control
247
- */
248
- hierarchy_configuration?: Commit.HierarchyConfiguration;
249
- /**
250
- * The contract that this commit will be billed on.
251
- */
252
- invoice_contract?: Commit.InvoiceContract;
253
- /**
254
- * The schedule that the customer will be invoiced for this commit.
255
- */
256
- invoice_schedule?: Shared.SchedulePointInTime;
257
- /**
258
- * A list of ordered events that impact the balance of a commit. For example, an
259
- * invoice deduction or a rollover.
260
- */
261
- ledger?: Array<Commit.PrepaidCommitSegmentStartLedgerEntry | Commit.PrepaidCommitAutomatedInvoiceDeductionLedgerEntry | Commit.PrepaidCommitRolloverLedgerEntry | Commit.PrepaidCommitExpirationLedgerEntry | Commit.PrepaidCommitCanceledLedgerEntry | Commit.PrepaidCommitCreditedLedgerEntry | Commit.PrepaidCommitSeatBasedAdjustmentLedgerEntry | Commit.PostpaidCommitInitialBalanceLedgerEntry | Commit.PostpaidCommitAutomatedInvoiceDeductionLedgerEntry | Commit.PostpaidCommitRolloverLedgerEntry | Commit.PostpaidCommitTrueupLedgerEntry | Commit.PrepaidCommitManualLedgerEntry | Commit.PostpaidCommitManualLedgerEntry | Commit.PostpaidCommitExpirationLedgerEntry>;
262
- name?: string;
263
- /**
264
- * This field's availability is dependent on your client's configuration.
265
- */
266
- netsuite_sales_order_id?: string;
267
- /**
268
- * If multiple credits or commits are applicable, the one with the lower priority
269
- * will apply first.
270
- */
271
- priority?: number;
272
- rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
273
- rolled_over_from?: Commit.RolledOverFrom;
274
- rollover_fraction?: number;
275
- /**
276
- * This field's availability is dependent on your client's configuration.
277
- */
278
- salesforce_opportunity_id?: string;
279
- /**
280
- * List of filters that determine what kind of customer usage draws down a commit
281
- * or credit. A customer's usage needs to meet the condition of at least one of the
282
- * specifiers to contribute to a commit's or credit's drawdown.
283
- */
284
- specifiers?: Array<Commit.Specifier>;
285
- }
286
- namespace Commit {
287
- interface Product {
288
- id: string;
289
- name: string;
290
- }
291
- interface Contract {
292
- id: string;
293
- }
294
- /**
295
- * Optional configuration for commit hierarchy access control
296
- */
297
- interface HierarchyConfiguration {
298
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
299
- }
300
- namespace HierarchyConfiguration {
301
- interface CommitHierarchyChildAccessAll {
302
- type: 'ALL';
303
- }
304
- interface CommitHierarchyChildAccessNone {
305
- type: 'NONE';
306
- }
307
- interface CommitHierarchyChildAccessContractIDs {
308
- contract_ids: Array<string>;
309
- type: 'CONTRACT_IDS';
310
- }
311
- }
312
- /**
313
- * The contract that this commit will be billed on.
314
- */
315
- interface InvoiceContract {
316
- id: string;
317
- }
318
- interface PrepaidCommitSegmentStartLedgerEntry {
319
- amount: number;
320
- segment_id: string;
321
- timestamp: string;
322
- type: 'PREPAID_COMMIT_SEGMENT_START';
323
- }
324
- interface PrepaidCommitAutomatedInvoiceDeductionLedgerEntry {
325
- amount: number;
326
- invoice_id: string;
327
- segment_id: string;
328
- timestamp: string;
329
- type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
330
- contract_id?: string;
331
- }
332
- interface PrepaidCommitRolloverLedgerEntry {
333
- amount: number;
334
- new_contract_id: string;
335
- segment_id: string;
336
- timestamp: string;
337
- type: 'PREPAID_COMMIT_ROLLOVER';
338
- }
339
- interface PrepaidCommitExpirationLedgerEntry {
340
- amount: number;
341
- segment_id: string;
342
- timestamp: string;
343
- type: 'PREPAID_COMMIT_EXPIRATION';
344
- }
345
- interface PrepaidCommitCanceledLedgerEntry {
346
- amount: number;
347
- invoice_id: string;
348
- segment_id: string;
349
- timestamp: string;
350
- type: 'PREPAID_COMMIT_CANCELED';
351
- contract_id?: string;
352
- }
353
- interface PrepaidCommitCreditedLedgerEntry {
354
- amount: number;
355
- invoice_id: string;
356
- segment_id: string;
357
- timestamp: string;
358
- type: 'PREPAID_COMMIT_CREDITED';
359
- contract_id?: string;
360
- }
361
- interface PrepaidCommitSeatBasedAdjustmentLedgerEntry {
362
- amount: number;
363
- segment_id: string;
364
- timestamp: string;
365
- type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT';
366
- }
367
- interface PostpaidCommitInitialBalanceLedgerEntry {
368
- amount: number;
369
- timestamp: string;
370
- type: 'POSTPAID_COMMIT_INITIAL_BALANCE';
371
- }
372
- interface PostpaidCommitAutomatedInvoiceDeductionLedgerEntry {
373
- amount: number;
374
- invoice_id: string;
375
- segment_id: string;
376
- timestamp: string;
377
- type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
378
- contract_id?: string;
379
- }
380
- interface PostpaidCommitRolloverLedgerEntry {
381
- amount: number;
382
- new_contract_id: string;
383
- segment_id: string;
384
- timestamp: string;
385
- type: 'POSTPAID_COMMIT_ROLLOVER';
386
- }
387
- interface PostpaidCommitTrueupLedgerEntry {
388
- amount: number;
389
- invoice_id: string;
390
- timestamp: string;
391
- type: 'POSTPAID_COMMIT_TRUEUP';
392
- contract_id?: string;
393
- }
394
- interface PrepaidCommitManualLedgerEntry {
395
- amount: number;
396
- reason: string;
397
- timestamp: string;
398
- type: 'PREPAID_COMMIT_MANUAL';
399
- }
400
- interface PostpaidCommitManualLedgerEntry {
401
- amount: number;
402
- reason: string;
403
- timestamp: string;
404
- type: 'POSTPAID_COMMIT_MANUAL';
405
- }
406
- interface PostpaidCommitExpirationLedgerEntry {
407
- amount: number;
408
- timestamp: string;
409
- type: 'POSTPAID_COMMIT_EXPIRATION';
410
- }
411
- interface RolledOverFrom {
412
- commit_id: string;
413
- contract_id: string;
414
- }
415
- interface Specifier {
416
- presentation_group_values?: {
417
- [key: string]: string;
418
- };
419
- pricing_group_values?: {
420
- [key: string]: string;
421
- };
422
- /**
423
- * If provided, the specifier will only apply to the product with the specified ID.
424
- */
425
- product_id?: string;
426
- /**
427
- * If provided, the specifier will only apply to products with all the specified
428
- * tags.
429
- */
430
- product_tags?: Array<string>;
431
- }
432
- }
433
- interface Override {
434
- id: string;
435
- starting_at: string;
436
- applicable_product_tags?: Array<string>;
437
- ending_before?: string;
438
- entitled?: boolean;
439
- is_commit_specific?: boolean;
440
- multiplier?: number;
441
- override_specifiers?: Array<Override.OverrideSpecifier>;
442
- override_tiers?: Array<Override.OverrideTier>;
443
- overwrite_rate?: Override.OverwriteRate;
444
- priority?: number;
445
- product?: Override.Product;
446
- target?: 'COMMIT_RATE' | 'LIST_RATE';
447
- type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
448
- }
449
- namespace Override {
450
- interface OverrideSpecifier {
451
- billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
452
- commit_ids?: Array<string>;
453
- presentation_group_values?: {
454
- [key: string]: string | null;
455
- };
456
- pricing_group_values?: {
457
- [key: string]: string;
458
- };
459
- product_id?: string;
460
- product_tags?: Array<string>;
461
- recurring_commit_ids?: Array<string>;
462
- recurring_credit_ids?: Array<string>;
463
- }
464
- interface OverrideTier {
465
- multiplier: number;
466
- size?: number;
467
- }
468
- interface OverwriteRate {
469
- rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
470
- credit_type?: Shared.CreditTypeData;
471
- /**
472
- * Only set for CUSTOM rate_type. This field is interpreted by custom rate
473
- * processors.
474
- */
475
- custom_rate?: {
476
- [key: string]: unknown;
477
- };
478
- /**
479
- * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
480
- * set to true.
481
- */
482
- is_prorated?: boolean;
483
- /**
484
- * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
485
- * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
486
- */
487
- price?: number;
488
- /**
489
- * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
490
- */
491
- quantity?: number;
492
- /**
493
- * Only set for TIERED rate_type.
494
- */
495
- tiers?: Array<Shared.Tier>;
496
- }
497
- interface Product {
498
- id: string;
499
- name: string;
500
- }
501
- }
502
- interface Transition {
503
- from_contract_id: string;
504
- to_contract_id: string;
505
- type: 'SUPERSEDE' | 'RENEWAL';
506
- }
507
- interface UsageFilter {
508
- group_key: string;
509
- group_values: Array<string>;
510
- /**
511
- * This will match contract starting_at value if usage filter is active from the
512
- * beginning of the contract.
513
- */
514
- starting_at: string;
515
- /**
516
- * This will match contract ending_before value if usage filter is active until the
517
- * end of the contract. It will be undefined if the contract is open-ended.
518
- */
519
- ending_before?: string;
520
- }
521
- interface UsageStatementSchedule {
522
- /**
523
- * Contract usage statements follow a selected cadence based on this date.
524
- */
525
- billing_anchor_date: string;
526
- frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
527
- }
528
- interface Credit {
529
- id: string;
530
- product: Credit.Product;
531
- type: 'CREDIT';
532
- /**
533
- * The schedule that the customer will gain access to the credits.
534
- */
535
- access_schedule?: Shared.ScheduleDuration;
536
- applicable_contract_ids?: Array<string>;
537
- applicable_product_ids?: Array<string>;
538
- applicable_product_tags?: Array<string>;
539
- /**
540
- * The current balance of the credit or commit. This balance reflects the amount of
541
- * credit or commit that the customer has access to use at this moment - thus,
542
- * expired and upcoming credit or commit segments contribute 0 to the balance. The
543
- * balance will match the sum of all ledger entries with the exception of the case
544
- * where the sum of negative manual ledger entries exceeds the positive amount
545
- * remaining on the credit or commit - in that case, the balance will be 0. All
546
- * manual ledger entries associated with active credit or commit segments are
547
- * included in the balance, including future-dated manual ledger entries.
548
- */
549
- balance?: number;
550
- contract?: Credit.Contract;
551
- custom_fields?: {
552
- [key: string]: string;
553
- };
554
- description?: string;
555
- /**
556
- * Optional configuration for credit hierarchy access control
557
- */
558
- hierarchy_configuration?: Credit.HierarchyConfiguration;
559
- /**
560
- * A list of ordered events that impact the balance of a credit. For example, an
561
- * invoice deduction or an expiration.
562
- */
563
- ledger?: Array<Credit.CreditSegmentStartLedgerEntry | Credit.CreditAutomatedInvoiceDeductionLedgerEntry | Credit.CreditExpirationLedgerEntry | Credit.CreditCanceledLedgerEntry | Credit.CreditCreditedLedgerEntry | Credit.CreditManualLedgerEntry | Credit.CreditSeatBasedAdjustmentLedgerEntry>;
564
- name?: string;
565
- /**
566
- * This field's availability is dependent on your client's configuration.
567
- */
568
- netsuite_sales_order_id?: string;
569
- /**
570
- * If multiple credits or commits are applicable, the one with the lower priority
571
- * will apply first.
572
- */
573
- priority?: number;
574
- /**
575
- * This field's availability is dependent on your client's configuration.
576
- */
577
- salesforce_opportunity_id?: string;
578
- /**
579
- * List of filters that determine what kind of customer usage draws down a commit
580
- * or credit. A customer's usage needs to meet the condition of at least one of the
581
- * specifiers to contribute to a commit's or credit's drawdown.
582
- */
583
- specifiers?: Array<Credit.Specifier>;
584
- }
585
- namespace Credit {
586
- interface Product {
587
- id: string;
588
- name: string;
589
- }
590
- interface Contract {
591
- id: string;
592
- }
593
- /**
594
- * Optional configuration for credit hierarchy access control
595
- */
596
- interface HierarchyConfiguration {
597
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
598
- }
599
- namespace HierarchyConfiguration {
600
- interface CommitHierarchyChildAccessAll {
601
- type: 'ALL';
602
- }
603
- interface CommitHierarchyChildAccessNone {
604
- type: 'NONE';
605
- }
606
- interface CommitHierarchyChildAccessContractIDs {
607
- contract_ids: Array<string>;
608
- type: 'CONTRACT_IDS';
609
- }
610
- }
611
- interface CreditSegmentStartLedgerEntry {
612
- amount: number;
613
- segment_id: string;
614
- timestamp: string;
615
- type: 'CREDIT_SEGMENT_START';
616
- }
617
- interface CreditAutomatedInvoiceDeductionLedgerEntry {
618
- amount: number;
619
- invoice_id: string;
620
- segment_id: string;
621
- timestamp: string;
622
- type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION';
623
- contract_id?: string;
624
- }
625
- interface CreditExpirationLedgerEntry {
626
- amount: number;
627
- segment_id: string;
628
- timestamp: string;
629
- type: 'CREDIT_EXPIRATION';
630
- }
631
- interface CreditCanceledLedgerEntry {
632
- amount: number;
633
- invoice_id: string;
634
- segment_id: string;
635
- timestamp: string;
636
- type: 'CREDIT_CANCELED';
637
- contract_id?: string;
638
- }
639
- interface CreditCreditedLedgerEntry {
640
- amount: number;
641
- invoice_id: string;
642
- segment_id: string;
643
- timestamp: string;
644
- type: 'CREDIT_CREDITED';
645
- contract_id?: string;
646
- }
647
- interface CreditManualLedgerEntry {
648
- amount: number;
649
- reason: string;
650
- timestamp: string;
651
- type: 'CREDIT_MANUAL';
652
- }
653
- interface CreditSeatBasedAdjustmentLedgerEntry {
654
- amount: number;
655
- segment_id: string;
656
- timestamp: string;
657
- type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
658
- }
659
- interface Specifier {
660
- presentation_group_values?: {
661
- [key: string]: string;
662
- };
663
- pricing_group_values?: {
664
- [key: string]: string;
665
- };
666
- /**
667
- * If provided, the specifier will only apply to the product with the specified ID.
668
- */
669
- product_id?: string;
670
- /**
671
- * If provided, the specifier will only apply to products with all the specified
672
- * tags.
673
- */
674
- product_tags?: Array<string>;
675
- }
676
- }
677
- /**
678
- * This field's availability is dependent on your client's configuration.
679
- */
680
- interface CustomerBillingProviderConfiguration {
681
- /**
682
- * ID of Customer's billing provider configuration.
683
- */
684
- id: string;
685
- billing_provider: 'aws_marketplace' | 'stripe' | 'netsuite' | 'custom' | 'azure_marketplace' | 'quickbooks_online' | 'workday' | 'gcp_marketplace';
686
- delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
687
- }
688
- /**
689
- * Indicates whether there are more items than the limit for this endpoint. Use the
690
- * respective list endpoints to get the full lists.
691
- */
692
- interface HasMore {
693
- /**
694
- * Whether there are more commits on this contract than the limit for this
695
- * endpoint. Use the /contracts/customerCommits/list endpoint to get the full list
696
- * of commits.
697
- */
698
- commits: boolean;
699
- /**
700
- * Whether there are more credits on this contract than the limit for this
701
- * endpoint. Use the /contracts/customerCredits/list endpoint to get the full list
702
- * of credits.
703
- */
704
- credits: boolean;
705
- }
706
- interface ParentHierarchyConfiguration {
707
- /**
708
- * List of contracts that belong to this parent.
709
- */
710
- children: Array<ParentHierarchyConfiguration.Child>;
711
- }
712
- namespace ParentHierarchyConfiguration {
713
- interface Child {
714
- contract_id: string;
715
- customer_id: string;
716
- }
717
- }
718
- interface ChildHierarchyConfiguration {
719
- /**
720
- * The single parent contract/customer for this child.
721
- */
722
- parent: ChildHierarchyConfiguration.Parent;
723
- }
724
- namespace ChildHierarchyConfiguration {
725
- /**
726
- * The single parent contract/customer for this child.
727
- */
728
- interface Parent {
729
- contract_id: string;
730
- customer_id: string;
731
- }
732
- }
733
- interface PrepaidBalanceThresholdConfiguration {
734
- commit: PrepaidBalanceThresholdConfiguration.Commit;
735
- /**
736
- * When set to false, the contract will not be evaluated against the
737
- * threshold_amount. Toggling to true will result an immediate evaluation,
738
- * regardless of prior state.
739
- */
740
- is_enabled: boolean;
741
- payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
742
- /**
743
- * Specify the amount the balance should be recharged to.
744
- */
745
- recharge_to_amount: number;
746
- /**
747
- * Specify the threshold amount for the contract. Each time the contract's balance
748
- * lowers to this amount, a threshold charge will be initiated.
749
- */
750
- threshold_amount: number;
751
- /**
752
- * If provided, the threshold, recharge-to amount, and the resulting threshold
753
- * commit amount will be in terms of this credit type instead of the fiat currency.
754
- */
755
- custom_credit_type_id?: string;
756
- }
757
- namespace PrepaidBalanceThresholdConfiguration {
758
- interface Commit {
759
- /**
760
- * The commit product that will be used to generate the line item for commit
761
- * payment.
762
- */
763
- product_id: string;
764
- /**
765
- * Which products the threshold commit applies to. If applicable_product_ids,
766
- * applicable_product_tags or specifiers are not provided, the commit applies to
767
- * all products.
768
- */
769
- applicable_product_ids?: Array<string>;
770
- /**
771
- * Which tags the threshold commit applies to. If applicable_product_ids,
772
- * applicable_product_tags or specifiers are not provided, the commit applies to
773
- * all products.
774
- */
775
- applicable_product_tags?: Array<string>;
776
- description?: string;
777
- /**
778
- * Specify the name of the line item for the threshold charge. If left blank, it
779
- * will default to the commit product name.
780
- */
781
- name?: string;
782
- /**
783
- * List of filters that determine what kind of customer usage draws down a commit
784
- * or credit. A customer's usage needs to meet the condition of at least one of the
785
- * specifiers to contribute to a commit's or credit's drawdown. This field cannot
786
- * be used together with `applicable_product_ids` or `applicable_product_tags`.
787
- * Instead, to target usage by product or product tag, pass those values in the
788
- * body of `specifiers`.
789
- */
790
- specifiers?: Array<Commit.Specifier>;
791
- }
792
- namespace Commit {
793
- interface Specifier {
794
- presentation_group_values?: {
795
- [key: string]: string;
796
- };
797
- pricing_group_values?: {
798
- [key: string]: string;
799
- };
800
- /**
801
- * If provided, the specifier will only apply to the product with the specified ID.
802
- */
803
- product_id?: string;
804
- /**
805
- * If provided, the specifier will only apply to products with all the specified
806
- * tags.
807
- */
808
- product_tags?: Array<string>;
809
- }
810
- }
811
- interface PaymentGateConfig {
812
- /**
813
- * Gate access to the commit balance based on successful collection of payment.
814
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
815
- * facilitate payment using your own payment integration. Select NONE if you do not
816
- * wish to payment gate the commit balance.
817
- */
818
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
819
- /**
820
- * Only applicable if using PRECALCULATED as your tax type.
821
- */
822
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
823
- /**
824
- * Only applicable if using STRIPE as your payment gateway type.
825
- */
826
- stripe_config?: PaymentGateConfig.StripeConfig;
827
- /**
828
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
829
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
830
- * will default to NONE.
831
- */
832
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
833
- }
834
- namespace PaymentGateConfig {
835
- /**
836
- * Only applicable if using PRECALCULATED as your tax type.
837
- */
838
- interface PrecalculatedTaxConfig {
839
- /**
840
- * Amount of tax to be applied. This should be in the same currency and
841
- * denomination as the commit's invoice schedule
842
- */
843
- tax_amount: number;
844
- /**
845
- * Name of the tax to be applied. This may be used in an invoice line item
846
- * description.
847
- */
848
- tax_name?: string;
849
- }
850
- /**
851
- * Only applicable if using STRIPE as your payment gateway type.
852
- */
853
- interface StripeConfig {
854
- /**
855
- * If left blank, will default to INVOICE
856
- */
857
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
858
- /**
859
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
860
- * your payment type.
861
- */
862
- invoice_metadata?: {
863
- [key: string]: string;
864
- };
865
- }
866
- }
867
- }
868
- interface RecurringCommit {
869
- id: string;
870
- /**
871
- * The amount of commit to grant.
872
- */
873
- access_amount: RecurringCommit.AccessAmount;
874
- /**
875
- * The amount of time the created commits will be valid for
876
- */
877
- commit_duration: RecurringCommit.CommitDuration;
878
- /**
879
- * Will be passed down to the individual commits
880
- */
881
- priority: number;
882
- product: RecurringCommit.Product;
883
- /**
884
- * Whether the created commits will use the commit rate or list rate
885
- */
886
- rate_type: 'COMMIT_RATE' | 'LIST_RATE';
887
- /**
888
- * Determines the start time for the first commit
889
- */
890
- starting_at: string;
891
- /**
892
- * Will be passed down to the individual commits
893
- */
894
- applicable_product_ids?: Array<string>;
895
- /**
896
- * Will be passed down to the individual commits
897
- */
898
- applicable_product_tags?: Array<string>;
899
- contract?: RecurringCommit.Contract;
900
- /**
901
- * Will be passed down to the individual commits
902
- */
903
- description?: string;
904
- /**
905
- * Determines when the contract will stop creating recurring commits. Optional
906
- */
907
- ending_before?: string;
908
- /**
909
- * Optional configuration for recurring credit hierarchy access control
910
- */
911
- hierarchy_configuration?: RecurringCommit.HierarchyConfiguration;
912
- /**
913
- * The amount the customer should be billed for the commit. Not required.
914
- */
915
- invoice_amount?: RecurringCommit.InvoiceAmount;
916
- /**
917
- * Displayed on invoices. Will be passed through to the individual commits
918
- */
919
- name?: string;
920
- /**
921
- * Will be passed down to the individual commits
922
- */
923
- netsuite_sales_order_id?: string;
924
- /**
925
- * Determines whether the first and last commit will be prorated. If not provided,
926
- * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
927
- */
928
- proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
929
- /**
930
- * The frequency at which the recurring commits will be created. If not provided: -
931
- * The commits will be created on the usage invoice frequency. If provided: - The
932
- * period defined in the duration will correspond to this frequency. - Commits will
933
- * be created aligned with the recurring commit's starting_at rather than the usage
934
- * invoice dates.
935
- */
936
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
937
- /**
938
- * Will be passed down to the individual commits. This controls how much of an
939
- * individual unexpired commit will roll over upon contract transition. Must be
940
- * between 0 and 1.
941
- */
942
- rollover_fraction?: number;
943
- /**
944
- * List of filters that determine what kind of customer usage draws down a commit
945
- * or credit. A customer's usage needs to meet the condition of at least one of the
946
- * specifiers to contribute to a commit's or credit's drawdown.
947
- */
948
- specifiers?: Array<RecurringCommit.Specifier>;
949
- /**
950
- * Attach a subscription to the recurring commit/credit.
951
- */
952
- subscription_config?: RecurringCommit.SubscriptionConfig;
953
- }
954
- namespace RecurringCommit {
955
- /**
956
- * The amount of commit to grant.
957
- */
958
- interface AccessAmount {
959
- credit_type_id: string;
960
- unit_price: number;
961
- quantity?: number;
962
- }
963
- /**
964
- * The amount of time the created commits will be valid for
965
- */
966
- interface CommitDuration {
967
- value: number;
968
- unit?: 'PERIODS';
969
- }
970
- interface Product {
971
- id: string;
972
- name: string;
973
- }
974
- interface Contract {
975
- id: string;
976
- }
977
- /**
978
- * Optional configuration for recurring credit hierarchy access control
979
- */
980
- interface HierarchyConfiguration {
981
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
982
- }
983
- namespace HierarchyConfiguration {
984
- interface CommitHierarchyChildAccessAll {
985
- type: 'ALL';
986
- }
987
- interface CommitHierarchyChildAccessNone {
988
- type: 'NONE';
989
- }
990
- interface CommitHierarchyChildAccessContractIDs {
991
- contract_ids: Array<string>;
992
- type: 'CONTRACT_IDS';
993
- }
994
- }
995
- /**
996
- * The amount the customer should be billed for the commit. Not required.
997
- */
998
- interface InvoiceAmount {
999
- credit_type_id: string;
1000
- quantity: number;
1001
- unit_price: number;
1002
- }
1003
- interface Specifier {
1004
- presentation_group_values?: {
1005
- [key: string]: string;
1006
- };
1007
- pricing_group_values?: {
1008
- [key: string]: string;
1009
- };
1010
- /**
1011
- * If provided, the specifier will only apply to the product with the specified ID.
1012
- */
1013
- product_id?: string;
1014
- /**
1015
- * If provided, the specifier will only apply to products with all the specified
1016
- * tags.
1017
- */
1018
- product_tags?: Array<string>;
1019
- }
1020
- /**
1021
- * Attach a subscription to the recurring commit/credit.
1022
- */
1023
- interface SubscriptionConfig {
1024
- allocation: 'INDIVIDUAL' | 'POOLED';
1025
- apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
1026
- subscription_id: string;
1027
- }
1028
- namespace SubscriptionConfig {
1029
- interface ApplySeatIncreaseConfig {
1030
- /**
1031
- * Indicates whether a mid-period seat increase should be prorated.
1032
- */
1033
- is_prorated: boolean;
1034
- }
1035
- }
1036
- }
1037
- interface RecurringCredit {
1038
- id: string;
1039
- /**
1040
- * The amount of commit to grant.
1041
- */
1042
- access_amount: RecurringCredit.AccessAmount;
1043
- /**
1044
- * The amount of time the created commits will be valid for
1045
- */
1046
- commit_duration: RecurringCredit.CommitDuration;
1047
- /**
1048
- * Will be passed down to the individual commits
1049
- */
1050
- priority: number;
1051
- product: RecurringCredit.Product;
1052
- /**
1053
- * Whether the created commits will use the commit rate or list rate
1054
- */
1055
- rate_type: 'COMMIT_RATE' | 'LIST_RATE';
1056
- /**
1057
- * Determines the start time for the first commit
1058
- */
1059
- starting_at: string;
1060
- /**
1061
- * Will be passed down to the individual commits
1062
- */
1063
- applicable_product_ids?: Array<string>;
1064
- /**
1065
- * Will be passed down to the individual commits
1066
- */
1067
- applicable_product_tags?: Array<string>;
1068
- contract?: RecurringCredit.Contract;
1069
- /**
1070
- * Will be passed down to the individual commits
1071
- */
1072
- description?: string;
1073
- /**
1074
- * Determines when the contract will stop creating recurring commits. Optional
1075
- */
1076
- ending_before?: string;
1077
- /**
1078
- * Optional configuration for recurring credit hierarchy access control
1079
- */
1080
- hierarchy_configuration?: RecurringCredit.HierarchyConfiguration;
1081
- /**
1082
- * Displayed on invoices. Will be passed through to the individual commits
1083
- */
1084
- name?: string;
1085
- /**
1086
- * Will be passed down to the individual commits
1087
- */
1088
- netsuite_sales_order_id?: string;
1089
- /**
1090
- * Determines whether the first and last commit will be prorated. If not provided,
1091
- * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1092
- */
1093
- proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1094
- /**
1095
- * The frequency at which the recurring commits will be created. If not provided: -
1096
- * The commits will be created on the usage invoice frequency. If provided: - The
1097
- * period defined in the duration will correspond to this frequency. - Commits will
1098
- * be created aligned with the recurring commit's starting_at rather than the usage
1099
- * invoice dates.
1100
- */
1101
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1102
- /**
1103
- * Will be passed down to the individual commits. This controls how much of an
1104
- * individual unexpired commit will roll over upon contract transition. Must be
1105
- * between 0 and 1.
1106
- */
1107
- rollover_fraction?: number;
1108
- /**
1109
- * List of filters that determine what kind of customer usage draws down a commit
1110
- * or credit. A customer's usage needs to meet the condition of at least one of the
1111
- * specifiers to contribute to a commit's or credit's drawdown.
1112
- */
1113
- specifiers?: Array<RecurringCredit.Specifier>;
1114
- /**
1115
- * Attach a subscription to the recurring commit/credit.
1116
- */
1117
- subscription_config?: RecurringCredit.SubscriptionConfig;
1118
- }
1119
- namespace RecurringCredit {
1120
- /**
1121
- * The amount of commit to grant.
1122
- */
1123
- interface AccessAmount {
1124
- credit_type_id: string;
1125
- unit_price: number;
1126
- quantity?: number;
1127
- }
1128
- /**
1129
- * The amount of time the created commits will be valid for
1130
- */
1131
- interface CommitDuration {
1132
- value: number;
1133
- unit?: 'PERIODS';
1134
- }
1135
- interface Product {
1136
- id: string;
1137
- name: string;
1138
- }
1139
- interface Contract {
1140
- id: string;
1141
- }
1142
- /**
1143
- * Optional configuration for recurring credit hierarchy access control
1144
- */
1145
- interface HierarchyConfiguration {
1146
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1147
- }
1148
- namespace HierarchyConfiguration {
1149
- interface CommitHierarchyChildAccessAll {
1150
- type: 'ALL';
1151
- }
1152
- interface CommitHierarchyChildAccessNone {
1153
- type: 'NONE';
1154
- }
1155
- interface CommitHierarchyChildAccessContractIDs {
1156
- contract_ids: Array<string>;
1157
- type: 'CONTRACT_IDS';
1158
- }
1159
- }
1160
- interface Specifier {
1161
- presentation_group_values?: {
1162
- [key: string]: string;
1163
- };
1164
- pricing_group_values?: {
1165
- [key: string]: string;
1166
- };
1167
- /**
1168
- * If provided, the specifier will only apply to the product with the specified ID.
1169
- */
1170
- product_id?: string;
1171
- /**
1172
- * If provided, the specifier will only apply to products with all the specified
1173
- * tags.
1174
- */
1175
- product_tags?: Array<string>;
1176
- }
1177
- /**
1178
- * Attach a subscription to the recurring commit/credit.
1179
- */
1180
- interface SubscriptionConfig {
1181
- allocation: 'INDIVIDUAL' | 'POOLED';
1182
- apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
1183
- subscription_id: string;
1184
- }
1185
- namespace SubscriptionConfig {
1186
- interface ApplySeatIncreaseConfig {
1187
- /**
1188
- * Indicates whether a mid-period seat increase should be prorated.
1189
- */
1190
- is_prorated: boolean;
1191
- }
1192
- }
1193
- }
1194
- interface ResellerRoyalty {
1195
- reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
1196
- segments: Array<ResellerRoyalty.Segment>;
1197
- }
1198
- namespace ResellerRoyalty {
1199
- interface Segment {
1200
- fraction: number;
1201
- netsuite_reseller_id: string;
1202
- reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
1203
- starting_at: string;
1204
- applicable_product_ids?: Array<string>;
1205
- applicable_product_tags?: Array<string>;
1206
- aws_account_number?: string;
1207
- aws_offer_id?: string;
1208
- aws_payer_reference_id?: string;
1209
- ending_before?: string;
1210
- gcp_account_id?: string;
1211
- gcp_offer_id?: string;
1212
- reseller_contract_value?: number;
1213
- }
1214
- }
1215
- interface SpendThresholdConfiguration {
1216
- commit: SpendThresholdConfiguration.Commit;
1217
- /**
1218
- * When set to false, the contract will not be evaluated against the
1219
- * threshold_amount. Toggling to true will result an immediate evaluation,
1220
- * regardless of prior state.
1221
- */
1222
- is_enabled: boolean;
1223
- payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
1224
- /**
1225
- * Specify the threshold amount for the contract. Each time the contract's usage
1226
- * hits this amount, a threshold charge will be initiated.
1227
- */
1228
- threshold_amount: number;
1229
- }
1230
- namespace SpendThresholdConfiguration {
1231
- interface Commit {
1232
- /**
1233
- * The commit product that will be used to generate the line item for commit
1234
- * payment.
1235
- */
1236
- product_id: string;
1237
- description?: string;
1238
- /**
1239
- * Specify the name of the line item for the threshold charge. If left blank, it
1240
- * will default to the commit product name.
1241
- */
1242
- name?: string;
1243
- }
1244
- interface PaymentGateConfig {
1245
- /**
1246
- * Gate access to the commit balance based on successful collection of payment.
1247
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1248
- * facilitate payment using your own payment integration. Select NONE if you do not
1249
- * wish to payment gate the commit balance.
1250
- */
1251
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1252
- /**
1253
- * Only applicable if using PRECALCULATED as your tax type.
1254
- */
1255
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1256
- /**
1257
- * Only applicable if using STRIPE as your payment gateway type.
1258
- */
1259
- stripe_config?: PaymentGateConfig.StripeConfig;
1260
- /**
1261
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1262
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1263
- * will default to NONE.
1264
- */
1265
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1266
- }
1267
- namespace PaymentGateConfig {
1268
- /**
1269
- * Only applicable if using PRECALCULATED as your tax type.
1270
- */
1271
- interface PrecalculatedTaxConfig {
1272
- /**
1273
- * Amount of tax to be applied. This should be in the same currency and
1274
- * denomination as the commit's invoice schedule
1275
- */
1276
- tax_amount: number;
1277
- /**
1278
- * Name of the tax to be applied. This may be used in an invoice line item
1279
- * description.
1280
- */
1281
- tax_name?: string;
1282
- }
1283
- /**
1284
- * Only applicable if using STRIPE as your payment gateway type.
1285
- */
1286
- interface StripeConfig {
1287
- /**
1288
- * If left blank, will default to INVOICE
1289
- */
1290
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1291
- /**
1292
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1293
- * your payment type.
1294
- */
1295
- invoice_metadata?: {
1296
- [key: string]: string;
1297
- };
1298
- }
1299
- }
1300
- }
1301
- interface Subscription {
1302
- collection_schedule: 'ADVANCE' | 'ARREARS';
1303
- proration: Subscription.Proration;
1304
- /**
1305
- * List of quantity schedule items for the subscription. Only includes the current
1306
- * quantity and future quantity changes.
1307
- */
1308
- quantity_schedule: Array<Subscription.QuantitySchedule>;
1309
- starting_at: string;
1310
- subscription_rate: Subscription.SubscriptionRate;
1311
- id?: string;
1312
- custom_fields?: {
1313
- [key: string]: string;
1314
- };
1315
- description?: string;
1316
- ending_before?: string;
1317
- fiat_credit_type_id?: string;
1318
- name?: string;
1319
- }
1320
- namespace Subscription {
1321
- interface Proration {
1322
- invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
1323
- is_prorated: boolean;
1324
- }
1325
- interface QuantitySchedule {
1326
- quantity: number;
1327
- starting_at: string;
1328
- ending_before?: string;
1329
- }
1330
- interface SubscriptionRate {
1331
- billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1332
- product: SubscriptionRate.Product;
1333
- }
1334
- namespace SubscriptionRate {
1335
- interface Product {
1336
- id: string;
1337
- name: string;
1338
- }
1339
- }
1340
- }
1341
- }
1342
- }
1343
- export interface ContractListResponse {
1344
- data: Array<ContractListResponse.Data>;
1345
- }
1346
- export declare namespace ContractListResponse {
1347
- interface Data {
1348
- id: string;
1349
- commits: Array<Data.Commit>;
1350
- created_at: string;
1351
- created_by: string;
1352
- customer_id: string;
1353
- overrides: Array<Data.Override>;
1354
- scheduled_charges: Array<Shared.ScheduledCharge>;
1355
- starting_at: string;
1356
- transitions: Array<Data.Transition>;
1357
- usage_filter: Array<Data.UsageFilter>;
1358
- usage_statement_schedule: Data.UsageStatementSchedule;
1359
- archived_at?: string;
1360
- credits?: Array<Data.Credit>;
1361
- custom_fields?: {
1362
- [key: string]: string;
1363
- };
1364
- /**
1365
- * This field's availability is dependent on your client's configuration.
1366
- */
1367
- customer_billing_provider_configuration?: Data.CustomerBillingProviderConfiguration;
1368
- /**
1369
- * This field's availability is dependent on your client's configuration.
1370
- */
1371
- discounts?: Array<Shared.Discount>;
1372
- ending_before?: string;
1373
- /**
1374
- * Indicates whether there are more items than the limit for this endpoint. Use the
1375
- * respective list endpoints to get the full lists.
1376
- */
1377
- has_more?: Data.HasMore;
1378
- /**
1379
- * Either a **parent** configuration with a list of children or a **child**
1380
- * configuration with a single parent.
1381
- */
1382
- hierarchy_configuration?: Data.ParentHierarchyConfiguration | Data.ChildHierarchyConfiguration;
1383
- /**
1384
- * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
1385
- * prices automatically. EXPLICIT prioritization requires specifying priorities for
1386
- * each multiplier; the one with the lowest priority value will be prioritized
1387
- * first.
1388
- */
1389
- multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';
1390
- name?: string;
1391
- net_payment_terms_days?: number;
1392
- /**
1393
- * This field's availability is dependent on your client's configuration.
1394
- */
1395
- netsuite_sales_order_id?: string;
1396
- prepaid_balance_threshold_configuration?: Data.PrepaidBalanceThresholdConfiguration;
1397
- /**
1398
- * Priority of the contract.
1399
- */
1400
- priority?: number;
1401
- /**
1402
- * This field's availability is dependent on your client's configuration.
1403
- */
1404
- professional_services?: Array<Shared.ProService>;
1405
- rate_card_id?: string;
1406
- recurring_commits?: Array<Data.RecurringCommit>;
1407
- recurring_credits?: Array<Data.RecurringCredit>;
1408
- /**
1409
- * This field's availability is dependent on your client's configuration.
1410
- */
1411
- reseller_royalties?: Array<Data.ResellerRoyalty>;
1412
- /**
1413
- * This field's availability is dependent on your client's configuration.
1414
- */
1415
- salesforce_opportunity_id?: string;
1416
- /**
1417
- * Determines which scheduled and commit charges to consolidate onto the Contract's
1418
- * usage invoice. The charge's `timestamp` must match the usage invoice's
1419
- * `ending_before` date for consolidation to occur. This field cannot be modified
1420
- * after a Contract has been created. If this field is omitted, charges will appear
1421
- * on a separate invoice from usage charges.
1422
- */
1423
- scheduled_charges_on_usage_invoices?: 'ALL';
1424
- spend_threshold_configuration?: Data.SpendThresholdConfiguration;
1425
- /**
1426
- * List of subscriptions on the contract.
1427
- */
1428
- subscriptions?: Array<Data.Subscription>;
1429
- total_contract_value?: number;
1430
- /**
1431
- * Prevents the creation of duplicates. If a request to create a record is made
1432
- * with a previously used uniqueness key, a new record will not be created and the
1433
- * request will fail with a 409 error.
1434
- */
1435
- uniqueness_key?: string;
1436
- }
1437
- namespace Data {
1438
- interface Commit {
1439
- id: string;
1440
- product: Commit.Product;
1441
- type: 'PREPAID' | 'POSTPAID';
1442
- /**
1443
- * The schedule that the customer will gain access to the credits purposed with
1444
- * this commit.
1445
- */
1446
- access_schedule?: Shared.ScheduleDuration;
1447
- applicable_contract_ids?: Array<string>;
1448
- applicable_product_ids?: Array<string>;
1449
- applicable_product_tags?: Array<string>;
1450
- archived_at?: string;
1451
- /**
1452
- * The current balance of the credit or commit. This balance reflects the amount of
1453
- * credit or commit that the customer has access to use at this moment - thus,
1454
- * expired and upcoming credit or commit segments contribute 0 to the balance. The
1455
- * balance will match the sum of all ledger entries with the exception of the case
1456
- * where the sum of negative manual ledger entries exceeds the positive amount
1457
- * remaining on the credit or commit - in that case, the balance will be 0. All
1458
- * manual ledger entries associated with active credit or commit segments are
1459
- * included in the balance, including future-dated manual ledger entries.
1460
- */
1461
- balance?: number;
1462
- contract?: Commit.Contract;
1463
- custom_fields?: {
1464
- [key: string]: string;
1465
- };
1466
- description?: string;
1467
- /**
1468
- * Optional configuration for commit hierarchy access control
1469
- */
1470
- hierarchy_configuration?: Commit.HierarchyConfiguration;
1471
- /**
1472
- * The contract that this commit will be billed on.
1473
- */
1474
- invoice_contract?: Commit.InvoiceContract;
1475
- /**
1476
- * The schedule that the customer will be invoiced for this commit.
1477
- */
1478
- invoice_schedule?: Shared.SchedulePointInTime;
1479
- /**
1480
- * A list of ordered events that impact the balance of a commit. For example, an
1481
- * invoice deduction or a rollover.
1482
- */
1483
- ledger?: Array<Commit.PrepaidCommitSegmentStartLedgerEntry | Commit.PrepaidCommitAutomatedInvoiceDeductionLedgerEntry | Commit.PrepaidCommitRolloverLedgerEntry | Commit.PrepaidCommitExpirationLedgerEntry | Commit.PrepaidCommitCanceledLedgerEntry | Commit.PrepaidCommitCreditedLedgerEntry | Commit.PrepaidCommitSeatBasedAdjustmentLedgerEntry | Commit.PostpaidCommitInitialBalanceLedgerEntry | Commit.PostpaidCommitAutomatedInvoiceDeductionLedgerEntry | Commit.PostpaidCommitRolloverLedgerEntry | Commit.PostpaidCommitTrueupLedgerEntry | Commit.PrepaidCommitManualLedgerEntry | Commit.PostpaidCommitManualLedgerEntry | Commit.PostpaidCommitExpirationLedgerEntry>;
1484
- name?: string;
1485
- /**
1486
- * This field's availability is dependent on your client's configuration.
1487
- */
1488
- netsuite_sales_order_id?: string;
1489
- /**
1490
- * If multiple credits or commits are applicable, the one with the lower priority
1491
- * will apply first.
1492
- */
1493
- priority?: number;
1494
- rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
1495
- rolled_over_from?: Commit.RolledOverFrom;
1496
- rollover_fraction?: number;
1497
- /**
1498
- * This field's availability is dependent on your client's configuration.
1499
- */
1500
- salesforce_opportunity_id?: string;
1501
- /**
1502
- * List of filters that determine what kind of customer usage draws down a commit
1503
- * or credit. A customer's usage needs to meet the condition of at least one of the
1504
- * specifiers to contribute to a commit's or credit's drawdown.
1505
- */
1506
- specifiers?: Array<Commit.Specifier>;
1507
- }
1508
- namespace Commit {
1509
- interface Product {
1510
- id: string;
1511
- name: string;
1512
- }
1513
- interface Contract {
1514
- id: string;
1515
- }
1516
- /**
1517
- * Optional configuration for commit hierarchy access control
1518
- */
1519
- interface HierarchyConfiguration {
1520
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1521
- }
1522
- namespace HierarchyConfiguration {
1523
- interface CommitHierarchyChildAccessAll {
1524
- type: 'ALL';
1525
- }
1526
- interface CommitHierarchyChildAccessNone {
1527
- type: 'NONE';
1528
- }
1529
- interface CommitHierarchyChildAccessContractIDs {
1530
- contract_ids: Array<string>;
1531
- type: 'CONTRACT_IDS';
1532
- }
1533
- }
1534
- /**
1535
- * The contract that this commit will be billed on.
1536
- */
1537
- interface InvoiceContract {
1538
- id: string;
1539
- }
1540
- interface PrepaidCommitSegmentStartLedgerEntry {
1541
- amount: number;
1542
- segment_id: string;
1543
- timestamp: string;
1544
- type: 'PREPAID_COMMIT_SEGMENT_START';
1545
- }
1546
- interface PrepaidCommitAutomatedInvoiceDeductionLedgerEntry {
1547
- amount: number;
1548
- invoice_id: string;
1549
- segment_id: string;
1550
- timestamp: string;
1551
- type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
1552
- contract_id?: string;
1553
- }
1554
- interface PrepaidCommitRolloverLedgerEntry {
1555
- amount: number;
1556
- new_contract_id: string;
1557
- segment_id: string;
1558
- timestamp: string;
1559
- type: 'PREPAID_COMMIT_ROLLOVER';
1560
- }
1561
- interface PrepaidCommitExpirationLedgerEntry {
1562
- amount: number;
1563
- segment_id: string;
1564
- timestamp: string;
1565
- type: 'PREPAID_COMMIT_EXPIRATION';
1566
- }
1567
- interface PrepaidCommitCanceledLedgerEntry {
1568
- amount: number;
1569
- invoice_id: string;
1570
- segment_id: string;
1571
- timestamp: string;
1572
- type: 'PREPAID_COMMIT_CANCELED';
1573
- contract_id?: string;
1574
- }
1575
- interface PrepaidCommitCreditedLedgerEntry {
1576
- amount: number;
1577
- invoice_id: string;
1578
- segment_id: string;
1579
- timestamp: string;
1580
- type: 'PREPAID_COMMIT_CREDITED';
1581
- contract_id?: string;
1582
- }
1583
- interface PrepaidCommitSeatBasedAdjustmentLedgerEntry {
1584
- amount: number;
1585
- segment_id: string;
1586
- timestamp: string;
1587
- type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT';
1588
- }
1589
- interface PostpaidCommitInitialBalanceLedgerEntry {
1590
- amount: number;
1591
- timestamp: string;
1592
- type: 'POSTPAID_COMMIT_INITIAL_BALANCE';
1593
- }
1594
- interface PostpaidCommitAutomatedInvoiceDeductionLedgerEntry {
1595
- amount: number;
1596
- invoice_id: string;
1597
- segment_id: string;
1598
- timestamp: string;
1599
- type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
1600
- contract_id?: string;
1601
- }
1602
- interface PostpaidCommitRolloverLedgerEntry {
1603
- amount: number;
1604
- new_contract_id: string;
1605
- segment_id: string;
1606
- timestamp: string;
1607
- type: 'POSTPAID_COMMIT_ROLLOVER';
1608
- }
1609
- interface PostpaidCommitTrueupLedgerEntry {
1610
- amount: number;
1611
- invoice_id: string;
1612
- timestamp: string;
1613
- type: 'POSTPAID_COMMIT_TRUEUP';
1614
- contract_id?: string;
1615
- }
1616
- interface PrepaidCommitManualLedgerEntry {
1617
- amount: number;
1618
- reason: string;
1619
- timestamp: string;
1620
- type: 'PREPAID_COMMIT_MANUAL';
1621
- }
1622
- interface PostpaidCommitManualLedgerEntry {
1623
- amount: number;
1624
- reason: string;
1625
- timestamp: string;
1626
- type: 'POSTPAID_COMMIT_MANUAL';
1627
- }
1628
- interface PostpaidCommitExpirationLedgerEntry {
1629
- amount: number;
1630
- timestamp: string;
1631
- type: 'POSTPAID_COMMIT_EXPIRATION';
1632
- }
1633
- interface RolledOverFrom {
1634
- commit_id: string;
1635
- contract_id: string;
1636
- }
1637
- interface Specifier {
1638
- presentation_group_values?: {
1639
- [key: string]: string;
1640
- };
1641
- pricing_group_values?: {
1642
- [key: string]: string;
1643
- };
1644
- /**
1645
- * If provided, the specifier will only apply to the product with the specified ID.
1646
- */
1647
- product_id?: string;
1648
- /**
1649
- * If provided, the specifier will only apply to products with all the specified
1650
- * tags.
1651
- */
1652
- product_tags?: Array<string>;
1653
- }
1654
- }
1655
- interface Override {
1656
- id: string;
1657
- starting_at: string;
1658
- applicable_product_tags?: Array<string>;
1659
- ending_before?: string;
1660
- entitled?: boolean;
1661
- is_commit_specific?: boolean;
1662
- multiplier?: number;
1663
- override_specifiers?: Array<Override.OverrideSpecifier>;
1664
- override_tiers?: Array<Override.OverrideTier>;
1665
- overwrite_rate?: Override.OverwriteRate;
1666
- priority?: number;
1667
- product?: Override.Product;
1668
- target?: 'COMMIT_RATE' | 'LIST_RATE';
1669
- type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
1670
- }
1671
- namespace Override {
1672
- interface OverrideSpecifier {
1673
- billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1674
- commit_ids?: Array<string>;
1675
- presentation_group_values?: {
1676
- [key: string]: string | null;
1677
- };
1678
- pricing_group_values?: {
1679
- [key: string]: string;
1680
- };
1681
- product_id?: string;
1682
- product_tags?: Array<string>;
1683
- recurring_commit_ids?: Array<string>;
1684
- recurring_credit_ids?: Array<string>;
1685
- }
1686
- interface OverrideTier {
1687
- multiplier: number;
1688
- size?: number;
1689
- }
1690
- interface OverwriteRate {
1691
- rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
1692
- credit_type?: Shared.CreditTypeData;
1693
- /**
1694
- * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1695
- * processors.
1696
- */
1697
- custom_rate?: {
1698
- [key: string]: unknown;
1699
- };
1700
- /**
1701
- * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
1702
- * set to true.
1703
- */
1704
- is_prorated?: boolean;
1705
- /**
1706
- * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
1707
- * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
1708
- */
1709
- price?: number;
1710
- /**
1711
- * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
1712
- */
1713
- quantity?: number;
1714
- /**
1715
- * Only set for TIERED rate_type.
1716
- */
1717
- tiers?: Array<Shared.Tier>;
1718
- }
1719
- interface Product {
1720
- id: string;
1721
- name: string;
1722
- }
1723
- }
1724
- interface Transition {
1725
- from_contract_id: string;
1726
- to_contract_id: string;
1727
- type: 'SUPERSEDE' | 'RENEWAL';
1728
- }
1729
- interface UsageFilter {
1730
- group_key: string;
1731
- group_values: Array<string>;
1732
- /**
1733
- * This will match contract starting_at value if usage filter is active from the
1734
- * beginning of the contract.
1735
- */
1736
- starting_at: string;
1737
- /**
1738
- * This will match contract ending_before value if usage filter is active until the
1739
- * end of the contract. It will be undefined if the contract is open-ended.
1740
- */
1741
- ending_before?: string;
1742
- }
1743
- interface UsageStatementSchedule {
1744
- /**
1745
- * Contract usage statements follow a selected cadence based on this date.
1746
- */
1747
- billing_anchor_date: string;
1748
- frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1749
- }
1750
- interface Credit {
1751
- id: string;
1752
- product: Credit.Product;
1753
- type: 'CREDIT';
1754
- /**
1755
- * The schedule that the customer will gain access to the credits.
1756
- */
1757
- access_schedule?: Shared.ScheduleDuration;
1758
- applicable_contract_ids?: Array<string>;
1759
- applicable_product_ids?: Array<string>;
1760
- applicable_product_tags?: Array<string>;
1761
- /**
1762
- * The current balance of the credit or commit. This balance reflects the amount of
1763
- * credit or commit that the customer has access to use at this moment - thus,
1764
- * expired and upcoming credit or commit segments contribute 0 to the balance. The
1765
- * balance will match the sum of all ledger entries with the exception of the case
1766
- * where the sum of negative manual ledger entries exceeds the positive amount
1767
- * remaining on the credit or commit - in that case, the balance will be 0. All
1768
- * manual ledger entries associated with active credit or commit segments are
1769
- * included in the balance, including future-dated manual ledger entries.
1770
- */
1771
- balance?: number;
1772
- contract?: Credit.Contract;
1773
- custom_fields?: {
1774
- [key: string]: string;
1775
- };
1776
- description?: string;
1777
- /**
1778
- * Optional configuration for credit hierarchy access control
1779
- */
1780
- hierarchy_configuration?: Credit.HierarchyConfiguration;
1781
- /**
1782
- * A list of ordered events that impact the balance of a credit. For example, an
1783
- * invoice deduction or an expiration.
1784
- */
1785
- ledger?: Array<Credit.CreditSegmentStartLedgerEntry | Credit.CreditAutomatedInvoiceDeductionLedgerEntry | Credit.CreditExpirationLedgerEntry | Credit.CreditCanceledLedgerEntry | Credit.CreditCreditedLedgerEntry | Credit.CreditManualLedgerEntry | Credit.CreditSeatBasedAdjustmentLedgerEntry>;
1786
- name?: string;
1787
- /**
1788
- * This field's availability is dependent on your client's configuration.
1789
- */
1790
- netsuite_sales_order_id?: string;
1791
- /**
1792
- * If multiple credits or commits are applicable, the one with the lower priority
1793
- * will apply first.
1794
- */
1795
- priority?: number;
1796
- /**
1797
- * This field's availability is dependent on your client's configuration.
1798
- */
1799
- salesforce_opportunity_id?: string;
1800
- /**
1801
- * List of filters that determine what kind of customer usage draws down a commit
1802
- * or credit. A customer's usage needs to meet the condition of at least one of the
1803
- * specifiers to contribute to a commit's or credit's drawdown.
1804
- */
1805
- specifiers?: Array<Credit.Specifier>;
1806
- }
1807
- namespace Credit {
1808
- interface Product {
1809
- id: string;
1810
- name: string;
1811
- }
1812
- interface Contract {
1813
- id: string;
1814
- }
1815
- /**
1816
- * Optional configuration for credit hierarchy access control
1817
- */
1818
- interface HierarchyConfiguration {
1819
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1820
- }
1821
- namespace HierarchyConfiguration {
1822
- interface CommitHierarchyChildAccessAll {
1823
- type: 'ALL';
1824
- }
1825
- interface CommitHierarchyChildAccessNone {
1826
- type: 'NONE';
1827
- }
1828
- interface CommitHierarchyChildAccessContractIDs {
1829
- contract_ids: Array<string>;
1830
- type: 'CONTRACT_IDS';
1831
- }
1832
- }
1833
- interface CreditSegmentStartLedgerEntry {
1834
- amount: number;
1835
- segment_id: string;
1836
- timestamp: string;
1837
- type: 'CREDIT_SEGMENT_START';
1838
- }
1839
- interface CreditAutomatedInvoiceDeductionLedgerEntry {
1840
- amount: number;
1841
- invoice_id: string;
1842
- segment_id: string;
1843
- timestamp: string;
1844
- type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION';
1845
- contract_id?: string;
1846
- }
1847
- interface CreditExpirationLedgerEntry {
1848
- amount: number;
1849
- segment_id: string;
1850
- timestamp: string;
1851
- type: 'CREDIT_EXPIRATION';
1852
- }
1853
- interface CreditCanceledLedgerEntry {
1854
- amount: number;
1855
- invoice_id: string;
1856
- segment_id: string;
1857
- timestamp: string;
1858
- type: 'CREDIT_CANCELED';
1859
- contract_id?: string;
1860
- }
1861
- interface CreditCreditedLedgerEntry {
1862
- amount: number;
1863
- invoice_id: string;
1864
- segment_id: string;
1865
- timestamp: string;
1866
- type: 'CREDIT_CREDITED';
1867
- contract_id?: string;
1868
- }
1869
- interface CreditManualLedgerEntry {
1870
- amount: number;
1871
- reason: string;
1872
- timestamp: string;
1873
- type: 'CREDIT_MANUAL';
1874
- }
1875
- interface CreditSeatBasedAdjustmentLedgerEntry {
1876
- amount: number;
1877
- segment_id: string;
1878
- timestamp: string;
1879
- type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
1880
- }
1881
- interface Specifier {
1882
- presentation_group_values?: {
1883
- [key: string]: string;
1884
- };
1885
- pricing_group_values?: {
1886
- [key: string]: string;
1887
- };
1888
- /**
1889
- * If provided, the specifier will only apply to the product with the specified ID.
1890
- */
1891
- product_id?: string;
1892
- /**
1893
- * If provided, the specifier will only apply to products with all the specified
1894
- * tags.
1895
- */
1896
- product_tags?: Array<string>;
1897
- }
1898
- }
1899
- /**
1900
- * This field's availability is dependent on your client's configuration.
1901
- */
1902
- interface CustomerBillingProviderConfiguration {
1903
- /**
1904
- * ID of Customer's billing provider configuration.
1905
- */
1906
- id: string;
1907
- billing_provider: 'aws_marketplace' | 'stripe' | 'netsuite' | 'custom' | 'azure_marketplace' | 'quickbooks_online' | 'workday' | 'gcp_marketplace';
1908
- delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
1909
- }
1910
- /**
1911
- * Indicates whether there are more items than the limit for this endpoint. Use the
1912
- * respective list endpoints to get the full lists.
1913
- */
1914
- interface HasMore {
1915
- /**
1916
- * Whether there are more commits on this contract than the limit for this
1917
- * endpoint. Use the /contracts/customerCommits/list endpoint to get the full list
1918
- * of commits.
1919
- */
1920
- commits: boolean;
1921
- /**
1922
- * Whether there are more credits on this contract than the limit for this
1923
- * endpoint. Use the /contracts/customerCredits/list endpoint to get the full list
1924
- * of credits.
1925
- */
1926
- credits: boolean;
1927
- }
1928
- interface ParentHierarchyConfiguration {
1929
- /**
1930
- * List of contracts that belong to this parent.
1931
- */
1932
- children: Array<ParentHierarchyConfiguration.Child>;
1933
- }
1934
- namespace ParentHierarchyConfiguration {
1935
- interface Child {
1936
- contract_id: string;
1937
- customer_id: string;
1938
- }
1939
- }
1940
- interface ChildHierarchyConfiguration {
1941
- /**
1942
- * The single parent contract/customer for this child.
1943
- */
1944
- parent: ChildHierarchyConfiguration.Parent;
1945
- }
1946
- namespace ChildHierarchyConfiguration {
1947
- /**
1948
- * The single parent contract/customer for this child.
1949
- */
1950
- interface Parent {
1951
- contract_id: string;
1952
- customer_id: string;
1953
- }
1954
- }
1955
- interface PrepaidBalanceThresholdConfiguration {
1956
- commit: PrepaidBalanceThresholdConfiguration.Commit;
1957
- /**
1958
- * When set to false, the contract will not be evaluated against the
1959
- * threshold_amount. Toggling to true will result an immediate evaluation,
1960
- * regardless of prior state.
1961
- */
1962
- is_enabled: boolean;
1963
- payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
1964
- /**
1965
- * Specify the amount the balance should be recharged to.
1966
- */
1967
- recharge_to_amount: number;
1968
- /**
1969
- * Specify the threshold amount for the contract. Each time the contract's balance
1970
- * lowers to this amount, a threshold charge will be initiated.
1971
- */
1972
- threshold_amount: number;
1973
- /**
1974
- * If provided, the threshold, recharge-to amount, and the resulting threshold
1975
- * commit amount will be in terms of this credit type instead of the fiat currency.
1976
- */
1977
- custom_credit_type_id?: string;
1978
- }
1979
- namespace PrepaidBalanceThresholdConfiguration {
1980
- interface Commit {
1981
- /**
1982
- * The commit product that will be used to generate the line item for commit
1983
- * payment.
1984
- */
1985
- product_id: string;
1986
- /**
1987
- * Which products the threshold commit applies to. If applicable_product_ids,
1988
- * applicable_product_tags or specifiers are not provided, the commit applies to
1989
- * all products.
1990
- */
1991
- applicable_product_ids?: Array<string>;
1992
- /**
1993
- * Which tags the threshold commit applies to. If applicable_product_ids,
1994
- * applicable_product_tags or specifiers are not provided, the commit applies to
1995
- * all products.
1996
- */
1997
- applicable_product_tags?: Array<string>;
1998
- description?: string;
1999
- /**
2000
- * Specify the name of the line item for the threshold charge. If left blank, it
2001
- * will default to the commit product name.
2002
- */
2003
- name?: string;
2004
- /**
2005
- * List of filters that determine what kind of customer usage draws down a commit
2006
- * or credit. A customer's usage needs to meet the condition of at least one of the
2007
- * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2008
- * be used together with `applicable_product_ids` or `applicable_product_tags`.
2009
- * Instead, to target usage by product or product tag, pass those values in the
2010
- * body of `specifiers`.
2011
- */
2012
- specifiers?: Array<Commit.Specifier>;
2013
- }
2014
- namespace Commit {
2015
- interface Specifier {
2016
- presentation_group_values?: {
2017
- [key: string]: string;
2018
- };
2019
- pricing_group_values?: {
2020
- [key: string]: string;
2021
- };
2022
- /**
2023
- * If provided, the specifier will only apply to the product with the specified ID.
2024
- */
2025
- product_id?: string;
2026
- /**
2027
- * If provided, the specifier will only apply to products with all the specified
2028
- * tags.
2029
- */
2030
- product_tags?: Array<string>;
2031
- }
2032
- }
2033
- interface PaymentGateConfig {
2034
- /**
2035
- * Gate access to the commit balance based on successful collection of payment.
2036
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
2037
- * facilitate payment using your own payment integration. Select NONE if you do not
2038
- * wish to payment gate the commit balance.
2039
- */
2040
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
2041
- /**
2042
- * Only applicable if using PRECALCULATED as your tax type.
2043
- */
2044
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
2045
- /**
2046
- * Only applicable if using STRIPE as your payment gateway type.
2047
- */
2048
- stripe_config?: PaymentGateConfig.StripeConfig;
2049
- /**
2050
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
2051
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
2052
- * will default to NONE.
2053
- */
2054
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
2055
- }
2056
- namespace PaymentGateConfig {
2057
- /**
2058
- * Only applicable if using PRECALCULATED as your tax type.
2059
- */
2060
- interface PrecalculatedTaxConfig {
2061
- /**
2062
- * Amount of tax to be applied. This should be in the same currency and
2063
- * denomination as the commit's invoice schedule
2064
- */
2065
- tax_amount: number;
2066
- /**
2067
- * Name of the tax to be applied. This may be used in an invoice line item
2068
- * description.
2069
- */
2070
- tax_name?: string;
2071
- }
2072
- /**
2073
- * Only applicable if using STRIPE as your payment gateway type.
2074
- */
2075
- interface StripeConfig {
2076
- /**
2077
- * If left blank, will default to INVOICE
2078
- */
2079
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
2080
- /**
2081
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
2082
- * your payment type.
2083
- */
2084
- invoice_metadata?: {
2085
- [key: string]: string;
2086
- };
2087
- }
2088
- }
2089
- }
2090
- interface RecurringCommit {
2091
- id: string;
2092
- /**
2093
- * The amount of commit to grant.
2094
- */
2095
- access_amount: RecurringCommit.AccessAmount;
2096
- /**
2097
- * The amount of time the created commits will be valid for
2098
- */
2099
- commit_duration: RecurringCommit.CommitDuration;
2100
- /**
2101
- * Will be passed down to the individual commits
2102
- */
2103
- priority: number;
2104
- product: RecurringCommit.Product;
2105
- /**
2106
- * Whether the created commits will use the commit rate or list rate
2107
- */
2108
- rate_type: 'COMMIT_RATE' | 'LIST_RATE';
2109
- /**
2110
- * Determines the start time for the first commit
2111
- */
2112
- starting_at: string;
2113
- /**
2114
- * Will be passed down to the individual commits
2115
- */
2116
- applicable_product_ids?: Array<string>;
2117
- /**
2118
- * Will be passed down to the individual commits
2119
- */
2120
- applicable_product_tags?: Array<string>;
2121
- contract?: RecurringCommit.Contract;
2122
- /**
2123
- * Will be passed down to the individual commits
2124
- */
2125
- description?: string;
2126
- /**
2127
- * Determines when the contract will stop creating recurring commits. Optional
2128
- */
2129
- ending_before?: string;
2130
- /**
2131
- * Optional configuration for recurring credit hierarchy access control
2132
- */
2133
- hierarchy_configuration?: RecurringCommit.HierarchyConfiguration;
2134
- /**
2135
- * The amount the customer should be billed for the commit. Not required.
2136
- */
2137
- invoice_amount?: RecurringCommit.InvoiceAmount;
2138
- /**
2139
- * Displayed on invoices. Will be passed through to the individual commits
2140
- */
2141
- name?: string;
2142
- /**
2143
- * Will be passed down to the individual commits
2144
- */
2145
- netsuite_sales_order_id?: string;
2146
- /**
2147
- * Determines whether the first and last commit will be prorated. If not provided,
2148
- * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
2149
- */
2150
- proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
2151
- /**
2152
- * The frequency at which the recurring commits will be created. If not provided: -
2153
- * The commits will be created on the usage invoice frequency. If provided: - The
2154
- * period defined in the duration will correspond to this frequency. - Commits will
2155
- * be created aligned with the recurring commit's starting_at rather than the usage
2156
- * invoice dates.
2157
- */
2158
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2159
- /**
2160
- * Will be passed down to the individual commits. This controls how much of an
2161
- * individual unexpired commit will roll over upon contract transition. Must be
2162
- * between 0 and 1.
2163
- */
2164
- rollover_fraction?: number;
2165
- /**
2166
- * List of filters that determine what kind of customer usage draws down a commit
2167
- * or credit. A customer's usage needs to meet the condition of at least one of the
2168
- * specifiers to contribute to a commit's or credit's drawdown.
2169
- */
2170
- specifiers?: Array<RecurringCommit.Specifier>;
2171
- /**
2172
- * Attach a subscription to the recurring commit/credit.
2173
- */
2174
- subscription_config?: RecurringCommit.SubscriptionConfig;
2175
- }
2176
- namespace RecurringCommit {
2177
- /**
2178
- * The amount of commit to grant.
2179
- */
2180
- interface AccessAmount {
2181
- credit_type_id: string;
2182
- unit_price: number;
2183
- quantity?: number;
2184
- }
2185
- /**
2186
- * The amount of time the created commits will be valid for
2187
- */
2188
- interface CommitDuration {
2189
- value: number;
2190
- unit?: 'PERIODS';
2191
- }
2192
- interface Product {
2193
- id: string;
2194
- name: string;
2195
- }
2196
- interface Contract {
2197
- id: string;
2198
- }
2199
- /**
2200
- * Optional configuration for recurring credit hierarchy access control
2201
- */
2202
- interface HierarchyConfiguration {
2203
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
2204
- }
2205
- namespace HierarchyConfiguration {
2206
- interface CommitHierarchyChildAccessAll {
2207
- type: 'ALL';
2208
- }
2209
- interface CommitHierarchyChildAccessNone {
2210
- type: 'NONE';
2211
- }
2212
- interface CommitHierarchyChildAccessContractIDs {
2213
- contract_ids: Array<string>;
2214
- type: 'CONTRACT_IDS';
2215
- }
2216
- }
2217
- /**
2218
- * The amount the customer should be billed for the commit. Not required.
2219
- */
2220
- interface InvoiceAmount {
2221
- credit_type_id: string;
2222
- quantity: number;
2223
- unit_price: number;
2224
- }
2225
- interface Specifier {
2226
- presentation_group_values?: {
2227
- [key: string]: string;
2228
- };
2229
- pricing_group_values?: {
2230
- [key: string]: string;
2231
- };
2232
- /**
2233
- * If provided, the specifier will only apply to the product with the specified ID.
2234
- */
2235
- product_id?: string;
2236
- /**
2237
- * If provided, the specifier will only apply to products with all the specified
2238
- * tags.
2239
- */
2240
- product_tags?: Array<string>;
2241
- }
2242
- /**
2243
- * Attach a subscription to the recurring commit/credit.
2244
- */
2245
- interface SubscriptionConfig {
2246
- allocation: 'INDIVIDUAL' | 'POOLED';
2247
- apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
2248
- subscription_id: string;
2249
- }
2250
- namespace SubscriptionConfig {
2251
- interface ApplySeatIncreaseConfig {
2252
- /**
2253
- * Indicates whether a mid-period seat increase should be prorated.
2254
- */
2255
- is_prorated: boolean;
2256
- }
2257
- }
2258
- }
2259
- interface RecurringCredit {
2260
- id: string;
2261
- /**
2262
- * The amount of commit to grant.
2263
- */
2264
- access_amount: RecurringCredit.AccessAmount;
2265
- /**
2266
- * The amount of time the created commits will be valid for
2267
- */
2268
- commit_duration: RecurringCredit.CommitDuration;
2269
- /**
2270
- * Will be passed down to the individual commits
2271
- */
2272
- priority: number;
2273
- product: RecurringCredit.Product;
2274
- /**
2275
- * Whether the created commits will use the commit rate or list rate
2276
- */
2277
- rate_type: 'COMMIT_RATE' | 'LIST_RATE';
2278
- /**
2279
- * Determines the start time for the first commit
2280
- */
2281
- starting_at: string;
2282
- /**
2283
- * Will be passed down to the individual commits
2284
- */
2285
- applicable_product_ids?: Array<string>;
2286
- /**
2287
- * Will be passed down to the individual commits
2288
- */
2289
- applicable_product_tags?: Array<string>;
2290
- contract?: RecurringCredit.Contract;
2291
- /**
2292
- * Will be passed down to the individual commits
2293
- */
2294
- description?: string;
2295
- /**
2296
- * Determines when the contract will stop creating recurring commits. Optional
2297
- */
2298
- ending_before?: string;
2299
- /**
2300
- * Optional configuration for recurring credit hierarchy access control
2301
- */
2302
- hierarchy_configuration?: RecurringCredit.HierarchyConfiguration;
2303
- /**
2304
- * Displayed on invoices. Will be passed through to the individual commits
2305
- */
2306
- name?: string;
2307
- /**
2308
- * Will be passed down to the individual commits
2309
- */
2310
- netsuite_sales_order_id?: string;
2311
- /**
2312
- * Determines whether the first and last commit will be prorated. If not provided,
2313
- * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
2314
- */
2315
- proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
2316
- /**
2317
- * The frequency at which the recurring commits will be created. If not provided: -
2318
- * The commits will be created on the usage invoice frequency. If provided: - The
2319
- * period defined in the duration will correspond to this frequency. - Commits will
2320
- * be created aligned with the recurring commit's starting_at rather than the usage
2321
- * invoice dates.
2322
- */
2323
- recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2324
- /**
2325
- * Will be passed down to the individual commits. This controls how much of an
2326
- * individual unexpired commit will roll over upon contract transition. Must be
2327
- * between 0 and 1.
2328
- */
2329
- rollover_fraction?: number;
2330
- /**
2331
- * List of filters that determine what kind of customer usage draws down a commit
2332
- * or credit. A customer's usage needs to meet the condition of at least one of the
2333
- * specifiers to contribute to a commit's or credit's drawdown.
2334
- */
2335
- specifiers?: Array<RecurringCredit.Specifier>;
2336
- /**
2337
- * Attach a subscription to the recurring commit/credit.
2338
- */
2339
- subscription_config?: RecurringCredit.SubscriptionConfig;
2340
- }
2341
- namespace RecurringCredit {
2342
- /**
2343
- * The amount of commit to grant.
2344
- */
2345
- interface AccessAmount {
2346
- credit_type_id: string;
2347
- unit_price: number;
2348
- quantity?: number;
2349
- }
2350
- /**
2351
- * The amount of time the created commits will be valid for
2352
- */
2353
- interface CommitDuration {
2354
- value: number;
2355
- unit?: 'PERIODS';
2356
- }
2357
- interface Product {
2358
- id: string;
2359
- name: string;
2360
- }
2361
- interface Contract {
2362
- id: string;
2363
- }
2364
- /**
2365
- * Optional configuration for recurring credit hierarchy access control
2366
- */
2367
- interface HierarchyConfiguration {
2368
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
2369
- }
2370
- namespace HierarchyConfiguration {
2371
- interface CommitHierarchyChildAccessAll {
2372
- type: 'ALL';
2373
- }
2374
- interface CommitHierarchyChildAccessNone {
2375
- type: 'NONE';
2376
- }
2377
- interface CommitHierarchyChildAccessContractIDs {
2378
- contract_ids: Array<string>;
2379
- type: 'CONTRACT_IDS';
2380
- }
2381
- }
2382
- interface Specifier {
2383
- presentation_group_values?: {
2384
- [key: string]: string;
2385
- };
2386
- pricing_group_values?: {
2387
- [key: string]: string;
2388
- };
2389
- /**
2390
- * If provided, the specifier will only apply to the product with the specified ID.
2391
- */
2392
- product_id?: string;
2393
- /**
2394
- * If provided, the specifier will only apply to products with all the specified
2395
- * tags.
2396
- */
2397
- product_tags?: Array<string>;
2398
- }
2399
- /**
2400
- * Attach a subscription to the recurring commit/credit.
2401
- */
2402
- interface SubscriptionConfig {
2403
- allocation: 'INDIVIDUAL' | 'POOLED';
2404
- apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
2405
- subscription_id: string;
2406
- }
2407
- namespace SubscriptionConfig {
2408
- interface ApplySeatIncreaseConfig {
2409
- /**
2410
- * Indicates whether a mid-period seat increase should be prorated.
2411
- */
2412
- is_prorated: boolean;
2413
- }
2414
- }
2415
- }
2416
- interface ResellerRoyalty {
2417
- reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
2418
- segments: Array<ResellerRoyalty.Segment>;
2419
- }
2420
- namespace ResellerRoyalty {
2421
- interface Segment {
2422
- fraction: number;
2423
- netsuite_reseller_id: string;
2424
- reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
2425
- starting_at: string;
2426
- applicable_product_ids?: Array<string>;
2427
- applicable_product_tags?: Array<string>;
2428
- aws_account_number?: string;
2429
- aws_offer_id?: string;
2430
- aws_payer_reference_id?: string;
2431
- ending_before?: string;
2432
- gcp_account_id?: string;
2433
- gcp_offer_id?: string;
2434
- reseller_contract_value?: number;
2435
- }
2436
- }
2437
- interface SpendThresholdConfiguration {
2438
- commit: SpendThresholdConfiguration.Commit;
2439
- /**
2440
- * When set to false, the contract will not be evaluated against the
2441
- * threshold_amount. Toggling to true will result an immediate evaluation,
2442
- * regardless of prior state.
2443
- */
2444
- is_enabled: boolean;
2445
- payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
2446
- /**
2447
- * Specify the threshold amount for the contract. Each time the contract's usage
2448
- * hits this amount, a threshold charge will be initiated.
2449
- */
2450
- threshold_amount: number;
2451
- }
2452
- namespace SpendThresholdConfiguration {
2453
- interface Commit {
2454
- /**
2455
- * The commit product that will be used to generate the line item for commit
2456
- * payment.
2457
- */
2458
- product_id: string;
2459
- description?: string;
2460
- /**
2461
- * Specify the name of the line item for the threshold charge. If left blank, it
2462
- * will default to the commit product name.
2463
- */
2464
- name?: string;
2465
- }
2466
- interface PaymentGateConfig {
2467
- /**
2468
- * Gate access to the commit balance based on successful collection of payment.
2469
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
2470
- * facilitate payment using your own payment integration. Select NONE if you do not
2471
- * wish to payment gate the commit balance.
2472
- */
2473
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
2474
- /**
2475
- * Only applicable if using PRECALCULATED as your tax type.
2476
- */
2477
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
2478
- /**
2479
- * Only applicable if using STRIPE as your payment gateway type.
2480
- */
2481
- stripe_config?: PaymentGateConfig.StripeConfig;
2482
- /**
2483
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
2484
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
2485
- * will default to NONE.
2486
- */
2487
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
2488
- }
2489
- namespace PaymentGateConfig {
2490
- /**
2491
- * Only applicable if using PRECALCULATED as your tax type.
2492
- */
2493
- interface PrecalculatedTaxConfig {
2494
- /**
2495
- * Amount of tax to be applied. This should be in the same currency and
2496
- * denomination as the commit's invoice schedule
2497
- */
2498
- tax_amount: number;
2499
- /**
2500
- * Name of the tax to be applied. This may be used in an invoice line item
2501
- * description.
2502
- */
2503
- tax_name?: string;
2504
- }
2505
- /**
2506
- * Only applicable if using STRIPE as your payment gateway type.
2507
- */
2508
- interface StripeConfig {
2509
- /**
2510
- * If left blank, will default to INVOICE
2511
- */
2512
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
2513
- /**
2514
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
2515
- * your payment type.
2516
- */
2517
- invoice_metadata?: {
2518
- [key: string]: string;
2519
- };
2520
- }
2521
- }
2522
- }
2523
- interface Subscription {
2524
- collection_schedule: 'ADVANCE' | 'ARREARS';
2525
- proration: Subscription.Proration;
2526
- /**
2527
- * List of quantity schedule items for the subscription. Only includes the current
2528
- * quantity and future quantity changes.
2529
- */
2530
- quantity_schedule: Array<Subscription.QuantitySchedule>;
2531
- starting_at: string;
2532
- subscription_rate: Subscription.SubscriptionRate;
2533
- id?: string;
2534
- custom_fields?: {
2535
- [key: string]: string;
2536
- };
2537
- description?: string;
2538
- ending_before?: string;
2539
- fiat_credit_type_id?: string;
2540
- name?: string;
2541
- }
2542
- namespace Subscription {
2543
- interface Proration {
2544
- invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
2545
- is_prorated: boolean;
2546
- }
2547
- interface QuantitySchedule {
2548
- quantity: number;
2549
- starting_at: string;
2550
- ending_before?: string;
2551
- }
2552
- interface SubscriptionRate {
2553
- billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2554
- product: SubscriptionRate.Product;
2555
- }
2556
- namespace SubscriptionRate {
2557
- interface Product {
2558
- id: string;
2559
- name: string;
2560
- }
2561
- }
2562
- }
2563
- }
192
+ * ### Use this endpoint to:
193
+ *
194
+ * - Understand what changes were made to a contract, when, and by who
195
+ *
196
+ * ### Key response fields:
197
+ *
198
+ * - An array of every edit ever made to the contract
199
+ * - Details on each individual edit - for example showing that in one edit, a user
200
+ * added two discounts and incremented a subscription quantity.
201
+ *
202
+ * @example
203
+ * ```ts
204
+ * const response = await client.v2.contracts.getEditHistory({
205
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
206
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
207
+ * });
208
+ * ```
209
+ */
210
+ getEditHistory(body: ContractGetEditHistoryParams, options?: RequestOptions): APIPromise<ContractGetEditHistoryResponse>;
211
+ }
212
+ export interface ContractRetrieveResponse {
213
+ data: Shared.ContractV2;
214
+ }
215
+ export interface ContractListResponse {
216
+ data: Array<Shared.ContractV2>;
2564
217
  }
2565
218
  export interface ContractEditResponse {
2566
219
  data: Shared.ID;
@@ -2581,23 +234,29 @@ export declare namespace ContractGetEditHistoryResponse {
2581
234
  add_credits?: Array<Data.AddCredit>;
2582
235
  add_discounts?: Array<Shared.Discount>;
2583
236
  add_overrides?: Array<Data.AddOverride>;
2584
- add_prepaid_balance_threshold_configuration?: Data.AddPrepaidBalanceThresholdConfiguration;
237
+ add_prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfigurationV2;
2585
238
  add_pro_services?: Array<Shared.ProService>;
2586
239
  add_recurring_commits?: Array<Data.AddRecurringCommit>;
2587
240
  add_recurring_credits?: Array<Data.AddRecurringCredit>;
2588
241
  add_reseller_royalties?: Array<Data.AddResellerRoyalty>;
2589
242
  add_scheduled_charges?: Array<Data.AddScheduledCharge>;
2590
- add_spend_threshold_configuration?: Data.AddSpendThresholdConfiguration;
243
+ add_spend_threshold_configuration?: Shared.SpendThresholdConfigurationV2;
2591
244
  /**
2592
245
  * List of subscriptions on the contract.
2593
246
  */
2594
- add_subscriptions?: Array<Data.AddSubscription>;
247
+ add_subscriptions?: Array<Shared.Subscription>;
2595
248
  add_usage_filters?: Array<Data.AddUsageFilter>;
2596
249
  archive_commits?: Array<Data.ArchiveCommit>;
2597
250
  archive_credits?: Array<Data.ArchiveCredit>;
2598
251
  archive_scheduled_charges?: Array<Data.ArchiveScheduledCharge>;
2599
252
  remove_overrides?: Array<Data.RemoveOverride>;
2600
253
  timestamp?: string;
254
+ /**
255
+ * Prevents the creation of duplicates. If a request to create a record is made
256
+ * with a previously used uniqueness key, a new record will not be created and the
257
+ * request will fail with a 409 error.
258
+ */
259
+ uniqueness_key?: string;
2601
260
  update_commits?: Array<Data.UpdateCommit>;
2602
261
  update_contract_end_date?: string;
2603
262
  /**
@@ -2634,7 +293,7 @@ export declare namespace ContractGetEditHistoryResponse {
2634
293
  /**
2635
294
  * Optional configuration for commit hierarchy access control
2636
295
  */
2637
- hierarchy_configuration?: AddCommit.HierarchyConfiguration;
296
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
2638
297
  /**
2639
298
  * The schedule that the customer will be invoiced for this commit.
2640
299
  */
@@ -2663,48 +322,13 @@ export declare namespace ContractGetEditHistoryResponse {
2663
322
  * Instead, to target usage by product or product tag, pass those values in the
2664
323
  * body of `specifiers`.
2665
324
  */
2666
- specifiers?: Array<AddCommit.Specifier>;
325
+ specifiers?: Array<Shared.CommitSpecifierInput>;
2667
326
  }
2668
327
  namespace AddCommit {
2669
328
  interface Product {
2670
329
  id: string;
2671
330
  name: string;
2672
331
  }
2673
- /**
2674
- * Optional configuration for commit hierarchy access control
2675
- */
2676
- interface HierarchyConfiguration {
2677
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
2678
- }
2679
- namespace HierarchyConfiguration {
2680
- interface CommitHierarchyChildAccessAll {
2681
- type: 'ALL';
2682
- }
2683
- interface CommitHierarchyChildAccessNone {
2684
- type: 'NONE';
2685
- }
2686
- interface CommitHierarchyChildAccessContractIDs {
2687
- contract_ids: Array<string>;
2688
- type: 'CONTRACT_IDS';
2689
- }
2690
- }
2691
- interface Specifier {
2692
- presentation_group_values?: {
2693
- [key: string]: string;
2694
- };
2695
- pricing_group_values?: {
2696
- [key: string]: string;
2697
- };
2698
- /**
2699
- * If provided, the specifier will only apply to the product with the specified ID.
2700
- */
2701
- product_id?: string;
2702
- /**
2703
- * If provided, the specifier will only apply to products with all the specified
2704
- * tags.
2705
- */
2706
- product_tags?: Array<string>;
2707
- }
2708
332
  }
2709
333
  interface AddCredit {
2710
334
  id: string;
@@ -2720,7 +344,7 @@ export declare namespace ContractGetEditHistoryResponse {
2720
344
  /**
2721
345
  * Optional configuration for recurring credit hierarchy access control
2722
346
  */
2723
- hierarchy_configuration?: AddCredit.HierarchyConfiguration;
347
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
2724
348
  name?: string;
2725
349
  /**
2726
350
  * This field's availability is dependent on your client's configuration.
@@ -2743,48 +367,13 @@ export declare namespace ContractGetEditHistoryResponse {
2743
367
  * Instead, to target usage by product or product tag, pass those values in the
2744
368
  * body of `specifiers`.
2745
369
  */
2746
- specifiers?: Array<AddCredit.Specifier>;
370
+ specifiers?: Array<Shared.CommitSpecifierInput>;
2747
371
  }
2748
372
  namespace AddCredit {
2749
373
  interface Product {
2750
374
  id: string;
2751
375
  name: string;
2752
376
  }
2753
- /**
2754
- * Optional configuration for recurring credit hierarchy access control
2755
- */
2756
- interface HierarchyConfiguration {
2757
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
2758
- }
2759
- namespace HierarchyConfiguration {
2760
- interface CommitHierarchyChildAccessAll {
2761
- type: 'ALL';
2762
- }
2763
- interface CommitHierarchyChildAccessNone {
2764
- type: 'NONE';
2765
- }
2766
- interface CommitHierarchyChildAccessContractIDs {
2767
- contract_ids: Array<string>;
2768
- type: 'CONTRACT_IDS';
2769
- }
2770
- }
2771
- interface Specifier {
2772
- presentation_group_values?: {
2773
- [key: string]: string;
2774
- };
2775
- pricing_group_values?: {
2776
- [key: string]: string;
2777
- };
2778
- /**
2779
- * If provided, the specifier will only apply to the product with the specified ID.
2780
- */
2781
- product_id?: string;
2782
- /**
2783
- * If provided, the specifier will only apply to products with all the specified
2784
- * tags.
2785
- */
2786
- product_tags?: Array<string>;
2787
- }
2788
377
  }
2789
378
  interface AddOverride {
2790
379
  id: string;
@@ -2795,8 +384,8 @@ export declare namespace ContractGetEditHistoryResponse {
2795
384
  is_commit_specific?: boolean;
2796
385
  multiplier?: number;
2797
386
  override_specifiers?: Array<AddOverride.OverrideSpecifier>;
2798
- override_tiers?: Array<AddOverride.OverrideTier>;
2799
- overwrite_rate?: AddOverride.OverwriteRate;
387
+ override_tiers?: Array<Shared.OverrideTier>;
388
+ overwrite_rate?: Shared.OverwriteRate;
2800
389
  priority?: number;
2801
390
  product?: AddOverride.Product;
2802
391
  target?: 'COMMIT_RATE' | 'LIST_RATE';
@@ -2817,179 +406,11 @@ export declare namespace ContractGetEditHistoryResponse {
2817
406
  recurring_commit_ids?: Array<string>;
2818
407
  recurring_credit_ids?: Array<string>;
2819
408
  }
2820
- interface OverrideTier {
2821
- multiplier: number;
2822
- size?: number;
2823
- }
2824
- interface OverwriteRate {
2825
- rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
2826
- credit_type?: Shared.CreditTypeData;
2827
- /**
2828
- * Only set for CUSTOM rate_type. This field is interpreted by custom rate
2829
- * processors.
2830
- */
2831
- custom_rate?: {
2832
- [key: string]: unknown;
2833
- };
2834
- /**
2835
- * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
2836
- * set to true.
2837
- */
2838
- is_prorated?: boolean;
2839
- /**
2840
- * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
2841
- * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
2842
- */
2843
- price?: number;
2844
- /**
2845
- * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
2846
- */
2847
- quantity?: number;
2848
- /**
2849
- * Only set for TIERED rate_type.
2850
- */
2851
- tiers?: Array<Shared.Tier>;
2852
- }
2853
409
  interface Product {
2854
410
  id: string;
2855
411
  name: string;
2856
412
  }
2857
413
  }
2858
- interface AddPrepaidBalanceThresholdConfiguration {
2859
- commit: AddPrepaidBalanceThresholdConfiguration.Commit;
2860
- /**
2861
- * When set to false, the contract will not be evaluated against the
2862
- * threshold_amount. Toggling to true will result an immediate evaluation,
2863
- * regardless of prior state.
2864
- */
2865
- is_enabled: boolean;
2866
- payment_gate_config: AddPrepaidBalanceThresholdConfiguration.PaymentGateConfig;
2867
- /**
2868
- * Specify the amount the balance should be recharged to.
2869
- */
2870
- recharge_to_amount: number;
2871
- /**
2872
- * Specify the threshold amount for the contract. Each time the contract's balance
2873
- * lowers to this amount, a threshold charge will be initiated.
2874
- */
2875
- threshold_amount: number;
2876
- /**
2877
- * If provided, the threshold, recharge-to amount, and the resulting threshold
2878
- * commit amount will be in terms of this credit type instead of the fiat currency.
2879
- */
2880
- custom_credit_type_id?: string;
2881
- }
2882
- namespace AddPrepaidBalanceThresholdConfiguration {
2883
- interface Commit {
2884
- /**
2885
- * The commit product that will be used to generate the line item for commit
2886
- * payment.
2887
- */
2888
- product_id: string;
2889
- /**
2890
- * Which products the threshold commit applies to. If applicable_product_ids,
2891
- * applicable_product_tags or specifiers are not provided, the commit applies to
2892
- * all products.
2893
- */
2894
- applicable_product_ids?: Array<string>;
2895
- /**
2896
- * Which tags the threshold commit applies to. If applicable_product_ids,
2897
- * applicable_product_tags or specifiers are not provided, the commit applies to
2898
- * all products.
2899
- */
2900
- applicable_product_tags?: Array<string>;
2901
- description?: string;
2902
- /**
2903
- * Specify the name of the line item for the threshold charge. If left blank, it
2904
- * will default to the commit product name.
2905
- */
2906
- name?: string;
2907
- /**
2908
- * List of filters that determine what kind of customer usage draws down a commit
2909
- * or credit. A customer's usage needs to meet the condition of at least one of the
2910
- * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2911
- * be used together with `applicable_product_ids` or `applicable_product_tags`.
2912
- * Instead, to target usage by product or product tag, pass those values in the
2913
- * body of `specifiers`.
2914
- */
2915
- specifiers?: Array<Commit.Specifier>;
2916
- }
2917
- namespace Commit {
2918
- interface Specifier {
2919
- presentation_group_values?: {
2920
- [key: string]: string;
2921
- };
2922
- pricing_group_values?: {
2923
- [key: string]: string;
2924
- };
2925
- /**
2926
- * If provided, the specifier will only apply to the product with the specified ID.
2927
- */
2928
- product_id?: string;
2929
- /**
2930
- * If provided, the specifier will only apply to products with all the specified
2931
- * tags.
2932
- */
2933
- product_tags?: Array<string>;
2934
- }
2935
- }
2936
- interface PaymentGateConfig {
2937
- /**
2938
- * Gate access to the commit balance based on successful collection of payment.
2939
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
2940
- * facilitate payment using your own payment integration. Select NONE if you do not
2941
- * wish to payment gate the commit balance.
2942
- */
2943
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
2944
- /**
2945
- * Only applicable if using PRECALCULATED as your tax type.
2946
- */
2947
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
2948
- /**
2949
- * Only applicable if using STRIPE as your payment gateway type.
2950
- */
2951
- stripe_config?: PaymentGateConfig.StripeConfig;
2952
- /**
2953
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
2954
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
2955
- * will default to NONE.
2956
- */
2957
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
2958
- }
2959
- namespace PaymentGateConfig {
2960
- /**
2961
- * Only applicable if using PRECALCULATED as your tax type.
2962
- */
2963
- interface PrecalculatedTaxConfig {
2964
- /**
2965
- * Amount of tax to be applied. This should be in the same currency and
2966
- * denomination as the commit's invoice schedule
2967
- */
2968
- tax_amount: number;
2969
- /**
2970
- * Name of the tax to be applied. This may be used in an invoice line item
2971
- * description.
2972
- */
2973
- tax_name?: string;
2974
- }
2975
- /**
2976
- * Only applicable if using STRIPE as your payment gateway type.
2977
- */
2978
- interface StripeConfig {
2979
- /**
2980
- * If left blank, will default to INVOICE
2981
- */
2982
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
2983
- /**
2984
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
2985
- * your payment type.
2986
- */
2987
- invoice_metadata?: {
2988
- [key: string]: string;
2989
- };
2990
- }
2991
- }
2992
- }
2993
414
  interface AddRecurringCommit {
2994
415
  id: string;
2995
416
  /**
@@ -3033,7 +454,7 @@ export declare namespace ContractGetEditHistoryResponse {
3033
454
  /**
3034
455
  * Optional configuration for recurring credit hierarchy access control
3035
456
  */
3036
- hierarchy_configuration?: AddRecurringCommit.HierarchyConfiguration;
457
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
3037
458
  /**
3038
459
  * The amount the customer should be billed for the commit. Not required.
3039
460
  */
@@ -3070,11 +491,11 @@ export declare namespace ContractGetEditHistoryResponse {
3070
491
  * or credit. A customer's usage needs to meet the condition of at least one of the
3071
492
  * specifiers to contribute to a commit's or credit's drawdown.
3072
493
  */
3073
- specifiers?: Array<AddRecurringCommit.Specifier>;
494
+ specifiers?: Array<Shared.CommitSpecifier>;
3074
495
  /**
3075
496
  * Attach a subscription to the recurring commit/credit.
3076
497
  */
3077
- subscription_config?: AddRecurringCommit.SubscriptionConfig;
498
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
3078
499
  }
3079
500
  namespace AddRecurringCommit {
3080
501
  /**
@@ -3099,24 +520,6 @@ export declare namespace ContractGetEditHistoryResponse {
3099
520
  interface Contract {
3100
521
  id: string;
3101
522
  }
3102
- /**
3103
- * Optional configuration for recurring credit hierarchy access control
3104
- */
3105
- interface HierarchyConfiguration {
3106
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
3107
- }
3108
- namespace HierarchyConfiguration {
3109
- interface CommitHierarchyChildAccessAll {
3110
- type: 'ALL';
3111
- }
3112
- interface CommitHierarchyChildAccessNone {
3113
- type: 'NONE';
3114
- }
3115
- interface CommitHierarchyChildAccessContractIDs {
3116
- contract_ids: Array<string>;
3117
- type: 'CONTRACT_IDS';
3118
- }
3119
- }
3120
523
  /**
3121
524
  * The amount the customer should be billed for the commit. Not required.
3122
525
  */
@@ -3125,39 +528,6 @@ export declare namespace ContractGetEditHistoryResponse {
3125
528
  quantity: number;
3126
529
  unit_price: number;
3127
530
  }
3128
- interface Specifier {
3129
- presentation_group_values?: {
3130
- [key: string]: string;
3131
- };
3132
- pricing_group_values?: {
3133
- [key: string]: string;
3134
- };
3135
- /**
3136
- * If provided, the specifier will only apply to the product with the specified ID.
3137
- */
3138
- product_id?: string;
3139
- /**
3140
- * If provided, the specifier will only apply to products with all the specified
3141
- * tags.
3142
- */
3143
- product_tags?: Array<string>;
3144
- }
3145
- /**
3146
- * Attach a subscription to the recurring commit/credit.
3147
- */
3148
- interface SubscriptionConfig {
3149
- allocation: 'INDIVIDUAL' | 'POOLED';
3150
- apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
3151
- subscription_id: string;
3152
- }
3153
- namespace SubscriptionConfig {
3154
- interface ApplySeatIncreaseConfig {
3155
- /**
3156
- * Indicates whether a mid-period seat increase should be prorated.
3157
- */
3158
- is_prorated: boolean;
3159
- }
3160
- }
3161
531
  }
3162
532
  interface AddRecurringCredit {
3163
533
  id: string;
@@ -3202,7 +572,7 @@ export declare namespace ContractGetEditHistoryResponse {
3202
572
  /**
3203
573
  * Optional configuration for recurring credit hierarchy access control
3204
574
  */
3205
- hierarchy_configuration?: AddRecurringCredit.HierarchyConfiguration;
575
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
3206
576
  /**
3207
577
  * Displayed on invoices. Will be passed through to the individual commits
3208
578
  */
@@ -3235,11 +605,11 @@ export declare namespace ContractGetEditHistoryResponse {
3235
605
  * or credit. A customer's usage needs to meet the condition of at least one of the
3236
606
  * specifiers to contribute to a commit's or credit's drawdown.
3237
607
  */
3238
- specifiers?: Array<AddRecurringCredit.Specifier>;
608
+ specifiers?: Array<Shared.CommitSpecifier>;
3239
609
  /**
3240
610
  * Attach a subscription to the recurring commit/credit.
3241
611
  */
3242
- subscription_config?: AddRecurringCredit.SubscriptionConfig;
612
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
3243
613
  }
3244
614
  namespace AddRecurringCredit {
3245
615
  /**
@@ -3264,57 +634,6 @@ export declare namespace ContractGetEditHistoryResponse {
3264
634
  interface Contract {
3265
635
  id: string;
3266
636
  }
3267
- /**
3268
- * Optional configuration for recurring credit hierarchy access control
3269
- */
3270
- interface HierarchyConfiguration {
3271
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
3272
- }
3273
- namespace HierarchyConfiguration {
3274
- interface CommitHierarchyChildAccessAll {
3275
- type: 'ALL';
3276
- }
3277
- interface CommitHierarchyChildAccessNone {
3278
- type: 'NONE';
3279
- }
3280
- interface CommitHierarchyChildAccessContractIDs {
3281
- contract_ids: Array<string>;
3282
- type: 'CONTRACT_IDS';
3283
- }
3284
- }
3285
- interface Specifier {
3286
- presentation_group_values?: {
3287
- [key: string]: string;
3288
- };
3289
- pricing_group_values?: {
3290
- [key: string]: string;
3291
- };
3292
- /**
3293
- * If provided, the specifier will only apply to the product with the specified ID.
3294
- */
3295
- product_id?: string;
3296
- /**
3297
- * If provided, the specifier will only apply to products with all the specified
3298
- * tags.
3299
- */
3300
- product_tags?: Array<string>;
3301
- }
3302
- /**
3303
- * Attach a subscription to the recurring commit/credit.
3304
- */
3305
- interface SubscriptionConfig {
3306
- allocation: 'INDIVIDUAL' | 'POOLED';
3307
- apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
3308
- subscription_id: string;
3309
- }
3310
- namespace SubscriptionConfig {
3311
- interface ApplySeatIncreaseConfig {
3312
- /**
3313
- * Indicates whether a mid-period seat increase should be prorated.
3314
- */
3315
- is_prorated: boolean;
3316
- }
3317
- }
3318
637
  }
3319
638
  interface AddResellerRoyalty {
3320
639
  reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
@@ -3344,136 +663,10 @@ export declare namespace ContractGetEditHistoryResponse {
3344
663
  */
3345
664
  netsuite_sales_order_id?: string;
3346
665
  }
3347
- namespace AddScheduledCharge {
3348
- interface Product {
3349
- id: string;
3350
- name: string;
3351
- }
3352
- }
3353
- interface AddSpendThresholdConfiguration {
3354
- commit: AddSpendThresholdConfiguration.Commit;
3355
- /**
3356
- * When set to false, the contract will not be evaluated against the
3357
- * threshold_amount. Toggling to true will result an immediate evaluation,
3358
- * regardless of prior state.
3359
- */
3360
- is_enabled: boolean;
3361
- payment_gate_config: AddSpendThresholdConfiguration.PaymentGateConfig;
3362
- /**
3363
- * Specify the threshold amount for the contract. Each time the contract's usage
3364
- * hits this amount, a threshold charge will be initiated.
3365
- */
3366
- threshold_amount: number;
3367
- }
3368
- namespace AddSpendThresholdConfiguration {
3369
- interface Commit {
3370
- /**
3371
- * The commit product that will be used to generate the line item for commit
3372
- * payment.
3373
- */
3374
- product_id: string;
3375
- description?: string;
3376
- /**
3377
- * Specify the name of the line item for the threshold charge. If left blank, it
3378
- * will default to the commit product name.
3379
- */
3380
- name?: string;
3381
- }
3382
- interface PaymentGateConfig {
3383
- /**
3384
- * Gate access to the commit balance based on successful collection of payment.
3385
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
3386
- * facilitate payment using your own payment integration. Select NONE if you do not
3387
- * wish to payment gate the commit balance.
3388
- */
3389
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
3390
- /**
3391
- * Only applicable if using PRECALCULATED as your tax type.
3392
- */
3393
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
3394
- /**
3395
- * Only applicable if using STRIPE as your payment gateway type.
3396
- */
3397
- stripe_config?: PaymentGateConfig.StripeConfig;
3398
- /**
3399
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
3400
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
3401
- * will default to NONE.
3402
- */
3403
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
3404
- }
3405
- namespace PaymentGateConfig {
3406
- /**
3407
- * Only applicable if using PRECALCULATED as your tax type.
3408
- */
3409
- interface PrecalculatedTaxConfig {
3410
- /**
3411
- * Amount of tax to be applied. This should be in the same currency and
3412
- * denomination as the commit's invoice schedule
3413
- */
3414
- tax_amount: number;
3415
- /**
3416
- * Name of the tax to be applied. This may be used in an invoice line item
3417
- * description.
3418
- */
3419
- tax_name?: string;
3420
- }
3421
- /**
3422
- * Only applicable if using STRIPE as your payment gateway type.
3423
- */
3424
- interface StripeConfig {
3425
- /**
3426
- * If left blank, will default to INVOICE
3427
- */
3428
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
3429
- /**
3430
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
3431
- * your payment type.
3432
- */
3433
- invoice_metadata?: {
3434
- [key: string]: string;
3435
- };
3436
- }
3437
- }
3438
- }
3439
- interface AddSubscription {
3440
- collection_schedule: 'ADVANCE' | 'ARREARS';
3441
- proration: AddSubscription.Proration;
3442
- /**
3443
- * List of quantity schedule items for the subscription. Only includes the current
3444
- * quantity and future quantity changes.
3445
- */
3446
- quantity_schedule: Array<AddSubscription.QuantitySchedule>;
3447
- starting_at: string;
3448
- subscription_rate: AddSubscription.SubscriptionRate;
3449
- id?: string;
3450
- custom_fields?: {
3451
- [key: string]: string;
3452
- };
3453
- description?: string;
3454
- ending_before?: string;
3455
- fiat_credit_type_id?: string;
3456
- name?: string;
3457
- }
3458
- namespace AddSubscription {
3459
- interface Proration {
3460
- invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
3461
- is_prorated: boolean;
3462
- }
3463
- interface QuantitySchedule {
3464
- quantity: number;
3465
- starting_at: string;
3466
- ending_before?: string;
3467
- }
3468
- interface SubscriptionRate {
3469
- billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
3470
- product: SubscriptionRate.Product;
3471
- }
3472
- namespace SubscriptionRate {
3473
- interface Product {
3474
- id: string;
3475
- name: string;
3476
- }
666
+ namespace AddScheduledCharge {
667
+ interface Product {
668
+ id: string;
669
+ name: string;
3477
670
  }
3478
671
  }
3479
672
  interface AddUsageFilter {
@@ -3520,7 +713,7 @@ export declare namespace ContractGetEditHistoryResponse {
3520
713
  /**
3521
714
  * Optional configuration for commit hierarchy access control
3522
715
  */
3523
- hierarchy_configuration?: UpdateCommit.HierarchyConfiguration;
716
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
3524
717
  invoice_schedule?: UpdateCommit.InvoiceSchedule;
3525
718
  name?: string;
3526
719
  netsuite_sales_order_id?: string | null;
@@ -3530,6 +723,10 @@ export declare namespace ContractGetEditHistoryResponse {
3530
723
  */
3531
724
  priority?: number | null;
3532
725
  product_id?: string;
726
+ /**
727
+ * If set, the commit's rate type was updated to the specified value.
728
+ */
729
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
3533
730
  rollover_fraction?: number | null;
3534
731
  /**
3535
732
  * List of filters that determine what kind of customer usage draws down a commit
@@ -3539,7 +736,7 @@ export declare namespace ContractGetEditHistoryResponse {
3539
736
  * Instead, to target usage by product or product tag, pass those values in the
3540
737
  * body of `specifiers`.
3541
738
  */
3542
- specifiers?: Array<UpdateCommit.Specifier> | null;
739
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
3543
740
  }
3544
741
  namespace UpdateCommit {
3545
742
  interface AccessSchedule {
@@ -3575,24 +772,6 @@ export declare namespace ContractGetEditHistoryResponse {
3575
772
  starting_at?: string;
3576
773
  }
3577
774
  }
3578
- /**
3579
- * Optional configuration for commit hierarchy access control
3580
- */
3581
- interface HierarchyConfiguration {
3582
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
3583
- }
3584
- namespace HierarchyConfiguration {
3585
- interface CommitHierarchyChildAccessAll {
3586
- type: 'ALL';
3587
- }
3588
- interface CommitHierarchyChildAccessNone {
3589
- type: 'NONE';
3590
- }
3591
- interface CommitHierarchyChildAccessContractIDs {
3592
- contract_ids: Array<string>;
3593
- type: 'CONTRACT_IDS';
3594
- }
3595
- }
3596
775
  interface InvoiceSchedule {
3597
776
  add_schedule_items?: Array<InvoiceSchedule.AddScheduleItem>;
3598
777
  remove_schedule_items?: Array<InvoiceSchedule.RemoveScheduleItem>;
@@ -3616,23 +795,6 @@ export declare namespace ContractGetEditHistoryResponse {
3616
795
  unit_price?: number;
3617
796
  }
3618
797
  }
3619
- interface Specifier {
3620
- presentation_group_values?: {
3621
- [key: string]: string;
3622
- };
3623
- pricing_group_values?: {
3624
- [key: string]: string;
3625
- };
3626
- /**
3627
- * If provided, the specifier will only apply to the product with the specified ID.
3628
- */
3629
- product_id?: string;
3630
- /**
3631
- * If provided, the specifier will only apply to products with all the specified
3632
- * tags.
3633
- */
3634
- product_tags?: Array<string>;
3635
- }
3636
798
  }
3637
799
  interface UpdateCredit {
3638
800
  id: string;
@@ -3640,7 +802,7 @@ export declare namespace ContractGetEditHistoryResponse {
3640
802
  /**
3641
803
  * Optional configuration for credit hierarchy access control
3642
804
  */
3643
- hierarchy_configuration?: UpdateCredit.HierarchyConfiguration;
805
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
3644
806
  name?: string;
3645
807
  netsuite_sales_order_id?: string | null;
3646
808
  /**
@@ -3648,6 +810,10 @@ export declare namespace ContractGetEditHistoryResponse {
3648
810
  * first.
3649
811
  */
3650
812
  priority?: number | null;
813
+ /**
814
+ * If set, the credit's rate type was updated to the specified value.
815
+ */
816
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
3651
817
  rollover_fraction?: number | null;
3652
818
  }
3653
819
  namespace UpdateCredit {
@@ -3684,27 +850,12 @@ export declare namespace ContractGetEditHistoryResponse {
3684
850
  starting_at?: string;
3685
851
  }
3686
852
  }
3687
- /**
3688
- * Optional configuration for credit hierarchy access control
3689
- */
3690
- interface HierarchyConfiguration {
3691
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
3692
- }
3693
- namespace HierarchyConfiguration {
3694
- interface CommitHierarchyChildAccessAll {
3695
- type: 'ALL';
3696
- }
3697
- interface CommitHierarchyChildAccessNone {
3698
- type: 'NONE';
3699
- }
3700
- interface CommitHierarchyChildAccessContractIDs {
3701
- contract_ids: Array<string>;
3702
- type: 'CONTRACT_IDS';
3703
- }
3704
- }
3705
853
  }
3706
854
  interface UpdateDiscount {
3707
855
  id: string;
856
+ /**
857
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
858
+ */
3708
859
  custom_fields?: {
3709
860
  [key: string]: string;
3710
861
  };
@@ -3815,7 +966,7 @@ export declare namespace ContractGetEditHistoryResponse {
3815
966
  * regardless of prior state.
3816
967
  */
3817
968
  is_enabled?: boolean;
3818
- payment_gate_config?: UpdatePrepaidBalanceThresholdConfiguration.PaymentGateConfig;
969
+ payment_gate_config?: Shared.PaymentGateConfigV2;
3819
970
  /**
3820
971
  * Specify the amount the balance should be recharged to.
3821
972
  */
@@ -3827,7 +978,7 @@ export declare namespace ContractGetEditHistoryResponse {
3827
978
  threshold_amount?: number;
3828
979
  }
3829
980
  namespace UpdatePrepaidBalanceThresholdConfiguration {
3830
- interface Commit {
981
+ interface Commit extends Shared.UpdateBaseThresholdCommit {
3831
982
  /**
3832
983
  * Which products the threshold commit applies to. If both applicable_product_ids
3833
984
  * and applicable_product_tags are not provided, the commit applies to all
@@ -3839,17 +990,6 @@ export declare namespace ContractGetEditHistoryResponse {
3839
990
  * applicable_product_tags are not provided, the commit applies to all products.
3840
991
  */
3841
992
  applicable_product_tags?: Array<string> | null;
3842
- description?: string;
3843
- /**
3844
- * Specify the name of the line item for the threshold charge. If left blank, it
3845
- * will default to the commit product name.
3846
- */
3847
- name?: string;
3848
- /**
3849
- * The commit product that will be used to generate the line item for commit
3850
- * payment.
3851
- */
3852
- product_id?: string;
3853
993
  /**
3854
994
  * List of filters that determine what kind of customer usage draws down a commit
3855
995
  * or credit. A customer's usage needs to meet the condition of at least one of the
@@ -3858,82 +998,7 @@ export declare namespace ContractGetEditHistoryResponse {
3858
998
  * Instead, to target usage by product or product tag, pass those values in the
3859
999
  * body of `specifiers`.
3860
1000
  */
3861
- specifiers?: Array<Commit.Specifier> | null;
3862
- }
3863
- namespace Commit {
3864
- interface Specifier {
3865
- presentation_group_values?: {
3866
- [key: string]: string;
3867
- };
3868
- pricing_group_values?: {
3869
- [key: string]: string;
3870
- };
3871
- /**
3872
- * If provided, the specifier will only apply to the product with the specified ID.
3873
- */
3874
- product_id?: string;
3875
- /**
3876
- * If provided, the specifier will only apply to products with all the specified
3877
- * tags.
3878
- */
3879
- product_tags?: Array<string>;
3880
- }
3881
- }
3882
- interface PaymentGateConfig {
3883
- /**
3884
- * Gate access to the commit balance based on successful collection of payment.
3885
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
3886
- * facilitate payment using your own payment integration. Select NONE if you do not
3887
- * wish to payment gate the commit balance.
3888
- */
3889
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
3890
- /**
3891
- * Only applicable if using PRECALCULATED as your tax type.
3892
- */
3893
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
3894
- /**
3895
- * Only applicable if using STRIPE as your payment gateway type.
3896
- */
3897
- stripe_config?: PaymentGateConfig.StripeConfig;
3898
- /**
3899
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
3900
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
3901
- * will default to NONE.
3902
- */
3903
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
3904
- }
3905
- namespace PaymentGateConfig {
3906
- /**
3907
- * Only applicable if using PRECALCULATED as your tax type.
3908
- */
3909
- interface PrecalculatedTaxConfig {
3910
- /**
3911
- * Amount of tax to be applied. This should be in the same currency and
3912
- * denomination as the commit's invoice schedule
3913
- */
3914
- tax_amount: number;
3915
- /**
3916
- * Name of the tax to be applied. This may be used in an invoice line item
3917
- * description.
3918
- */
3919
- tax_name?: string;
3920
- }
3921
- /**
3922
- * Only applicable if using STRIPE as your payment gateway type.
3923
- */
3924
- interface StripeConfig {
3925
- /**
3926
- * If left blank, will default to INVOICE
3927
- */
3928
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
3929
- /**
3930
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
3931
- * your payment type.
3932
- */
3933
- invoice_metadata?: {
3934
- [key: string]: string;
3935
- };
3936
- }
1001
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
3937
1002
  }
3938
1003
  }
3939
1004
  interface UpdateRecurringCommit {
@@ -3999,91 +1064,20 @@ export declare namespace ContractGetEditHistoryResponse {
3999
1064
  }
4000
1065
  }
4001
1066
  interface UpdateSpendThresholdConfiguration {
4002
- commit?: UpdateSpendThresholdConfiguration.Commit;
1067
+ commit?: Shared.UpdateBaseThresholdCommit;
4003
1068
  /**
4004
1069
  * When set to false, the contract will not be evaluated against the
4005
1070
  * threshold_amount. Toggling to true will result an immediate evaluation,
4006
1071
  * regardless of prior state.
4007
1072
  */
4008
1073
  is_enabled?: boolean;
4009
- payment_gate_config?: UpdateSpendThresholdConfiguration.PaymentGateConfig;
1074
+ payment_gate_config?: Shared.PaymentGateConfigV2;
4010
1075
  /**
4011
1076
  * Specify the threshold amount for the contract. Each time the contract's usage
4012
1077
  * hits this amount, a threshold charge will be initiated.
4013
1078
  */
4014
1079
  threshold_amount?: number;
4015
1080
  }
4016
- namespace UpdateSpendThresholdConfiguration {
4017
- interface Commit {
4018
- description?: string;
4019
- /**
4020
- * Specify the name of the line item for the threshold charge. If left blank, it
4021
- * will default to the commit product name.
4022
- */
4023
- name?: string;
4024
- /**
4025
- * The commit product that will be used to generate the line item for commit
4026
- * payment.
4027
- */
4028
- product_id?: string;
4029
- }
4030
- interface PaymentGateConfig {
4031
- /**
4032
- * Gate access to the commit balance based on successful collection of payment.
4033
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
4034
- * facilitate payment using your own payment integration. Select NONE if you do not
4035
- * wish to payment gate the commit balance.
4036
- */
4037
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
4038
- /**
4039
- * Only applicable if using PRECALCULATED as your tax type.
4040
- */
4041
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
4042
- /**
4043
- * Only applicable if using STRIPE as your payment gateway type.
4044
- */
4045
- stripe_config?: PaymentGateConfig.StripeConfig;
4046
- /**
4047
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
4048
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
4049
- * will default to NONE.
4050
- */
4051
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
4052
- }
4053
- namespace PaymentGateConfig {
4054
- /**
4055
- * Only applicable if using PRECALCULATED as your tax type.
4056
- */
4057
- interface PrecalculatedTaxConfig {
4058
- /**
4059
- * Amount of tax to be applied. This should be in the same currency and
4060
- * denomination as the commit's invoice schedule
4061
- */
4062
- tax_amount: number;
4063
- /**
4064
- * Name of the tax to be applied. This may be used in an invoice line item
4065
- * description.
4066
- */
4067
- tax_name?: string;
4068
- }
4069
- /**
4070
- * Only applicable if using STRIPE as your payment gateway type.
4071
- */
4072
- interface StripeConfig {
4073
- /**
4074
- * If left blank, will default to INVOICE
4075
- */
4076
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
4077
- /**
4078
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
4079
- * your payment type.
4080
- */
4081
- invoice_metadata?: {
4082
- [key: string]: string;
4083
- };
4084
- }
4085
- }
4086
- }
4087
1081
  interface UpdateSubscription {
4088
1082
  id: string;
4089
1083
  ending_before?: string;
@@ -4157,7 +1151,7 @@ export interface ContractEditParams {
4157
1151
  add_credits?: Array<ContractEditParams.AddCredit>;
4158
1152
  add_discounts?: Array<ContractEditParams.AddDiscount>;
4159
1153
  add_overrides?: Array<ContractEditParams.AddOverride>;
4160
- add_prepaid_balance_threshold_configuration?: ContractEditParams.AddPrepaidBalanceThresholdConfiguration;
1154
+ add_prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfigurationV2;
4161
1155
  /**
4162
1156
  * This field's availability is dependent on your client's configuration.
4163
1157
  */
@@ -4166,7 +1160,7 @@ export interface ContractEditParams {
4166
1160
  add_recurring_credits?: Array<ContractEditParams.AddRecurringCredit>;
4167
1161
  add_reseller_royalties?: Array<ContractEditParams.AddResellerRoyalty>;
4168
1162
  add_scheduled_charges?: Array<ContractEditParams.AddScheduledCharge>;
4169
- add_spend_threshold_configuration?: ContractEditParams.AddSpendThresholdConfiguration;
1163
+ add_spend_threshold_configuration?: Shared.SpendThresholdConfigurationV2;
4170
1164
  /**
4171
1165
  * Optional list of
4172
1166
  * [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
@@ -4196,6 +1190,10 @@ export interface ContractEditParams {
4196
1190
  * IDs of overrides to remove
4197
1191
  */
4198
1192
  remove_overrides?: Array<ContractEditParams.RemoveOverride>;
1193
+ /**
1194
+ * Optional uniqueness key to prevent duplicate contract edits.
1195
+ */
1196
+ uniqueness_key?: string;
4199
1197
  update_commits?: Array<ContractEditParams.UpdateCommit>;
4200
1198
  /**
4201
1199
  * RFC 3339 timestamp indicating when the contract will end (exclusive).
@@ -4253,6 +1251,9 @@ export declare namespace ContractEditParams {
4253
1251
  * all products.
4254
1252
  */
4255
1253
  applicable_product_tags?: Array<string>;
1254
+ /**
1255
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1256
+ */
4256
1257
  custom_fields?: {
4257
1258
  [key: string]: string;
4258
1259
  };
@@ -4263,7 +1264,7 @@ export declare namespace ContractEditParams {
4263
1264
  /**
4264
1265
  * Optional configuration for commit hierarchy access control
4265
1266
  */
4266
- hierarchy_configuration?: AddCommit.HierarchyConfiguration;
1267
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
4267
1268
  /**
4268
1269
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
4269
1270
  * time and only one schedule item is allowed; the total must match access_schedule
@@ -4301,7 +1302,7 @@ export declare namespace ContractEditParams {
4301
1302
  * Instead, to target usage by product or product tag, pass those values in the
4302
1303
  * body of `specifiers`.
4303
1304
  */
4304
- specifiers?: Array<AddCommit.Specifier>;
1305
+ specifiers?: Array<Shared.CommitSpecifierInput>;
4305
1306
  /**
4306
1307
  * A temporary ID for the commit that can be used to reference the commit for
4307
1308
  * commit specific overrides.
@@ -4331,24 +1332,6 @@ export declare namespace ContractEditParams {
4331
1332
  starting_at: string;
4332
1333
  }
4333
1334
  }
4334
- /**
4335
- * Optional configuration for commit hierarchy access control
4336
- */
4337
- interface HierarchyConfiguration {
4338
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
4339
- }
4340
- namespace HierarchyConfiguration {
4341
- interface CommitHierarchyChildAccessAll {
4342
- type: 'ALL';
4343
- }
4344
- interface CommitHierarchyChildAccessNone {
4345
- type: 'NONE';
4346
- }
4347
- interface CommitHierarchyChildAccessContractIDs {
4348
- contract_ids: Array<string>;
4349
- type: 'CONTRACT_IDS';
4350
- }
4351
- }
4352
1335
  /**
4353
1336
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
4354
1337
  * time and only one schedule item is allowed; the total must match access_schedule
@@ -4507,23 +1490,6 @@ export declare namespace ContractEditParams {
4507
1490
  on_session_payment?: boolean;
4508
1491
  }
4509
1492
  }
4510
- interface Specifier {
4511
- presentation_group_values?: {
4512
- [key: string]: string;
4513
- };
4514
- pricing_group_values?: {
4515
- [key: string]: string;
4516
- };
4517
- /**
4518
- * If provided, the specifier will only apply to the product with the specified ID.
4519
- */
4520
- product_id?: string;
4521
- /**
4522
- * If provided, the specifier will only apply to products with all the specified
4523
- * tags.
4524
- */
4525
- product_tags?: Array<string>;
4526
- }
4527
1493
  }
4528
1494
  interface AddCredit {
4529
1495
  /**
@@ -4541,6 +1507,9 @@ export declare namespace ContractEditParams {
4541
1507
  * applicable_product_tags are not provided, the credit applies to all products.
4542
1508
  */
4543
1509
  applicable_product_tags?: Array<string>;
1510
+ /**
1511
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1512
+ */
4544
1513
  custom_fields?: {
4545
1514
  [key: string]: string;
4546
1515
  };
@@ -4551,7 +1520,7 @@ export declare namespace ContractEditParams {
4551
1520
  /**
4552
1521
  * Optional configuration for credit hierarchy access control
4553
1522
  */
4554
- hierarchy_configuration?: AddCredit.HierarchyConfiguration;
1523
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
4555
1524
  /**
4556
1525
  * displayed on invoices
4557
1526
  */
@@ -4574,7 +1543,7 @@ export declare namespace ContractEditParams {
4574
1543
  * Instead, to target usage by product or product tag, pass those values in the
4575
1544
  * body of `specifiers`.
4576
1545
  */
4577
- specifiers?: Array<AddCredit.Specifier>;
1546
+ specifiers?: Array<Shared.CommitSpecifierInput>;
4578
1547
  }
4579
1548
  namespace AddCredit {
4580
1549
  /**
@@ -4597,41 +1566,6 @@ export declare namespace ContractEditParams {
4597
1566
  starting_at: string;
4598
1567
  }
4599
1568
  }
4600
- /**
4601
- * Optional configuration for credit hierarchy access control
4602
- */
4603
- interface HierarchyConfiguration {
4604
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
4605
- }
4606
- namespace HierarchyConfiguration {
4607
- interface CommitHierarchyChildAccessAll {
4608
- type: 'ALL';
4609
- }
4610
- interface CommitHierarchyChildAccessNone {
4611
- type: 'NONE';
4612
- }
4613
- interface CommitHierarchyChildAccessContractIDs {
4614
- contract_ids: Array<string>;
4615
- type: 'CONTRACT_IDS';
4616
- }
4617
- }
4618
- interface Specifier {
4619
- presentation_group_values?: {
4620
- [key: string]: string;
4621
- };
4622
- pricing_group_values?: {
4623
- [key: string]: string;
4624
- };
4625
- /**
4626
- * If provided, the specifier will only apply to the product with the specified ID.
4627
- */
4628
- product_id?: string;
4629
- /**
4630
- * If provided, the specifier will only apply to products with all the specified
4631
- * tags.
4632
- */
4633
- product_tags?: Array<string>;
4634
- }
4635
1569
  }
4636
1570
  interface AddDiscount {
4637
1571
  product_id: string;
@@ -4639,6 +1573,9 @@ export declare namespace ContractEditParams {
4639
1573
  * Must provide either schedule_items or recurring_schedule.
4640
1574
  */
4641
1575
  schedule: AddDiscount.Schedule;
1576
+ /**
1577
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1578
+ */
4642
1579
  custom_fields?: {
4643
1580
  [key: string]: string;
4644
1581
  };
@@ -4824,197 +1761,62 @@ export declare namespace ContractEditParams {
4824
1761
  /**
4825
1762
  * If provided, the override will only apply to the product with the specified ID.
4826
1763
  */
4827
- product_id?: string;
4828
- /**
4829
- * If provided, the override will only apply to products with all the specified
4830
- * tags.
4831
- */
4832
- product_tags?: Array<string>;
4833
- /**
4834
- * Can only be used for commit specific overrides. Must be used in conjunction with
4835
- * one of product_id, product_tags, pricing_group_values, or
4836
- * presentation_group_values. If provided, the override will only apply to commits
4837
- * created by the specified recurring commit ids.
4838
- */
4839
- recurring_commit_ids?: Array<string>;
4840
- /**
4841
- * Can only be used for commit specific overrides. Must be used in conjunction with
4842
- * one of product_id, product_tags, pricing_group_values, or
4843
- * presentation_group_values. If provided, the override will only apply to commits
4844
- * created by the specified recurring credit ids.
4845
- */
4846
- recurring_credit_ids?: Array<string>;
4847
- }
4848
- /**
4849
- * Required for OVERWRITE type.
4850
- */
4851
- interface OverwriteRate {
4852
- rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
4853
- credit_type_id?: string;
4854
- /**
4855
- * Only set for CUSTOM rate_type. This field is interpreted by custom rate
4856
- * processors.
4857
- */
4858
- custom_rate?: {
4859
- [key: string]: unknown;
4860
- };
4861
- /**
4862
- * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
4863
- * set to true.
4864
- */
4865
- is_prorated?: boolean;
4866
- /**
4867
- * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
4868
- * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
4869
- */
4870
- price?: number;
4871
- /**
4872
- * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
4873
- */
4874
- quantity?: number;
4875
- /**
4876
- * Only set for TIERED rate_type.
4877
- */
4878
- tiers?: Array<Shared.Tier>;
4879
- }
4880
- interface Tier {
4881
- multiplier: number;
4882
- size?: number;
4883
- }
4884
- }
4885
- interface AddPrepaidBalanceThresholdConfiguration {
4886
- commit: AddPrepaidBalanceThresholdConfiguration.Commit;
4887
- /**
4888
- * When set to false, the contract will not be evaluated against the
4889
- * threshold_amount. Toggling to true will result an immediate evaluation,
4890
- * regardless of prior state.
4891
- */
4892
- is_enabled: boolean;
4893
- payment_gate_config: AddPrepaidBalanceThresholdConfiguration.PaymentGateConfig;
4894
- /**
4895
- * Specify the amount the balance should be recharged to.
4896
- */
4897
- recharge_to_amount: number;
4898
- /**
4899
- * Specify the threshold amount for the contract. Each time the contract's balance
4900
- * lowers to this amount, a threshold charge will be initiated.
4901
- */
4902
- threshold_amount: number;
4903
- /**
4904
- * If provided, the threshold, recharge-to amount, and the resulting threshold
4905
- * commit amount will be in terms of this credit type instead of the fiat currency.
4906
- */
4907
- custom_credit_type_id?: string;
4908
- }
4909
- namespace AddPrepaidBalanceThresholdConfiguration {
4910
- interface Commit {
4911
- /**
4912
- * The commit product that will be used to generate the line item for commit
4913
- * payment.
4914
- */
4915
- product_id: string;
4916
- /**
4917
- * Which products the threshold commit applies to. If applicable_product_ids,
4918
- * applicable_product_tags or specifiers are not provided, the commit applies to
4919
- * all products.
4920
- */
4921
- applicable_product_ids?: Array<string>;
4922
- /**
4923
- * Which tags the threshold commit applies to. If applicable_product_ids,
4924
- * applicable_product_tags or specifiers are not provided, the commit applies to
4925
- * all products.
4926
- */
4927
- applicable_product_tags?: Array<string>;
4928
- description?: string;
1764
+ product_id?: string;
4929
1765
  /**
4930
- * Specify the name of the line item for the threshold charge. If left blank, it
4931
- * will default to the commit product name.
1766
+ * If provided, the override will only apply to products with all the specified
1767
+ * tags.
4932
1768
  */
4933
- name?: string;
1769
+ product_tags?: Array<string>;
4934
1770
  /**
4935
- * List of filters that determine what kind of customer usage draws down a commit
4936
- * or credit. A customer's usage needs to meet the condition of at least one of the
4937
- * specifiers to contribute to a commit's or credit's drawdown. This field cannot
4938
- * be used together with `applicable_product_ids` or `applicable_product_tags`.
4939
- * Instead, to target usage by product or product tag, pass those values in the
4940
- * body of `specifiers`.
1771
+ * Can only be used for commit specific overrides. Must be used in conjunction with
1772
+ * one of product_id, product_tags, pricing_group_values, or
1773
+ * presentation_group_values. If provided, the override will only apply to commits
1774
+ * created by the specified recurring commit ids.
4941
1775
  */
4942
- specifiers?: Array<Commit.Specifier>;
4943
- }
4944
- namespace Commit {
4945
- interface Specifier {
4946
- presentation_group_values?: {
4947
- [key: string]: string;
4948
- };
4949
- pricing_group_values?: {
4950
- [key: string]: string;
4951
- };
4952
- /**
4953
- * If provided, the specifier will only apply to the product with the specified ID.
4954
- */
4955
- product_id?: string;
4956
- /**
4957
- * If provided, the specifier will only apply to products with all the specified
4958
- * tags.
4959
- */
4960
- product_tags?: Array<string>;
4961
- }
4962
- }
4963
- interface PaymentGateConfig {
1776
+ recurring_commit_ids?: Array<string>;
4964
1777
  /**
4965
- * Gate access to the commit balance based on successful collection of payment.
4966
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
4967
- * facilitate payment using your own payment integration. Select NONE if you do not
4968
- * wish to payment gate the commit balance.
1778
+ * Can only be used for commit specific overrides. Must be used in conjunction with
1779
+ * one of product_id, product_tags, pricing_group_values, or
1780
+ * presentation_group_values. If provided, the override will only apply to commits
1781
+ * created by the specified recurring credit ids.
4969
1782
  */
4970
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1783
+ recurring_credit_ids?: Array<string>;
1784
+ }
1785
+ /**
1786
+ * Required for OVERWRITE type.
1787
+ */
1788
+ interface OverwriteRate {
1789
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
1790
+ credit_type_id?: string;
4971
1791
  /**
4972
- * Only applicable if using PRECALCULATED as your tax type.
1792
+ * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1793
+ * processors.
4973
1794
  */
4974
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1795
+ custom_rate?: {
1796
+ [key: string]: unknown;
1797
+ };
4975
1798
  /**
4976
- * Only applicable if using STRIPE as your payment gateway type.
1799
+ * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
1800
+ * set to true.
4977
1801
  */
4978
- stripe_config?: PaymentGateConfig.StripeConfig;
1802
+ is_prorated?: boolean;
4979
1803
  /**
4980
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
4981
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
4982
- * will default to NONE.
1804
+ * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
1805
+ * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
4983
1806
  */
4984
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
4985
- }
4986
- namespace PaymentGateConfig {
1807
+ price?: number;
4987
1808
  /**
4988
- * Only applicable if using PRECALCULATED as your tax type.
1809
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
4989
1810
  */
4990
- interface PrecalculatedTaxConfig {
4991
- /**
4992
- * Amount of tax to be applied. This should be in the same currency and
4993
- * denomination as the commit's invoice schedule
4994
- */
4995
- tax_amount: number;
4996
- /**
4997
- * Name of the tax to be applied. This may be used in an invoice line item
4998
- * description.
4999
- */
5000
- tax_name?: string;
5001
- }
1811
+ quantity?: number;
5002
1812
  /**
5003
- * Only applicable if using STRIPE as your payment gateway type.
1813
+ * Only set for TIERED rate_type.
5004
1814
  */
5005
- interface StripeConfig {
5006
- /**
5007
- * If left blank, will default to INVOICE
5008
- */
5009
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
5010
- /**
5011
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
5012
- * your payment type.
5013
- */
5014
- invoice_metadata?: {
5015
- [key: string]: string;
5016
- };
5017
- }
1815
+ tiers?: Array<Shared.Tier>;
1816
+ }
1817
+ interface Tier {
1818
+ multiplier: number;
1819
+ size?: number;
5018
1820
  }
5019
1821
  }
5020
1822
  interface AddProfessionalService {
@@ -5033,6 +1835,9 @@ export declare namespace ContractEditParams {
5033
1835
  * amount and must be specified.
5034
1836
  */
5035
1837
  unit_price: number;
1838
+ /**
1839
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1840
+ */
5036
1841
  custom_fields?: {
5037
1842
  [key: string]: string;
5038
1843
  };
@@ -5081,7 +1886,7 @@ export declare namespace ContractEditParams {
5081
1886
  /**
5082
1887
  * Optional configuration for recurring credit hierarchy access control
5083
1888
  */
5084
- hierarchy_configuration?: AddRecurringCommit.HierarchyConfiguration;
1889
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
5085
1890
  /**
5086
1891
  * The amount the customer should be billed for the commit. Not required.
5087
1892
  */
@@ -5125,7 +1930,7 @@ export declare namespace ContractEditParams {
5125
1930
  * Instead, to target usage by product or product tag, pass those values in the
5126
1931
  * body of `specifiers`.
5127
1932
  */
5128
- specifiers?: Array<AddRecurringCommit.Specifier>;
1933
+ specifiers?: Array<Shared.CommitSpecifierInput>;
5129
1934
  /**
5130
1935
  * Attach a subscription to the recurring commit/credit.
5131
1936
  */
@@ -5158,24 +1963,6 @@ export declare namespace ContractEditParams {
5158
1963
  value: number;
5159
1964
  unit?: 'PERIODS';
5160
1965
  }
5161
- /**
5162
- * Optional configuration for recurring credit hierarchy access control
5163
- */
5164
- interface HierarchyConfiguration {
5165
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
5166
- }
5167
- namespace HierarchyConfiguration {
5168
- interface CommitHierarchyChildAccessAll {
5169
- type: 'ALL';
5170
- }
5171
- interface CommitHierarchyChildAccessNone {
5172
- type: 'NONE';
5173
- }
5174
- interface CommitHierarchyChildAccessContractIDs {
5175
- contract_ids: Array<string>;
5176
- type: 'CONTRACT_IDS';
5177
- }
5178
- }
5179
1966
  /**
5180
1967
  * The amount the customer should be billed for the commit. Not required.
5181
1968
  */
@@ -5184,23 +1971,6 @@ export declare namespace ContractEditParams {
5184
1971
  quantity: number;
5185
1972
  unit_price: number;
5186
1973
  }
5187
- interface Specifier {
5188
- presentation_group_values?: {
5189
- [key: string]: string;
5190
- };
5191
- pricing_group_values?: {
5192
- [key: string]: string;
5193
- };
5194
- /**
5195
- * If provided, the specifier will only apply to the product with the specified ID.
5196
- */
5197
- product_id?: string;
5198
- /**
5199
- * If provided, the specifier will only apply to products with all the specified
5200
- * tags.
5201
- */
5202
- product_tags?: Array<string>;
5203
- }
5204
1974
  /**
5205
1975
  * Attach a subscription to the recurring commit/credit.
5206
1976
  */
@@ -5213,7 +1983,7 @@ export declare namespace ContractEditParams {
5213
1983
  /**
5214
1984
  * If set to POOLED, allocation added per seat is pooled across the account.
5215
1985
  */
5216
- allocation?: 'POOLED';
1986
+ allocation?: 'POOLED' | 'INDIVIDUAL';
5217
1987
  }
5218
1988
  namespace SubscriptionConfig {
5219
1989
  interface ApplySeatIncreaseConfig {
@@ -5263,7 +2033,7 @@ export declare namespace ContractEditParams {
5263
2033
  /**
5264
2034
  * Optional configuration for recurring credit hierarchy access control
5265
2035
  */
5266
- hierarchy_configuration?: AddRecurringCredit.HierarchyConfiguration;
2036
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
5267
2037
  /**
5268
2038
  * displayed on invoices. will be passed through to the individual commits
5269
2039
  */
@@ -5303,7 +2073,7 @@ export declare namespace ContractEditParams {
5303
2073
  * Instead, to target usage by product or product tag, pass those values in the
5304
2074
  * body of `specifiers`.
5305
2075
  */
5306
- specifiers?: Array<AddRecurringCredit.Specifier>;
2076
+ specifiers?: Array<Shared.CommitSpecifierInput>;
5307
2077
  /**
5308
2078
  * Attach a subscription to the recurring commit/credit.
5309
2079
  */
@@ -5336,41 +2106,6 @@ export declare namespace ContractEditParams {
5336
2106
  value: number;
5337
2107
  unit?: 'PERIODS';
5338
2108
  }
5339
- /**
5340
- * Optional configuration for recurring credit hierarchy access control
5341
- */
5342
- interface HierarchyConfiguration {
5343
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
5344
- }
5345
- namespace HierarchyConfiguration {
5346
- interface CommitHierarchyChildAccessAll {
5347
- type: 'ALL';
5348
- }
5349
- interface CommitHierarchyChildAccessNone {
5350
- type: 'NONE';
5351
- }
5352
- interface CommitHierarchyChildAccessContractIDs {
5353
- contract_ids: Array<string>;
5354
- type: 'CONTRACT_IDS';
5355
- }
5356
- }
5357
- interface Specifier {
5358
- presentation_group_values?: {
5359
- [key: string]: string;
5360
- };
5361
- pricing_group_values?: {
5362
- [key: string]: string;
5363
- };
5364
- /**
5365
- * If provided, the specifier will only apply to the product with the specified ID.
5366
- */
5367
- product_id?: string;
5368
- /**
5369
- * If provided, the specifier will only apply to products with all the specified
5370
- * tags.
5371
- */
5372
- product_tags?: Array<string>;
5373
- }
5374
2109
  /**
5375
2110
  * Attach a subscription to the recurring commit/credit.
5376
2111
  */
@@ -5383,7 +2118,7 @@ export declare namespace ContractEditParams {
5383
2118
  /**
5384
2119
  * If set to POOLED, allocation added per seat is pooled across the account.
5385
2120
  */
5386
- allocation?: 'POOLED';
2121
+ allocation?: 'POOLED' | 'INDIVIDUAL';
5387
2122
  }
5388
2123
  namespace SubscriptionConfig {
5389
2124
  interface ApplySeatIncreaseConfig {
@@ -5432,6 +2167,9 @@ export declare namespace ContractEditParams {
5432
2167
  * Must provide either schedule_items or recurring_schedule.
5433
2168
  */
5434
2169
  schedule: AddScheduledCharge.Schedule;
2170
+ /**
2171
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2172
+ */
5435
2173
  custom_fields?: {
5436
2174
  [key: string]: string;
5437
2175
  };
@@ -5472,156 +2210,72 @@ export declare namespace ContractEditParams {
5472
2210
  namespace Schedule {
5473
2211
  /**
5474
2212
  * Enter the unit price and quantity for the charge or instead only send the
5475
- * amount. If amount is sent, the unit price is assumed to be the amount and
5476
- * quantity is inferred to be 1.
5477
- */
5478
- interface RecurringSchedule {
5479
- amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
5480
- /**
5481
- * RFC 3339 timestamp (exclusive).
5482
- */
5483
- ending_before: string;
5484
- frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY';
5485
- /**
5486
- * RFC 3339 timestamp (inclusive).
5487
- */
5488
- starting_at: string;
5489
- /**
5490
- * Amount for the charge. Can be provided instead of unit_price and quantity. If
5491
- * amount is sent, the unit_price is assumed to be the amount and quantity is
5492
- * inferred to be 1.
5493
- */
5494
- amount?: number;
5495
- /**
5496
- * Quantity for the charge. Will be multiplied by unit_price to determine the
5497
- * amount and must be specified with unit_price. If specified amount cannot be
5498
- * provided.
5499
- */
5500
- quantity?: number;
5501
- /**
5502
- * Unit price for the charge. Will be multiplied by quantity to determine the
5503
- * amount and must be specified with quantity. If specified amount cannot be
5504
- * provided.
5505
- */
5506
- unit_price?: number;
5507
- }
5508
- interface ScheduleItem {
5509
- /**
5510
- * timestamp of the scheduled event
5511
- */
5512
- timestamp: string;
5513
- /**
5514
- * Amount for the charge. Can be provided instead of unit_price and quantity. If
5515
- * amount is sent, the unit_price is assumed to be the amount and quantity is
5516
- * inferred to be 1.
5517
- */
5518
- amount?: number;
5519
- /**
5520
- * Quantity for the charge. Will be multiplied by unit_price to determine the
5521
- * amount and must be specified with unit_price. If specified amount cannot be
5522
- * provided.
5523
- */
5524
- quantity?: number;
5525
- /**
5526
- * Unit price for the charge. Will be multiplied by quantity to determine the
5527
- * amount and must be specified with quantity. If specified amount cannot be
5528
- * provided.
5529
- */
5530
- unit_price?: number;
5531
- }
5532
- }
5533
- }
5534
- interface AddSpendThresholdConfiguration {
5535
- commit: AddSpendThresholdConfiguration.Commit;
5536
- /**
5537
- * When set to false, the contract will not be evaluated against the
5538
- * threshold_amount. Toggling to true will result an immediate evaluation,
5539
- * regardless of prior state.
5540
- */
5541
- is_enabled: boolean;
5542
- payment_gate_config: AddSpendThresholdConfiguration.PaymentGateConfig;
5543
- /**
5544
- * Specify the threshold amount for the contract. Each time the contract's usage
5545
- * hits this amount, a threshold charge will be initiated.
5546
- */
5547
- threshold_amount: number;
5548
- }
5549
- namespace AddSpendThresholdConfiguration {
5550
- interface Commit {
5551
- /**
5552
- * The commit product that will be used to generate the line item for commit
5553
- * payment.
5554
- */
5555
- product_id: string;
5556
- description?: string;
5557
- /**
5558
- * Specify the name of the line item for the threshold charge. If left blank, it
5559
- * will default to the commit product name.
5560
- */
5561
- name?: string;
5562
- }
5563
- interface PaymentGateConfig {
5564
- /**
5565
- * Gate access to the commit balance based on successful collection of payment.
5566
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
5567
- * facilitate payment using your own payment integration. Select NONE if you do not
5568
- * wish to payment gate the commit balance.
5569
- */
5570
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
5571
- /**
5572
- * Only applicable if using PRECALCULATED as your tax type.
5573
- */
5574
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
5575
- /**
5576
- * Only applicable if using STRIPE as your payment gateway type.
5577
- */
5578
- stripe_config?: PaymentGateConfig.StripeConfig;
5579
- /**
5580
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
5581
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
5582
- * will default to NONE.
5583
- */
5584
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
5585
- }
5586
- namespace PaymentGateConfig {
5587
- /**
5588
- * Only applicable if using PRECALCULATED as your tax type.
2213
+ * amount. If amount is sent, the unit price is assumed to be the amount and
2214
+ * quantity is inferred to be 1.
5589
2215
  */
5590
- interface PrecalculatedTaxConfig {
2216
+ interface RecurringSchedule {
2217
+ amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
5591
2218
  /**
5592
- * Amount of tax to be applied. This should be in the same currency and
5593
- * denomination as the commit's invoice schedule
2219
+ * RFC 3339 timestamp (exclusive).
5594
2220
  */
5595
- tax_amount: number;
2221
+ ending_before: string;
2222
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY';
5596
2223
  /**
5597
- * Name of the tax to be applied. This may be used in an invoice line item
5598
- * description.
2224
+ * RFC 3339 timestamp (inclusive).
5599
2225
  */
5600
- tax_name?: string;
2226
+ starting_at: string;
2227
+ /**
2228
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
2229
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
2230
+ * inferred to be 1.
2231
+ */
2232
+ amount?: number;
2233
+ /**
2234
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
2235
+ * amount and must be specified with unit_price. If specified amount cannot be
2236
+ * provided.
2237
+ */
2238
+ quantity?: number;
2239
+ /**
2240
+ * Unit price for the charge. Will be multiplied by quantity to determine the
2241
+ * amount and must be specified with quantity. If specified amount cannot be
2242
+ * provided.
2243
+ */
2244
+ unit_price?: number;
5601
2245
  }
5602
- /**
5603
- * Only applicable if using STRIPE as your payment gateway type.
5604
- */
5605
- interface StripeConfig {
2246
+ interface ScheduleItem {
5606
2247
  /**
5607
- * If left blank, will default to INVOICE
2248
+ * timestamp of the scheduled event
5608
2249
  */
5609
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
2250
+ timestamp: string;
5610
2251
  /**
5611
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
5612
- * your payment type.
2252
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
2253
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
2254
+ * inferred to be 1.
5613
2255
  */
5614
- invoice_metadata?: {
5615
- [key: string]: string;
5616
- };
2256
+ amount?: number;
2257
+ /**
2258
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
2259
+ * amount and must be specified with unit_price. If specified amount cannot be
2260
+ * provided.
2261
+ */
2262
+ quantity?: number;
2263
+ /**
2264
+ * Unit price for the charge. Will be multiplied by quantity to determine the
2265
+ * amount and must be specified with quantity. If specified amount cannot be
2266
+ * provided.
2267
+ */
2268
+ unit_price?: number;
5617
2269
  }
5618
2270
  }
5619
2271
  }
5620
2272
  interface AddSubscription {
5621
2273
  collection_schedule: 'ADVANCE' | 'ARREARS';
5622
- initial_quantity: number;
5623
2274
  proration: AddSubscription.Proration;
5624
2275
  subscription_rate: AddSubscription.SubscriptionRate;
2276
+ /**
2277
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2278
+ */
5625
2279
  custom_fields?: {
5626
2280
  [key: string]: string;
5627
2281
  };
@@ -5631,7 +2285,19 @@ export declare namespace ContractEditParams {
5631
2285
  * contract end date.
5632
2286
  */
5633
2287
  ending_before?: string;
2288
+ /**
2289
+ * The initial quantity for the subscription. It must be non-negative value.
2290
+ * Required if quantity_management_mode is QUANTITY_ONLY.
2291
+ */
2292
+ initial_quantity?: number;
5634
2293
  name?: string;
2294
+ /**
2295
+ * Determines how the subscription's quantity is controlled. Defaults to
2296
+ * QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
2297
+ * directly on the subscription. `initial_quantity` must be provided with this
2298
+ * option. Compatible with recurring commits/credits that use POOLED allocation.
2299
+ */
2300
+ quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY';
5635
2301
  /**
5636
2302
  * Inclusive start time for the subscription. If not provided, defaults to contract
5637
2303
  * start date
@@ -5700,11 +2366,17 @@ export declare namespace ContractEditParams {
5700
2366
  /**
5701
2367
  * Optional configuration for commit hierarchy access control
5702
2368
  */
5703
- hierarchy_configuration?: UpdateCommit.HierarchyConfiguration;
2369
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
5704
2370
  invoice_schedule?: UpdateCommit.InvoiceSchedule;
5705
2371
  netsuite_sales_order_id?: string | null;
5706
2372
  priority?: number | null;
5707
2373
  product_id?: string;
2374
+ /**
2375
+ * If provided, updates the commit to use the specified rate type for current and
2376
+ * future invoices. Previously finalized invoices will need to be voided and
2377
+ * regenerated to reflect the rate type change.
2378
+ */
2379
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
5708
2380
  rollover_fraction?: number | null;
5709
2381
  }
5710
2382
  namespace UpdateCommit {
@@ -5729,24 +2401,6 @@ export declare namespace ContractEditParams {
5729
2401
  starting_at?: string;
5730
2402
  }
5731
2403
  }
5732
- /**
5733
- * Optional configuration for commit hierarchy access control
5734
- */
5735
- interface HierarchyConfiguration {
5736
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
5737
- }
5738
- namespace HierarchyConfiguration {
5739
- interface CommitHierarchyChildAccessAll {
5740
- type: 'ALL';
5741
- }
5742
- interface CommitHierarchyChildAccessNone {
5743
- type: 'NONE';
5744
- }
5745
- interface CommitHierarchyChildAccessContractIDs {
5746
- contract_ids: Array<string>;
5747
- type: 'CONTRACT_IDS';
5748
- }
5749
- }
5750
2404
  interface InvoiceSchedule {
5751
2405
  add_schedule_items?: Array<InvoiceSchedule.AddScheduleItem>;
5752
2406
  remove_schedule_items?: Array<InvoiceSchedule.RemoveScheduleItem>;
@@ -5789,10 +2443,16 @@ export declare namespace ContractEditParams {
5789
2443
  /**
5790
2444
  * Optional configuration for commit hierarchy access control
5791
2445
  */
5792
- hierarchy_configuration?: UpdateCredit.HierarchyConfiguration;
2446
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
5793
2447
  netsuite_sales_order_id?: string | null;
5794
2448
  priority?: number | null;
5795
2449
  product_id?: string;
2450
+ /**
2451
+ * If provided, updates the credit to use the specified rate type for current and
2452
+ * future invoices. Previously finalized invoices will need to be voided and
2453
+ * regenerated to reflect the rate type change.
2454
+ */
2455
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
5796
2456
  }
5797
2457
  namespace UpdateCredit {
5798
2458
  interface AccessSchedule {
@@ -5816,24 +2476,6 @@ export declare namespace ContractEditParams {
5816
2476
  starting_at?: string;
5817
2477
  }
5818
2478
  }
5819
- /**
5820
- * Optional configuration for commit hierarchy access control
5821
- */
5822
- interface HierarchyConfiguration {
5823
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
5824
- }
5825
- namespace HierarchyConfiguration {
5826
- interface CommitHierarchyChildAccessAll {
5827
- type: 'ALL';
5828
- }
5829
- interface CommitHierarchyChildAccessNone {
5830
- type: 'NONE';
5831
- }
5832
- interface CommitHierarchyChildAccessContractIDs {
5833
- contract_ids: Array<string>;
5834
- type: 'CONTRACT_IDS';
5835
- }
5836
- }
5837
2479
  }
5838
2480
  interface UpdatePrepaidBalanceThresholdConfiguration {
5839
2481
  commit?: UpdatePrepaidBalanceThresholdConfiguration.Commit;
@@ -5848,7 +2490,7 @@ export declare namespace ContractEditParams {
5848
2490
  * regardless of prior state.
5849
2491
  */
5850
2492
  is_enabled?: boolean;
5851
- payment_gate_config?: UpdatePrepaidBalanceThresholdConfiguration.PaymentGateConfig;
2493
+ payment_gate_config?: Shared.PaymentGateConfigV2;
5852
2494
  /**
5853
2495
  * Specify the amount the balance should be recharged to.
5854
2496
  */
@@ -5860,7 +2502,7 @@ export declare namespace ContractEditParams {
5860
2502
  threshold_amount?: number;
5861
2503
  }
5862
2504
  namespace UpdatePrepaidBalanceThresholdConfiguration {
5863
- interface Commit {
2505
+ interface Commit extends Shared.UpdateBaseThresholdCommit {
5864
2506
  /**
5865
2507
  * Which products the threshold commit applies to. If both applicable_product_ids
5866
2508
  * and applicable_product_tags are not provided, the commit applies to all
@@ -5872,17 +2514,6 @@ export declare namespace ContractEditParams {
5872
2514
  * applicable_product_tags are not provided, the commit applies to all products.
5873
2515
  */
5874
2516
  applicable_product_tags?: Array<string> | null;
5875
- description?: string;
5876
- /**
5877
- * Specify the name of the line item for the threshold charge. If left blank, it
5878
- * will default to the commit product name.
5879
- */
5880
- name?: string;
5881
- /**
5882
- * The commit product that will be used to generate the line item for commit
5883
- * payment.
5884
- */
5885
- product_id?: string;
5886
2517
  /**
5887
2518
  * List of filters that determine what kind of customer usage draws down a commit
5888
2519
  * or credit. A customer's usage needs to meet the condition of at least one of the
@@ -5891,82 +2522,7 @@ export declare namespace ContractEditParams {
5891
2522
  * Instead, to target usage by product or product tag, pass those values in the
5892
2523
  * body of `specifiers`.
5893
2524
  */
5894
- specifiers?: Array<Commit.Specifier> | null;
5895
- }
5896
- namespace Commit {
5897
- interface Specifier {
5898
- presentation_group_values?: {
5899
- [key: string]: string;
5900
- };
5901
- pricing_group_values?: {
5902
- [key: string]: string;
5903
- };
5904
- /**
5905
- * If provided, the specifier will only apply to the product with the specified ID.
5906
- */
5907
- product_id?: string;
5908
- /**
5909
- * If provided, the specifier will only apply to products with all the specified
5910
- * tags.
5911
- */
5912
- product_tags?: Array<string>;
5913
- }
5914
- }
5915
- interface PaymentGateConfig {
5916
- /**
5917
- * Gate access to the commit balance based on successful collection of payment.
5918
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
5919
- * facilitate payment using your own payment integration. Select NONE if you do not
5920
- * wish to payment gate the commit balance.
5921
- */
5922
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
5923
- /**
5924
- * Only applicable if using PRECALCULATED as your tax type.
5925
- */
5926
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
5927
- /**
5928
- * Only applicable if using STRIPE as your payment gateway type.
5929
- */
5930
- stripe_config?: PaymentGateConfig.StripeConfig;
5931
- /**
5932
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
5933
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
5934
- * will default to NONE.
5935
- */
5936
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
5937
- }
5938
- namespace PaymentGateConfig {
5939
- /**
5940
- * Only applicable if using PRECALCULATED as your tax type.
5941
- */
5942
- interface PrecalculatedTaxConfig {
5943
- /**
5944
- * Amount of tax to be applied. This should be in the same currency and
5945
- * denomination as the commit's invoice schedule
5946
- */
5947
- tax_amount: number;
5948
- /**
5949
- * Name of the tax to be applied. This may be used in an invoice line item
5950
- * description.
5951
- */
5952
- tax_name?: string;
5953
- }
5954
- /**
5955
- * Only applicable if using STRIPE as your payment gateway type.
5956
- */
5957
- interface StripeConfig {
5958
- /**
5959
- * If left blank, will default to INVOICE
5960
- */
5961
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
5962
- /**
5963
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
5964
- * your payment type.
5965
- */
5966
- invoice_metadata?: {
5967
- [key: string]: string;
5968
- };
5969
- }
2525
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
5970
2526
  }
5971
2527
  }
5972
2528
  interface UpdateRecurringCommit {
@@ -6027,91 +2583,20 @@ export declare namespace ContractEditParams {
6027
2583
  }
6028
2584
  }
6029
2585
  interface UpdateSpendThresholdConfiguration {
6030
- commit?: UpdateSpendThresholdConfiguration.Commit;
2586
+ commit?: Shared.UpdateBaseThresholdCommit;
6031
2587
  /**
6032
2588
  * When set to false, the contract will not be evaluated against the
6033
2589
  * threshold_amount. Toggling to true will result an immediate evaluation,
6034
2590
  * regardless of prior state.
6035
2591
  */
6036
2592
  is_enabled?: boolean;
6037
- payment_gate_config?: UpdateSpendThresholdConfiguration.PaymentGateConfig;
2593
+ payment_gate_config?: Shared.PaymentGateConfigV2;
6038
2594
  /**
6039
2595
  * Specify the threshold amount for the contract. Each time the contract's usage
6040
2596
  * hits this amount, a threshold charge will be initiated.
6041
2597
  */
6042
2598
  threshold_amount?: number;
6043
2599
  }
6044
- namespace UpdateSpendThresholdConfiguration {
6045
- interface Commit {
6046
- description?: string;
6047
- /**
6048
- * Specify the name of the line item for the threshold charge. If left blank, it
6049
- * will default to the commit product name.
6050
- */
6051
- name?: string;
6052
- /**
6053
- * The commit product that will be used to generate the line item for commit
6054
- * payment.
6055
- */
6056
- product_id?: string;
6057
- }
6058
- interface PaymentGateConfig {
6059
- /**
6060
- * Gate access to the commit balance based on successful collection of payment.
6061
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
6062
- * facilitate payment using your own payment integration. Select NONE if you do not
6063
- * wish to payment gate the commit balance.
6064
- */
6065
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
6066
- /**
6067
- * Only applicable if using PRECALCULATED as your tax type.
6068
- */
6069
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
6070
- /**
6071
- * Only applicable if using STRIPE as your payment gateway type.
6072
- */
6073
- stripe_config?: PaymentGateConfig.StripeConfig;
6074
- /**
6075
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
6076
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
6077
- * will default to NONE.
6078
- */
6079
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
6080
- }
6081
- namespace PaymentGateConfig {
6082
- /**
6083
- * Only applicable if using PRECALCULATED as your tax type.
6084
- */
6085
- interface PrecalculatedTaxConfig {
6086
- /**
6087
- * Amount of tax to be applied. This should be in the same currency and
6088
- * denomination as the commit's invoice schedule
6089
- */
6090
- tax_amount: number;
6091
- /**
6092
- * Name of the tax to be applied. This may be used in an invoice line item
6093
- * description.
6094
- */
6095
- tax_name?: string;
6096
- }
6097
- /**
6098
- * Only applicable if using STRIPE as your payment gateway type.
6099
- */
6100
- interface StripeConfig {
6101
- /**
6102
- * If left blank, will default to INVOICE
6103
- */
6104
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
6105
- /**
6106
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
6107
- * your payment type.
6108
- */
6109
- invoice_metadata?: {
6110
- [key: string]: string;
6111
- };
6112
- }
6113
- }
6114
- }
6115
2600
  interface UpdateSubscription {
6116
2601
  subscription_id: string;
6117
2602
  ending_before?: string | null;
@@ -6172,6 +2657,12 @@ export interface ContractEditCommitParams {
6172
2657
  */
6173
2658
  priority?: number | null;
6174
2659
  product_id?: string;
2660
+ /**
2661
+ * If provided, updates the commit to use the specified rate type for current and
2662
+ * future invoices. Previously finalized invoices will need to be voided and
2663
+ * regenerated to reflect the rate type change.
2664
+ */
2665
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
6175
2666
  /**
6176
2667
  * List of filters that determine what kind of customer usage draws down a commit
6177
2668
  * or credit. A customer's usage needs to meet the condition of at least one of the
@@ -6180,7 +2671,7 @@ export interface ContractEditCommitParams {
6180
2671
  * Instead, to target usage by product or product tag, pass those values in the
6181
2672
  * body of `specifiers`.
6182
2673
  */
6183
- specifiers?: Array<ContractEditCommitParams.Specifier> | null;
2674
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
6184
2675
  }
6185
2676
  export declare namespace ContractEditCommitParams {
6186
2677
  interface AccessSchedule {
@@ -6227,23 +2718,6 @@ export declare namespace ContractEditCommitParams {
6227
2718
  unit_price?: number;
6228
2719
  }
6229
2720
  }
6230
- interface Specifier {
6231
- presentation_group_values?: {
6232
- [key: string]: string;
6233
- };
6234
- pricing_group_values?: {
6235
- [key: string]: string;
6236
- };
6237
- /**
6238
- * If provided, the specifier will only apply to the product with the specified ID.
6239
- */
6240
- product_id?: string;
6241
- /**
6242
- * If provided, the specifier will only apply to products with all the specified
6243
- * tags.
6244
- */
6245
- product_tags?: Array<string>;
6246
- }
6247
2721
  }
6248
2722
  export interface ContractEditCreditParams {
6249
2723
  /**
@@ -6271,6 +2745,12 @@ export interface ContractEditCreditParams {
6271
2745
  */
6272
2746
  priority?: number | null;
6273
2747
  product_id?: string;
2748
+ /**
2749
+ * If provided, updates the credit to use the specified rate type for current and
2750
+ * future invoices. Previously finalized invoices will need to be voided and
2751
+ * regenerated to reflect the rate type change.
2752
+ */
2753
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
6274
2754
  /**
6275
2755
  * List of filters that determine what kind of customer usage draws down a commit
6276
2756
  * or credit. A customer's usage needs to meet the condition of at least one of the
@@ -6279,7 +2759,7 @@ export interface ContractEditCreditParams {
6279
2759
  * Instead, to target usage by product or product tag, pass those values in the
6280
2760
  * body of `specifiers`.
6281
2761
  */
6282
- specifiers?: Array<ContractEditCreditParams.Specifier> | null;
2762
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
6283
2763
  }
6284
2764
  export declare namespace ContractEditCreditParams {
6285
2765
  interface AccessSchedule {
@@ -6303,23 +2783,6 @@ export declare namespace ContractEditCreditParams {
6303
2783
  starting_at?: string;
6304
2784
  }
6305
2785
  }
6306
- interface Specifier {
6307
- presentation_group_values?: {
6308
- [key: string]: string;
6309
- };
6310
- pricing_group_values?: {
6311
- [key: string]: string;
6312
- };
6313
- /**
6314
- * If provided, the specifier will only apply to the product with the specified ID.
6315
- */
6316
- product_id?: string;
6317
- /**
6318
- * If provided, the specifier will only apply to products with all the specified
6319
- * tags.
6320
- */
6321
- product_tags?: Array<string>;
6322
- }
6323
2786
  }
6324
2787
  export interface ContractGetEditHistoryParams {
6325
2788
  contract_id: string;