@metronome/sdk 0.2.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 +62 -0
  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 +116 -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 +1409 -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 +450 -1285
  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 +47 -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 +145 -47
  434. package/resources/v1/customers/commits.d.ts.map +1 -1
  435. package/resources/v1/customers/commits.js +132 -12
  436. package/resources/v1/customers/commits.js.map +1 -1
  437. package/resources/v1/customers/commits.mjs +132 -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 +196 -19
  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 +381 -3862
  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 -220
  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 +1786 -520
  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 +518 -1622
  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 +52 -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 +153 -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 +206 -37
  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 +431 -4967
  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,10 +181,23 @@ 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`.
191
+ *
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.
110
201
  *
111
202
  * @example
112
203
  * ```ts
@@ -114,2453 +205,15 @@ export declare class Contracts extends APIResource {
114
205
  * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
115
206
  * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
116
207
  * });
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
- }
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,11 +713,20 @@ 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;
720
+ /**
721
+ * If multiple commits are applicable, the one with the lower priority will apply
722
+ * first.
723
+ */
724
+ priority?: number | null;
3527
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';
3528
730
  rollover_fraction?: number | null;
3529
731
  /**
3530
732
  * List of filters that determine what kind of customer usage draws down a commit
@@ -3534,7 +736,7 @@ export declare namespace ContractGetEditHistoryResponse {
3534
736
  * Instead, to target usage by product or product tag, pass those values in the
3535
737
  * body of `specifiers`.
3536
738
  */
3537
- specifiers?: Array<UpdateCommit.Specifier> | null;
739
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
3538
740
  }
3539
741
  namespace UpdateCommit {
3540
742
  interface AccessSchedule {
@@ -3570,24 +772,6 @@ export declare namespace ContractGetEditHistoryResponse {
3570
772
  starting_at?: string;
3571
773
  }
3572
774
  }
3573
- /**
3574
- * Optional configuration for commit hierarchy access control
3575
- */
3576
- interface HierarchyConfiguration {
3577
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
3578
- }
3579
- namespace HierarchyConfiguration {
3580
- interface CommitHierarchyChildAccessAll {
3581
- type: 'ALL';
3582
- }
3583
- interface CommitHierarchyChildAccessNone {
3584
- type: 'NONE';
3585
- }
3586
- interface CommitHierarchyChildAccessContractIDs {
3587
- contract_ids: Array<string>;
3588
- type: 'CONTRACT_IDS';
3589
- }
3590
- }
3591
775
  interface InvoiceSchedule {
3592
776
  add_schedule_items?: Array<InvoiceSchedule.AddScheduleItem>;
3593
777
  remove_schedule_items?: Array<InvoiceSchedule.RemoveScheduleItem>;
@@ -3611,23 +795,6 @@ export declare namespace ContractGetEditHistoryResponse {
3611
795
  unit_price?: number;
3612
796
  }
3613
797
  }
3614
- interface Specifier {
3615
- presentation_group_values?: {
3616
- [key: string]: string;
3617
- };
3618
- pricing_group_values?: {
3619
- [key: string]: string;
3620
- };
3621
- /**
3622
- * If provided, the specifier will only apply to the product with the specified ID.
3623
- */
3624
- product_id?: string;
3625
- /**
3626
- * If provided, the specifier will only apply to products with all the specified
3627
- * tags.
3628
- */
3629
- product_tags?: Array<string>;
3630
- }
3631
798
  }
3632
799
  interface UpdateCredit {
3633
800
  id: string;
@@ -3635,9 +802,18 @@ export declare namespace ContractGetEditHistoryResponse {
3635
802
  /**
3636
803
  * Optional configuration for credit hierarchy access control
3637
804
  */
3638
- hierarchy_configuration?: UpdateCredit.HierarchyConfiguration;
805
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
3639
806
  name?: string;
3640
807
  netsuite_sales_order_id?: string | null;
808
+ /**
809
+ * If multiple credits are applicable, the one with the lower priority will apply
810
+ * first.
811
+ */
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';
3641
817
  rollover_fraction?: number | null;
3642
818
  }
3643
819
  namespace UpdateCredit {
@@ -3674,27 +850,12 @@ export declare namespace ContractGetEditHistoryResponse {
3674
850
  starting_at?: string;
3675
851
  }
3676
852
  }
3677
- /**
3678
- * Optional configuration for credit hierarchy access control
3679
- */
3680
- interface HierarchyConfiguration {
3681
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
3682
- }
3683
- namespace HierarchyConfiguration {
3684
- interface CommitHierarchyChildAccessAll {
3685
- type: 'ALL';
3686
- }
3687
- interface CommitHierarchyChildAccessNone {
3688
- type: 'NONE';
3689
- }
3690
- interface CommitHierarchyChildAccessContractIDs {
3691
- contract_ids: Array<string>;
3692
- type: 'CONTRACT_IDS';
3693
- }
3694
- }
3695
853
  }
3696
854
  interface UpdateDiscount {
3697
855
  id: string;
856
+ /**
857
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
858
+ */
3698
859
  custom_fields?: {
3699
860
  [key: string]: string;
3700
861
  };
@@ -3714,6 +875,11 @@ export declare namespace ContractGetEditHistoryResponse {
3714
875
  * Defaults to USD (cents) if not passed.
3715
876
  */
3716
877
  credit_type_id?: string;
878
+ /**
879
+ * This field is only applicable to commit invoice schedules. If true, this
880
+ * schedule will not generate an invoice.
881
+ */
882
+ do_not_invoice?: boolean;
3717
883
  /**
3718
884
  * Enter the unit price and quantity for the charge or instead only send the
3719
885
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -3800,7 +966,7 @@ export declare namespace ContractGetEditHistoryResponse {
3800
966
  * regardless of prior state.
3801
967
  */
3802
968
  is_enabled?: boolean;
3803
- payment_gate_config?: UpdatePrepaidBalanceThresholdConfiguration.PaymentGateConfig;
969
+ payment_gate_config?: Shared.PaymentGateConfigV2;
3804
970
  /**
3805
971
  * Specify the amount the balance should be recharged to.
3806
972
  */
@@ -3812,7 +978,7 @@ export declare namespace ContractGetEditHistoryResponse {
3812
978
  threshold_amount?: number;
3813
979
  }
3814
980
  namespace UpdatePrepaidBalanceThresholdConfiguration {
3815
- interface Commit {
981
+ interface Commit extends Shared.UpdateBaseThresholdCommit {
3816
982
  /**
3817
983
  * Which products the threshold commit applies to. If both applicable_product_ids
3818
984
  * and applicable_product_tags are not provided, the commit applies to all
@@ -3824,17 +990,6 @@ export declare namespace ContractGetEditHistoryResponse {
3824
990
  * applicable_product_tags are not provided, the commit applies to all products.
3825
991
  */
3826
992
  applicable_product_tags?: Array<string> | null;
3827
- description?: string;
3828
- /**
3829
- * Specify the name of the line item for the threshold charge. If left blank, it
3830
- * will default to the commit product name.
3831
- */
3832
- name?: string;
3833
- /**
3834
- * The commit product that will be used to generate the line item for commit
3835
- * payment.
3836
- */
3837
- product_id?: string;
3838
993
  /**
3839
994
  * List of filters that determine what kind of customer usage draws down a commit
3840
995
  * or credit. A customer's usage needs to meet the condition of at least one of the
@@ -3843,82 +998,7 @@ export declare namespace ContractGetEditHistoryResponse {
3843
998
  * Instead, to target usage by product or product tag, pass those values in the
3844
999
  * body of `specifiers`.
3845
1000
  */
3846
- specifiers?: Array<Commit.Specifier> | null;
3847
- }
3848
- namespace Commit {
3849
- interface Specifier {
3850
- presentation_group_values?: {
3851
- [key: string]: string;
3852
- };
3853
- pricing_group_values?: {
3854
- [key: string]: string;
3855
- };
3856
- /**
3857
- * If provided, the specifier will only apply to the product with the specified ID.
3858
- */
3859
- product_id?: string;
3860
- /**
3861
- * If provided, the specifier will only apply to products with all the specified
3862
- * tags.
3863
- */
3864
- product_tags?: Array<string>;
3865
- }
3866
- }
3867
- interface PaymentGateConfig {
3868
- /**
3869
- * Gate access to the commit balance based on successful collection of payment.
3870
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
3871
- * facilitate payment using your own payment integration. Select NONE if you do not
3872
- * wish to payment gate the commit balance.
3873
- */
3874
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
3875
- /**
3876
- * Only applicable if using PRECALCULATED as your tax type.
3877
- */
3878
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
3879
- /**
3880
- * Only applicable if using STRIPE as your payment gateway type.
3881
- */
3882
- stripe_config?: PaymentGateConfig.StripeConfig;
3883
- /**
3884
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
3885
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
3886
- * will default to NONE.
3887
- */
3888
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
3889
- }
3890
- namespace PaymentGateConfig {
3891
- /**
3892
- * Only applicable if using PRECALCULATED as your tax type.
3893
- */
3894
- interface PrecalculatedTaxConfig {
3895
- /**
3896
- * Amount of tax to be applied. This should be in the same currency and
3897
- * denomination as the commit's invoice schedule
3898
- */
3899
- tax_amount: number;
3900
- /**
3901
- * Name of the tax to be applied. This may be used in an invoice line item
3902
- * description.
3903
- */
3904
- tax_name?: string;
3905
- }
3906
- /**
3907
- * Only applicable if using STRIPE as your payment gateway type.
3908
- */
3909
- interface StripeConfig {
3910
- /**
3911
- * If left blank, will default to INVOICE
3912
- */
3913
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
3914
- /**
3915
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
3916
- * your payment type.
3917
- */
3918
- invoice_metadata?: {
3919
- [key: string]: string;
3920
- };
3921
- }
1001
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
3922
1002
  }
3923
1003
  }
3924
1004
  interface UpdateRecurringCommit {
@@ -3984,91 +1064,20 @@ export declare namespace ContractGetEditHistoryResponse {
3984
1064
  }
3985
1065
  }
3986
1066
  interface UpdateSpendThresholdConfiguration {
3987
- commit?: UpdateSpendThresholdConfiguration.Commit;
1067
+ commit?: Shared.UpdateBaseThresholdCommit;
3988
1068
  /**
3989
1069
  * When set to false, the contract will not be evaluated against the
3990
1070
  * threshold_amount. Toggling to true will result an immediate evaluation,
3991
1071
  * regardless of prior state.
3992
1072
  */
3993
1073
  is_enabled?: boolean;
3994
- payment_gate_config?: UpdateSpendThresholdConfiguration.PaymentGateConfig;
1074
+ payment_gate_config?: Shared.PaymentGateConfigV2;
3995
1075
  /**
3996
1076
  * Specify the threshold amount for the contract. Each time the contract's usage
3997
1077
  * hits this amount, a threshold charge will be initiated.
3998
1078
  */
3999
1079
  threshold_amount?: number;
4000
1080
  }
4001
- namespace UpdateSpendThresholdConfiguration {
4002
- interface Commit {
4003
- description?: string;
4004
- /**
4005
- * Specify the name of the line item for the threshold charge. If left blank, it
4006
- * will default to the commit product name.
4007
- */
4008
- name?: string;
4009
- /**
4010
- * The commit product that will be used to generate the line item for commit
4011
- * payment.
4012
- */
4013
- product_id?: string;
4014
- }
4015
- interface PaymentGateConfig {
4016
- /**
4017
- * Gate access to the commit balance based on successful collection of payment.
4018
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
4019
- * facilitate payment using your own payment integration. Select NONE if you do not
4020
- * wish to payment gate the commit balance.
4021
- */
4022
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
4023
- /**
4024
- * Only applicable if using PRECALCULATED as your tax type.
4025
- */
4026
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
4027
- /**
4028
- * Only applicable if using STRIPE as your payment gateway type.
4029
- */
4030
- stripe_config?: PaymentGateConfig.StripeConfig;
4031
- /**
4032
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
4033
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
4034
- * will default to NONE.
4035
- */
4036
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
4037
- }
4038
- namespace PaymentGateConfig {
4039
- /**
4040
- * Only applicable if using PRECALCULATED as your tax type.
4041
- */
4042
- interface PrecalculatedTaxConfig {
4043
- /**
4044
- * Amount of tax to be applied. This should be in the same currency and
4045
- * denomination as the commit's invoice schedule
4046
- */
4047
- tax_amount: number;
4048
- /**
4049
- * Name of the tax to be applied. This may be used in an invoice line item
4050
- * description.
4051
- */
4052
- tax_name?: string;
4053
- }
4054
- /**
4055
- * Only applicable if using STRIPE as your payment gateway type.
4056
- */
4057
- interface StripeConfig {
4058
- /**
4059
- * If left blank, will default to INVOICE
4060
- */
4061
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
4062
- /**
4063
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
4064
- * your payment type.
4065
- */
4066
- invoice_metadata?: {
4067
- [key: string]: string;
4068
- };
4069
- }
4070
- }
4071
- }
4072
1081
  interface UpdateSubscription {
4073
1082
  id: string;
4074
1083
  ending_before?: string;
@@ -4142,7 +1151,7 @@ export interface ContractEditParams {
4142
1151
  add_credits?: Array<ContractEditParams.AddCredit>;
4143
1152
  add_discounts?: Array<ContractEditParams.AddDiscount>;
4144
1153
  add_overrides?: Array<ContractEditParams.AddOverride>;
4145
- add_prepaid_balance_threshold_configuration?: ContractEditParams.AddPrepaidBalanceThresholdConfiguration;
1154
+ add_prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfigurationV2;
4146
1155
  /**
4147
1156
  * This field's availability is dependent on your client's configuration.
4148
1157
  */
@@ -4151,7 +1160,7 @@ export interface ContractEditParams {
4151
1160
  add_recurring_credits?: Array<ContractEditParams.AddRecurringCredit>;
4152
1161
  add_reseller_royalties?: Array<ContractEditParams.AddResellerRoyalty>;
4153
1162
  add_scheduled_charges?: Array<ContractEditParams.AddScheduledCharge>;
4154
- add_spend_threshold_configuration?: ContractEditParams.AddSpendThresholdConfiguration;
1163
+ add_spend_threshold_configuration?: Shared.SpendThresholdConfigurationV2;
4155
1164
  /**
4156
1165
  * Optional list of
4157
1166
  * [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
@@ -4181,6 +1190,10 @@ export interface ContractEditParams {
4181
1190
  * IDs of overrides to remove
4182
1191
  */
4183
1192
  remove_overrides?: Array<ContractEditParams.RemoveOverride>;
1193
+ /**
1194
+ * Optional uniqueness key to prevent duplicate contract edits.
1195
+ */
1196
+ uniqueness_key?: string;
4184
1197
  update_commits?: Array<ContractEditParams.UpdateCommit>;
4185
1198
  /**
4186
1199
  * RFC 3339 timestamp indicating when the contract will end (exclusive).
@@ -4238,6 +1251,9 @@ export declare namespace ContractEditParams {
4238
1251
  * all products.
4239
1252
  */
4240
1253
  applicable_product_tags?: Array<string>;
1254
+ /**
1255
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1256
+ */
4241
1257
  custom_fields?: {
4242
1258
  [key: string]: string;
4243
1259
  };
@@ -4248,7 +1264,7 @@ export declare namespace ContractEditParams {
4248
1264
  /**
4249
1265
  * Optional configuration for commit hierarchy access control
4250
1266
  */
4251
- hierarchy_configuration?: AddCommit.HierarchyConfiguration;
1267
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
4252
1268
  /**
4253
1269
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
4254
1270
  * time and only one schedule item is allowed; the total must match access_schedule
@@ -4286,7 +1302,7 @@ export declare namespace ContractEditParams {
4286
1302
  * Instead, to target usage by product or product tag, pass those values in the
4287
1303
  * body of `specifiers`.
4288
1304
  */
4289
- specifiers?: Array<AddCommit.Specifier>;
1305
+ specifiers?: Array<Shared.CommitSpecifierInput>;
4290
1306
  /**
4291
1307
  * A temporary ID for the commit that can be used to reference the commit for
4292
1308
  * commit specific overrides.
@@ -4316,24 +1332,6 @@ export declare namespace ContractEditParams {
4316
1332
  starting_at: string;
4317
1333
  }
4318
1334
  }
4319
- /**
4320
- * Optional configuration for commit hierarchy access control
4321
- */
4322
- interface HierarchyConfiguration {
4323
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
4324
- }
4325
- namespace HierarchyConfiguration {
4326
- interface CommitHierarchyChildAccessAll {
4327
- type: 'ALL';
4328
- }
4329
- interface CommitHierarchyChildAccessNone {
4330
- type: 'NONE';
4331
- }
4332
- interface CommitHierarchyChildAccessContractIDs {
4333
- contract_ids: Array<string>;
4334
- type: 'CONTRACT_IDS';
4335
- }
4336
- }
4337
1335
  /**
4338
1336
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
4339
1337
  * time and only one schedule item is allowed; the total must match access_schedule
@@ -4345,6 +1343,11 @@ export declare namespace ContractEditParams {
4345
1343
  * Defaults to USD (cents) if not passed.
4346
1344
  */
4347
1345
  credit_type_id?: string;
1346
+ /**
1347
+ * This field is only applicable to commit invoice schedules. If true, this
1348
+ * schedule will not generate an invoice.
1349
+ */
1350
+ do_not_invoice?: boolean;
4348
1351
  /**
4349
1352
  * Enter the unit price and quantity for the charge or instead only send the
4350
1353
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -4474,25 +1477,19 @@ export declare namespace ContractEditParams {
4474
1477
  invoice_metadata?: {
4475
1478
  [key: string]: string;
4476
1479
  };
1480
+ /**
1481
+ * If true, the payment will be made assuming the customer is present (i.e. on
1482
+ * session).
1483
+ *
1484
+ * If false, the payment will be made assuming the customer is not present (i.e.
1485
+ * off session). For cardholders from a country with an e-mandate requirement (e.g.
1486
+ * India), the payment may be declined.
1487
+ *
1488
+ * If left blank, will default to false.
1489
+ */
1490
+ on_session_payment?: boolean;
4477
1491
  }
4478
1492
  }
4479
- interface Specifier {
4480
- presentation_group_values?: {
4481
- [key: string]: string;
4482
- };
4483
- pricing_group_values?: {
4484
- [key: string]: string;
4485
- };
4486
- /**
4487
- * If provided, the specifier will only apply to the product with the specified ID.
4488
- */
4489
- product_id?: string;
4490
- /**
4491
- * If provided, the specifier will only apply to products with all the specified
4492
- * tags.
4493
- */
4494
- product_tags?: Array<string>;
4495
- }
4496
1493
  }
4497
1494
  interface AddCredit {
4498
1495
  /**
@@ -4510,6 +1507,9 @@ export declare namespace ContractEditParams {
4510
1507
  * applicable_product_tags are not provided, the credit applies to all products.
4511
1508
  */
4512
1509
  applicable_product_tags?: Array<string>;
1510
+ /**
1511
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1512
+ */
4513
1513
  custom_fields?: {
4514
1514
  [key: string]: string;
4515
1515
  };
@@ -4520,7 +1520,7 @@ export declare namespace ContractEditParams {
4520
1520
  /**
4521
1521
  * Optional configuration for credit hierarchy access control
4522
1522
  */
4523
- hierarchy_configuration?: AddCredit.HierarchyConfiguration;
1523
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
4524
1524
  /**
4525
1525
  * displayed on invoices
4526
1526
  */
@@ -4543,7 +1543,7 @@ export declare namespace ContractEditParams {
4543
1543
  * Instead, to target usage by product or product tag, pass those values in the
4544
1544
  * body of `specifiers`.
4545
1545
  */
4546
- specifiers?: Array<AddCredit.Specifier>;
1546
+ specifiers?: Array<Shared.CommitSpecifierInput>;
4547
1547
  }
4548
1548
  namespace AddCredit {
4549
1549
  /**
@@ -4566,41 +1566,6 @@ export declare namespace ContractEditParams {
4566
1566
  starting_at: string;
4567
1567
  }
4568
1568
  }
4569
- /**
4570
- * Optional configuration for credit hierarchy access control
4571
- */
4572
- interface HierarchyConfiguration {
4573
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
4574
- }
4575
- namespace HierarchyConfiguration {
4576
- interface CommitHierarchyChildAccessAll {
4577
- type: 'ALL';
4578
- }
4579
- interface CommitHierarchyChildAccessNone {
4580
- type: 'NONE';
4581
- }
4582
- interface CommitHierarchyChildAccessContractIDs {
4583
- contract_ids: Array<string>;
4584
- type: 'CONTRACT_IDS';
4585
- }
4586
- }
4587
- interface Specifier {
4588
- presentation_group_values?: {
4589
- [key: string]: string;
4590
- };
4591
- pricing_group_values?: {
4592
- [key: string]: string;
4593
- };
4594
- /**
4595
- * If provided, the specifier will only apply to the product with the specified ID.
4596
- */
4597
- product_id?: string;
4598
- /**
4599
- * If provided, the specifier will only apply to products with all the specified
4600
- * tags.
4601
- */
4602
- product_tags?: Array<string>;
4603
- }
4604
1569
  }
4605
1570
  interface AddDiscount {
4606
1571
  product_id: string;
@@ -4608,6 +1573,9 @@ export declare namespace ContractEditParams {
4608
1573
  * Must provide either schedule_items or recurring_schedule.
4609
1574
  */
4610
1575
  schedule: AddDiscount.Schedule;
1576
+ /**
1577
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1578
+ */
4611
1579
  custom_fields?: {
4612
1580
  [key: string]: string;
4613
1581
  };
@@ -4629,6 +1597,11 @@ export declare namespace ContractEditParams {
4629
1597
  * Defaults to USD (cents) if not passed.
4630
1598
  */
4631
1599
  credit_type_id?: string;
1600
+ /**
1601
+ * This field is only applicable to commit invoice schedules. If true, this
1602
+ * schedule will not generate an invoice.
1603
+ */
1604
+ do_not_invoice?: boolean;
4632
1605
  /**
4633
1606
  * Enter the unit price and quantity for the charge or instead only send the
4634
1607
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -4793,192 +1766,57 @@ export declare namespace ContractEditParams {
4793
1766
  * If provided, the override will only apply to products with all the specified
4794
1767
  * tags.
4795
1768
  */
4796
- product_tags?: Array<string>;
4797
- /**
4798
- * Can only be used for commit specific overrides. Must be used in conjunction with
4799
- * one of product_id, product_tags, pricing_group_values, or
4800
- * presentation_group_values. If provided, the override will only apply to commits
4801
- * created by the specified recurring commit ids.
4802
- */
4803
- recurring_commit_ids?: Array<string>;
4804
- /**
4805
- * Can only be used for commit specific overrides. Must be used in conjunction with
4806
- * one of product_id, product_tags, pricing_group_values, or
4807
- * presentation_group_values. If provided, the override will only apply to commits
4808
- * created by the specified recurring credit ids.
4809
- */
4810
- recurring_credit_ids?: Array<string>;
4811
- }
4812
- /**
4813
- * Required for OVERWRITE type.
4814
- */
4815
- interface OverwriteRate {
4816
- rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
4817
- credit_type_id?: string;
4818
- /**
4819
- * Only set for CUSTOM rate_type. This field is interpreted by custom rate
4820
- * processors.
4821
- */
4822
- custom_rate?: {
4823
- [key: string]: unknown;
4824
- };
4825
- /**
4826
- * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
4827
- * set to true.
4828
- */
4829
- is_prorated?: boolean;
4830
- /**
4831
- * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
4832
- * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
4833
- */
4834
- price?: number;
4835
- /**
4836
- * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
4837
- */
4838
- quantity?: number;
4839
- /**
4840
- * Only set for TIERED rate_type.
4841
- */
4842
- tiers?: Array<Shared.Tier>;
4843
- }
4844
- interface Tier {
4845
- multiplier: number;
4846
- size?: number;
4847
- }
4848
- }
4849
- interface AddPrepaidBalanceThresholdConfiguration {
4850
- commit: AddPrepaidBalanceThresholdConfiguration.Commit;
4851
- /**
4852
- * When set to false, the contract will not be evaluated against the
4853
- * threshold_amount. Toggling to true will result an immediate evaluation,
4854
- * regardless of prior state.
4855
- */
4856
- is_enabled: boolean;
4857
- payment_gate_config: AddPrepaidBalanceThresholdConfiguration.PaymentGateConfig;
4858
- /**
4859
- * Specify the amount the balance should be recharged to.
4860
- */
4861
- recharge_to_amount: number;
4862
- /**
4863
- * Specify the threshold amount for the contract. Each time the contract's balance
4864
- * lowers to this amount, a threshold charge will be initiated.
4865
- */
4866
- threshold_amount: number;
4867
- /**
4868
- * If provided, the threshold, recharge-to amount, and the resulting threshold
4869
- * commit amount will be in terms of this credit type instead of the fiat currency.
4870
- */
4871
- custom_credit_type_id?: string;
4872
- }
4873
- namespace AddPrepaidBalanceThresholdConfiguration {
4874
- interface Commit {
4875
- /**
4876
- * The commit product that will be used to generate the line item for commit
4877
- * payment.
4878
- */
4879
- product_id: string;
4880
- /**
4881
- * Which products the threshold commit applies to. If applicable_product_ids,
4882
- * applicable_product_tags or specifiers are not provided, the commit applies to
4883
- * all products.
4884
- */
4885
- applicable_product_ids?: Array<string>;
4886
- /**
4887
- * Which tags the threshold commit applies to. If applicable_product_ids,
4888
- * applicable_product_tags or specifiers are not provided, the commit applies to
4889
- * all products.
4890
- */
4891
- applicable_product_tags?: Array<string>;
4892
- description?: string;
4893
- /**
4894
- * Specify the name of the line item for the threshold charge. If left blank, it
4895
- * will default to the commit product name.
4896
- */
4897
- name?: string;
1769
+ product_tags?: Array<string>;
4898
1770
  /**
4899
- * List of filters that determine what kind of customer usage draws down a commit
4900
- * or credit. A customer's usage needs to meet the condition of at least one of the
4901
- * specifiers to contribute to a commit's or credit's drawdown. This field cannot
4902
- * be used together with `applicable_product_ids` or `applicable_product_tags`.
4903
- * Instead, to target usage by product or product tag, pass those values in the
4904
- * 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.
4905
1775
  */
4906
- specifiers?: Array<Commit.Specifier>;
4907
- }
4908
- namespace Commit {
4909
- interface Specifier {
4910
- presentation_group_values?: {
4911
- [key: string]: string;
4912
- };
4913
- pricing_group_values?: {
4914
- [key: string]: string;
4915
- };
4916
- /**
4917
- * If provided, the specifier will only apply to the product with the specified ID.
4918
- */
4919
- product_id?: string;
4920
- /**
4921
- * If provided, the specifier will only apply to products with all the specified
4922
- * tags.
4923
- */
4924
- product_tags?: Array<string>;
4925
- }
4926
- }
4927
- interface PaymentGateConfig {
1776
+ recurring_commit_ids?: Array<string>;
4928
1777
  /**
4929
- * Gate access to the commit balance based on successful collection of payment.
4930
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
4931
- * facilitate payment using your own payment integration. Select NONE if you do not
4932
- * 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.
4933
1782
  */
4934
- 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;
4935
1791
  /**
4936
- * 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.
4937
1794
  */
4938
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1795
+ custom_rate?: {
1796
+ [key: string]: unknown;
1797
+ };
4939
1798
  /**
4940
- * 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.
4941
1801
  */
4942
- stripe_config?: PaymentGateConfig.StripeConfig;
1802
+ is_prorated?: boolean;
4943
1803
  /**
4944
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
4945
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
4946
- * 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.
4947
1806
  */
4948
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
4949
- }
4950
- namespace PaymentGateConfig {
1807
+ price?: number;
4951
1808
  /**
4952
- * Only applicable if using PRECALCULATED as your tax type.
1809
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
4953
1810
  */
4954
- interface PrecalculatedTaxConfig {
4955
- /**
4956
- * Amount of tax to be applied. This should be in the same currency and
4957
- * denomination as the commit's invoice schedule
4958
- */
4959
- tax_amount: number;
4960
- /**
4961
- * Name of the tax to be applied. This may be used in an invoice line item
4962
- * description.
4963
- */
4964
- tax_name?: string;
4965
- }
1811
+ quantity?: number;
4966
1812
  /**
4967
- * Only applicable if using STRIPE as your payment gateway type.
1813
+ * Only set for TIERED rate_type.
4968
1814
  */
4969
- interface StripeConfig {
4970
- /**
4971
- * If left blank, will default to INVOICE
4972
- */
4973
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
4974
- /**
4975
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
4976
- * your payment type.
4977
- */
4978
- invoice_metadata?: {
4979
- [key: string]: string;
4980
- };
4981
- }
1815
+ tiers?: Array<Shared.Tier>;
1816
+ }
1817
+ interface Tier {
1818
+ multiplier: number;
1819
+ size?: number;
4982
1820
  }
4983
1821
  }
4984
1822
  interface AddProfessionalService {
@@ -4997,6 +1835,9 @@ export declare namespace ContractEditParams {
4997
1835
  * amount and must be specified.
4998
1836
  */
4999
1837
  unit_price: number;
1838
+ /**
1839
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1840
+ */
5000
1841
  custom_fields?: {
5001
1842
  [key: string]: string;
5002
1843
  };
@@ -5045,7 +1886,7 @@ export declare namespace ContractEditParams {
5045
1886
  /**
5046
1887
  * Optional configuration for recurring credit hierarchy access control
5047
1888
  */
5048
- hierarchy_configuration?: AddRecurringCommit.HierarchyConfiguration;
1889
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
5049
1890
  /**
5050
1891
  * The amount the customer should be billed for the commit. Not required.
5051
1892
  */
@@ -5089,7 +1930,7 @@ export declare namespace ContractEditParams {
5089
1930
  * Instead, to target usage by product or product tag, pass those values in the
5090
1931
  * body of `specifiers`.
5091
1932
  */
5092
- specifiers?: Array<AddRecurringCommit.Specifier>;
1933
+ specifiers?: Array<Shared.CommitSpecifierInput>;
5093
1934
  /**
5094
1935
  * Attach a subscription to the recurring commit/credit.
5095
1936
  */
@@ -5108,8 +1949,8 @@ export declare namespace ContractEditParams {
5108
1949
  credit_type_id: string;
5109
1950
  unit_price: number;
5110
1951
  /**
5111
- * This field is currently required. Upcoming recurring commit/credit configuration
5112
- * options will allow it to be optional.
1952
+ * This field is required unless a subscription is attached via
1953
+ * `subscription_config`.
5113
1954
  */
5114
1955
  quantity?: number;
5115
1956
  }
@@ -5122,24 +1963,6 @@ export declare namespace ContractEditParams {
5122
1963
  value: number;
5123
1964
  unit?: 'PERIODS';
5124
1965
  }
5125
- /**
5126
- * Optional configuration for recurring credit hierarchy access control
5127
- */
5128
- interface HierarchyConfiguration {
5129
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
5130
- }
5131
- namespace HierarchyConfiguration {
5132
- interface CommitHierarchyChildAccessAll {
5133
- type: 'ALL';
5134
- }
5135
- interface CommitHierarchyChildAccessNone {
5136
- type: 'NONE';
5137
- }
5138
- interface CommitHierarchyChildAccessContractIDs {
5139
- contract_ids: Array<string>;
5140
- type: 'CONTRACT_IDS';
5141
- }
5142
- }
5143
1966
  /**
5144
1967
  * The amount the customer should be billed for the commit. Not required.
5145
1968
  */
@@ -5148,23 +1971,6 @@ export declare namespace ContractEditParams {
5148
1971
  quantity: number;
5149
1972
  unit_price: number;
5150
1973
  }
5151
- interface Specifier {
5152
- presentation_group_values?: {
5153
- [key: string]: string;
5154
- };
5155
- pricing_group_values?: {
5156
- [key: string]: string;
5157
- };
5158
- /**
5159
- * If provided, the specifier will only apply to the product with the specified ID.
5160
- */
5161
- product_id?: string;
5162
- /**
5163
- * If provided, the specifier will only apply to products with all the specified
5164
- * tags.
5165
- */
5166
- product_tags?: Array<string>;
5167
- }
5168
1974
  /**
5169
1975
  * Attach a subscription to the recurring commit/credit.
5170
1976
  */
@@ -5177,7 +1983,7 @@ export declare namespace ContractEditParams {
5177
1983
  /**
5178
1984
  * If set to POOLED, allocation added per seat is pooled across the account.
5179
1985
  */
5180
- allocation?: 'POOLED';
1986
+ allocation?: 'POOLED' | 'INDIVIDUAL';
5181
1987
  }
5182
1988
  namespace SubscriptionConfig {
5183
1989
  interface ApplySeatIncreaseConfig {
@@ -5227,7 +2033,7 @@ export declare namespace ContractEditParams {
5227
2033
  /**
5228
2034
  * Optional configuration for recurring credit hierarchy access control
5229
2035
  */
5230
- hierarchy_configuration?: AddRecurringCredit.HierarchyConfiguration;
2036
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
5231
2037
  /**
5232
2038
  * displayed on invoices. will be passed through to the individual commits
5233
2039
  */
@@ -5267,7 +2073,7 @@ export declare namespace ContractEditParams {
5267
2073
  * Instead, to target usage by product or product tag, pass those values in the
5268
2074
  * body of `specifiers`.
5269
2075
  */
5270
- specifiers?: Array<AddRecurringCredit.Specifier>;
2076
+ specifiers?: Array<Shared.CommitSpecifierInput>;
5271
2077
  /**
5272
2078
  * Attach a subscription to the recurring commit/credit.
5273
2079
  */
@@ -5286,8 +2092,8 @@ export declare namespace ContractEditParams {
5286
2092
  credit_type_id: string;
5287
2093
  unit_price: number;
5288
2094
  /**
5289
- * This field is currently required. Upcoming recurring commit/credit configuration
5290
- * options will allow it to be optional.
2095
+ * This field is required unless a subscription is attached via
2096
+ * `subscription_config`.
5291
2097
  */
5292
2098
  quantity?: number;
5293
2099
  }
@@ -5300,41 +2106,6 @@ export declare namespace ContractEditParams {
5300
2106
  value: number;
5301
2107
  unit?: 'PERIODS';
5302
2108
  }
5303
- /**
5304
- * Optional configuration for recurring credit hierarchy access control
5305
- */
5306
- interface HierarchyConfiguration {
5307
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
5308
- }
5309
- namespace HierarchyConfiguration {
5310
- interface CommitHierarchyChildAccessAll {
5311
- type: 'ALL';
5312
- }
5313
- interface CommitHierarchyChildAccessNone {
5314
- type: 'NONE';
5315
- }
5316
- interface CommitHierarchyChildAccessContractIDs {
5317
- contract_ids: Array<string>;
5318
- type: 'CONTRACT_IDS';
5319
- }
5320
- }
5321
- interface Specifier {
5322
- presentation_group_values?: {
5323
- [key: string]: string;
5324
- };
5325
- pricing_group_values?: {
5326
- [key: string]: string;
5327
- };
5328
- /**
5329
- * If provided, the specifier will only apply to the product with the specified ID.
5330
- */
5331
- product_id?: string;
5332
- /**
5333
- * If provided, the specifier will only apply to products with all the specified
5334
- * tags.
5335
- */
5336
- product_tags?: Array<string>;
5337
- }
5338
2109
  /**
5339
2110
  * Attach a subscription to the recurring commit/credit.
5340
2111
  */
@@ -5347,7 +2118,7 @@ export declare namespace ContractEditParams {
5347
2118
  /**
5348
2119
  * If set to POOLED, allocation added per seat is pooled across the account.
5349
2120
  */
5350
- allocation?: 'POOLED';
2121
+ allocation?: 'POOLED' | 'INDIVIDUAL';
5351
2122
  }
5352
2123
  namespace SubscriptionConfig {
5353
2124
  interface ApplySeatIncreaseConfig {
@@ -5396,6 +2167,12 @@ export declare namespace ContractEditParams {
5396
2167
  * Must provide either schedule_items or recurring_schedule.
5397
2168
  */
5398
2169
  schedule: AddScheduledCharge.Schedule;
2170
+ /**
2171
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2172
+ */
2173
+ custom_fields?: {
2174
+ [key: string]: string;
2175
+ };
5399
2176
  /**
5400
2177
  * displayed on invoices
5401
2178
  */
@@ -5414,6 +2191,11 @@ export declare namespace ContractEditParams {
5414
2191
  * Defaults to USD (cents) if not passed.
5415
2192
  */
5416
2193
  credit_type_id?: string;
2194
+ /**
2195
+ * This field is only applicable to commit invoice schedules. If true, this
2196
+ * schedule will not generate an invoice.
2197
+ */
2198
+ do_not_invoice?: boolean;
5417
2199
  /**
5418
2200
  * Enter the unit price and quantity for the charge or instead only send the
5419
2201
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -5432,152 +2214,68 @@ export declare namespace ContractEditParams {
5432
2214
  * quantity is inferred to be 1.
5433
2215
  */
5434
2216
  interface RecurringSchedule {
5435
- amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
5436
- /**
5437
- * RFC 3339 timestamp (exclusive).
5438
- */
5439
- ending_before: string;
5440
- frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY';
5441
- /**
5442
- * RFC 3339 timestamp (inclusive).
5443
- */
5444
- starting_at: string;
5445
- /**
5446
- * Amount for the charge. Can be provided instead of unit_price and quantity. If
5447
- * amount is sent, the unit_price is assumed to be the amount and quantity is
5448
- * inferred to be 1.
5449
- */
5450
- amount?: number;
5451
- /**
5452
- * Quantity for the charge. Will be multiplied by unit_price to determine the
5453
- * amount and must be specified with unit_price. If specified amount cannot be
5454
- * provided.
5455
- */
5456
- quantity?: number;
5457
- /**
5458
- * Unit price for the charge. Will be multiplied by quantity to determine the
5459
- * amount and must be specified with quantity. If specified amount cannot be
5460
- * provided.
5461
- */
5462
- unit_price?: number;
5463
- }
5464
- interface ScheduleItem {
5465
- /**
5466
- * timestamp of the scheduled event
5467
- */
5468
- timestamp: string;
5469
- /**
5470
- * Amount for the charge. Can be provided instead of unit_price and quantity. If
5471
- * amount is sent, the unit_price is assumed to be the amount and quantity is
5472
- * inferred to be 1.
5473
- */
5474
- amount?: number;
5475
- /**
5476
- * Quantity for the charge. Will be multiplied by unit_price to determine the
5477
- * amount and must be specified with unit_price. If specified amount cannot be
5478
- * provided.
5479
- */
5480
- quantity?: number;
5481
- /**
5482
- * Unit price for the charge. Will be multiplied by quantity to determine the
5483
- * amount and must be specified with quantity. If specified amount cannot be
5484
- * provided.
5485
- */
5486
- unit_price?: number;
5487
- }
5488
- }
5489
- }
5490
- interface AddSpendThresholdConfiguration {
5491
- commit: AddSpendThresholdConfiguration.Commit;
5492
- /**
5493
- * When set to false, the contract will not be evaluated against the
5494
- * threshold_amount. Toggling to true will result an immediate evaluation,
5495
- * regardless of prior state.
5496
- */
5497
- is_enabled: boolean;
5498
- payment_gate_config: AddSpendThresholdConfiguration.PaymentGateConfig;
5499
- /**
5500
- * Specify the threshold amount for the contract. Each time the contract's usage
5501
- * hits this amount, a threshold charge will be initiated.
5502
- */
5503
- threshold_amount: number;
5504
- }
5505
- namespace AddSpendThresholdConfiguration {
5506
- interface Commit {
5507
- /**
5508
- * The commit product that will be used to generate the line item for commit
5509
- * payment.
5510
- */
5511
- product_id: string;
5512
- description?: string;
5513
- /**
5514
- * Specify the name of the line item for the threshold charge. If left blank, it
5515
- * will default to the commit product name.
5516
- */
5517
- name?: string;
5518
- }
5519
- interface PaymentGateConfig {
5520
- /**
5521
- * Gate access to the commit balance based on successful collection of payment.
5522
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
5523
- * facilitate payment using your own payment integration. Select NONE if you do not
5524
- * wish to payment gate the commit balance.
5525
- */
5526
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
5527
- /**
5528
- * Only applicable if using PRECALCULATED as your tax type.
5529
- */
5530
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
5531
- /**
5532
- * Only applicable if using STRIPE as your payment gateway type.
5533
- */
5534
- stripe_config?: PaymentGateConfig.StripeConfig;
5535
- /**
5536
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
5537
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
5538
- * will default to NONE.
5539
- */
5540
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
5541
- }
5542
- namespace PaymentGateConfig {
5543
- /**
5544
- * Only applicable if using PRECALCULATED as your tax type.
5545
- */
5546
- interface PrecalculatedTaxConfig {
2217
+ amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
5547
2218
  /**
5548
- * Amount of tax to be applied. This should be in the same currency and
5549
- * denomination as the commit's invoice schedule
2219
+ * RFC 3339 timestamp (exclusive).
5550
2220
  */
5551
- tax_amount: number;
2221
+ ending_before: string;
2222
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY';
5552
2223
  /**
5553
- * Name of the tax to be applied. This may be used in an invoice line item
5554
- * description.
2224
+ * RFC 3339 timestamp (inclusive).
5555
2225
  */
5556
- 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;
5557
2245
  }
5558
- /**
5559
- * Only applicable if using STRIPE as your payment gateway type.
5560
- */
5561
- interface StripeConfig {
2246
+ interface ScheduleItem {
5562
2247
  /**
5563
- * If left blank, will default to INVOICE
2248
+ * timestamp of the scheduled event
5564
2249
  */
5565
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
2250
+ timestamp: string;
5566
2251
  /**
5567
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
5568
- * 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.
5569
2255
  */
5570
- invoice_metadata?: {
5571
- [key: string]: string;
5572
- };
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;
5573
2269
  }
5574
2270
  }
5575
2271
  }
5576
2272
  interface AddSubscription {
5577
2273
  collection_schedule: 'ADVANCE' | 'ARREARS';
5578
- initial_quantity: number;
5579
2274
  proration: AddSubscription.Proration;
5580
2275
  subscription_rate: AddSubscription.SubscriptionRate;
2276
+ /**
2277
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2278
+ */
5581
2279
  custom_fields?: {
5582
2280
  [key: string]: string;
5583
2281
  };
@@ -5587,7 +2285,19 @@ export declare namespace ContractEditParams {
5587
2285
  * contract end date.
5588
2286
  */
5589
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;
5590
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';
5591
2301
  /**
5592
2302
  * Inclusive start time for the subscription. If not provided, defaults to contract
5593
2303
  * start date
@@ -5656,10 +2366,17 @@ export declare namespace ContractEditParams {
5656
2366
  /**
5657
2367
  * Optional configuration for commit hierarchy access control
5658
2368
  */
5659
- hierarchy_configuration?: UpdateCommit.HierarchyConfiguration;
2369
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
5660
2370
  invoice_schedule?: UpdateCommit.InvoiceSchedule;
5661
2371
  netsuite_sales_order_id?: string | null;
2372
+ priority?: number | null;
5662
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';
5663
2380
  rollover_fraction?: number | null;
5664
2381
  }
5665
2382
  namespace UpdateCommit {
@@ -5684,24 +2401,6 @@ export declare namespace ContractEditParams {
5684
2401
  starting_at?: string;
5685
2402
  }
5686
2403
  }
5687
- /**
5688
- * Optional configuration for commit hierarchy access control
5689
- */
5690
- interface HierarchyConfiguration {
5691
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
5692
- }
5693
- namespace HierarchyConfiguration {
5694
- interface CommitHierarchyChildAccessAll {
5695
- type: 'ALL';
5696
- }
5697
- interface CommitHierarchyChildAccessNone {
5698
- type: 'NONE';
5699
- }
5700
- interface CommitHierarchyChildAccessContractIDs {
5701
- contract_ids: Array<string>;
5702
- type: 'CONTRACT_IDS';
5703
- }
5704
- }
5705
2404
  interface InvoiceSchedule {
5706
2405
  add_schedule_items?: Array<InvoiceSchedule.AddScheduleItem>;
5707
2406
  remove_schedule_items?: Array<InvoiceSchedule.RemoveScheduleItem>;
@@ -5744,9 +2443,16 @@ export declare namespace ContractEditParams {
5744
2443
  /**
5745
2444
  * Optional configuration for commit hierarchy access control
5746
2445
  */
5747
- hierarchy_configuration?: UpdateCredit.HierarchyConfiguration;
2446
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
5748
2447
  netsuite_sales_order_id?: string | null;
2448
+ priority?: number | null;
5749
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';
5750
2456
  }
5751
2457
  namespace UpdateCredit {
5752
2458
  interface AccessSchedule {
@@ -5770,24 +2476,6 @@ export declare namespace ContractEditParams {
5770
2476
  starting_at?: string;
5771
2477
  }
5772
2478
  }
5773
- /**
5774
- * Optional configuration for commit hierarchy access control
5775
- */
5776
- interface HierarchyConfiguration {
5777
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
5778
- }
5779
- namespace HierarchyConfiguration {
5780
- interface CommitHierarchyChildAccessAll {
5781
- type: 'ALL';
5782
- }
5783
- interface CommitHierarchyChildAccessNone {
5784
- type: 'NONE';
5785
- }
5786
- interface CommitHierarchyChildAccessContractIDs {
5787
- contract_ids: Array<string>;
5788
- type: 'CONTRACT_IDS';
5789
- }
5790
- }
5791
2479
  }
5792
2480
  interface UpdatePrepaidBalanceThresholdConfiguration {
5793
2481
  commit?: UpdatePrepaidBalanceThresholdConfiguration.Commit;
@@ -5802,7 +2490,7 @@ export declare namespace ContractEditParams {
5802
2490
  * regardless of prior state.
5803
2491
  */
5804
2492
  is_enabled?: boolean;
5805
- payment_gate_config?: UpdatePrepaidBalanceThresholdConfiguration.PaymentGateConfig;
2493
+ payment_gate_config?: Shared.PaymentGateConfigV2;
5806
2494
  /**
5807
2495
  * Specify the amount the balance should be recharged to.
5808
2496
  */
@@ -5814,7 +2502,7 @@ export declare namespace ContractEditParams {
5814
2502
  threshold_amount?: number;
5815
2503
  }
5816
2504
  namespace UpdatePrepaidBalanceThresholdConfiguration {
5817
- interface Commit {
2505
+ interface Commit extends Shared.UpdateBaseThresholdCommit {
5818
2506
  /**
5819
2507
  * Which products the threshold commit applies to. If both applicable_product_ids
5820
2508
  * and applicable_product_tags are not provided, the commit applies to all
@@ -5826,17 +2514,6 @@ export declare namespace ContractEditParams {
5826
2514
  * applicable_product_tags are not provided, the commit applies to all products.
5827
2515
  */
5828
2516
  applicable_product_tags?: Array<string> | null;
5829
- description?: string;
5830
- /**
5831
- * Specify the name of the line item for the threshold charge. If left blank, it
5832
- * will default to the commit product name.
5833
- */
5834
- name?: string;
5835
- /**
5836
- * The commit product that will be used to generate the line item for commit
5837
- * payment.
5838
- */
5839
- product_id?: string;
5840
2517
  /**
5841
2518
  * List of filters that determine what kind of customer usage draws down a commit
5842
2519
  * or credit. A customer's usage needs to meet the condition of at least one of the
@@ -5845,82 +2522,7 @@ export declare namespace ContractEditParams {
5845
2522
  * Instead, to target usage by product or product tag, pass those values in the
5846
2523
  * body of `specifiers`.
5847
2524
  */
5848
- specifiers?: Array<Commit.Specifier> | null;
5849
- }
5850
- namespace Commit {
5851
- interface Specifier {
5852
- presentation_group_values?: {
5853
- [key: string]: string;
5854
- };
5855
- pricing_group_values?: {
5856
- [key: string]: string;
5857
- };
5858
- /**
5859
- * If provided, the specifier will only apply to the product with the specified ID.
5860
- */
5861
- product_id?: string;
5862
- /**
5863
- * If provided, the specifier will only apply to products with all the specified
5864
- * tags.
5865
- */
5866
- product_tags?: Array<string>;
5867
- }
5868
- }
5869
- interface PaymentGateConfig {
5870
- /**
5871
- * Gate access to the commit balance based on successful collection of payment.
5872
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
5873
- * facilitate payment using your own payment integration. Select NONE if you do not
5874
- * wish to payment gate the commit balance.
5875
- */
5876
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
5877
- /**
5878
- * Only applicable if using PRECALCULATED as your tax type.
5879
- */
5880
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
5881
- /**
5882
- * Only applicable if using STRIPE as your payment gateway type.
5883
- */
5884
- stripe_config?: PaymentGateConfig.StripeConfig;
5885
- /**
5886
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
5887
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
5888
- * will default to NONE.
5889
- */
5890
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
5891
- }
5892
- namespace PaymentGateConfig {
5893
- /**
5894
- * Only applicable if using PRECALCULATED as your tax type.
5895
- */
5896
- interface PrecalculatedTaxConfig {
5897
- /**
5898
- * Amount of tax to be applied. This should be in the same currency and
5899
- * denomination as the commit's invoice schedule
5900
- */
5901
- tax_amount: number;
5902
- /**
5903
- * Name of the tax to be applied. This may be used in an invoice line item
5904
- * description.
5905
- */
5906
- tax_name?: string;
5907
- }
5908
- /**
5909
- * Only applicable if using STRIPE as your payment gateway type.
5910
- */
5911
- interface StripeConfig {
5912
- /**
5913
- * If left blank, will default to INVOICE
5914
- */
5915
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
5916
- /**
5917
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
5918
- * your payment type.
5919
- */
5920
- invoice_metadata?: {
5921
- [key: string]: string;
5922
- };
5923
- }
2525
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
5924
2526
  }
5925
2527
  }
5926
2528
  interface UpdateRecurringCommit {
@@ -5981,91 +2583,20 @@ export declare namespace ContractEditParams {
5981
2583
  }
5982
2584
  }
5983
2585
  interface UpdateSpendThresholdConfiguration {
5984
- commit?: UpdateSpendThresholdConfiguration.Commit;
2586
+ commit?: Shared.UpdateBaseThresholdCommit;
5985
2587
  /**
5986
2588
  * When set to false, the contract will not be evaluated against the
5987
2589
  * threshold_amount. Toggling to true will result an immediate evaluation,
5988
2590
  * regardless of prior state.
5989
2591
  */
5990
2592
  is_enabled?: boolean;
5991
- payment_gate_config?: UpdateSpendThresholdConfiguration.PaymentGateConfig;
2593
+ payment_gate_config?: Shared.PaymentGateConfigV2;
5992
2594
  /**
5993
2595
  * Specify the threshold amount for the contract. Each time the contract's usage
5994
2596
  * hits this amount, a threshold charge will be initiated.
5995
2597
  */
5996
2598
  threshold_amount?: number;
5997
2599
  }
5998
- namespace UpdateSpendThresholdConfiguration {
5999
- interface Commit {
6000
- description?: string;
6001
- /**
6002
- * Specify the name of the line item for the threshold charge. If left blank, it
6003
- * will default to the commit product name.
6004
- */
6005
- name?: string;
6006
- /**
6007
- * The commit product that will be used to generate the line item for commit
6008
- * payment.
6009
- */
6010
- product_id?: string;
6011
- }
6012
- interface PaymentGateConfig {
6013
- /**
6014
- * Gate access to the commit balance based on successful collection of payment.
6015
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
6016
- * facilitate payment using your own payment integration. Select NONE if you do not
6017
- * wish to payment gate the commit balance.
6018
- */
6019
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
6020
- /**
6021
- * Only applicable if using PRECALCULATED as your tax type.
6022
- */
6023
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
6024
- /**
6025
- * Only applicable if using STRIPE as your payment gateway type.
6026
- */
6027
- stripe_config?: PaymentGateConfig.StripeConfig;
6028
- /**
6029
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
6030
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
6031
- * will default to NONE.
6032
- */
6033
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
6034
- }
6035
- namespace PaymentGateConfig {
6036
- /**
6037
- * Only applicable if using PRECALCULATED as your tax type.
6038
- */
6039
- interface PrecalculatedTaxConfig {
6040
- /**
6041
- * Amount of tax to be applied. This should be in the same currency and
6042
- * denomination as the commit's invoice schedule
6043
- */
6044
- tax_amount: number;
6045
- /**
6046
- * Name of the tax to be applied. This may be used in an invoice line item
6047
- * description.
6048
- */
6049
- tax_name?: string;
6050
- }
6051
- /**
6052
- * Only applicable if using STRIPE as your payment gateway type.
6053
- */
6054
- interface StripeConfig {
6055
- /**
6056
- * If left blank, will default to INVOICE
6057
- */
6058
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
6059
- /**
6060
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
6061
- * your payment type.
6062
- */
6063
- invoice_metadata?: {
6064
- [key: string]: string;
6065
- };
6066
- }
6067
- }
6068
- }
6069
2600
  interface UpdateSubscription {
6070
2601
  subscription_id: string;
6071
2602
  ending_before?: string | null;
@@ -6120,7 +2651,18 @@ export interface ContractEditCommitParams {
6120
2651
  */
6121
2652
  invoice_contract_id?: string;
6122
2653
  invoice_schedule?: ContractEditCommitParams.InvoiceSchedule;
2654
+ /**
2655
+ * If multiple commits are applicable, the one with the lower priority will apply
2656
+ * first.
2657
+ */
2658
+ priority?: number | null;
6123
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';
6124
2666
  /**
6125
2667
  * List of filters that determine what kind of customer usage draws down a commit
6126
2668
  * or credit. A customer's usage needs to meet the condition of at least one of the
@@ -6129,7 +2671,7 @@ export interface ContractEditCommitParams {
6129
2671
  * Instead, to target usage by product or product tag, pass those values in the
6130
2672
  * body of `specifiers`.
6131
2673
  */
6132
- specifiers?: Array<ContractEditCommitParams.Specifier> | null;
2674
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
6133
2675
  }
6134
2676
  export declare namespace ContractEditCommitParams {
6135
2677
  interface AccessSchedule {
@@ -6176,23 +2718,6 @@ export declare namespace ContractEditCommitParams {
6176
2718
  unit_price?: number;
6177
2719
  }
6178
2720
  }
6179
- interface Specifier {
6180
- presentation_group_values?: {
6181
- [key: string]: string;
6182
- };
6183
- pricing_group_values?: {
6184
- [key: string]: string;
6185
- };
6186
- /**
6187
- * If provided, the specifier will only apply to the product with the specified ID.
6188
- */
6189
- product_id?: string;
6190
- /**
6191
- * If provided, the specifier will only apply to products with all the specified
6192
- * tags.
6193
- */
6194
- product_tags?: Array<string>;
6195
- }
6196
2721
  }
6197
2722
  export interface ContractEditCreditParams {
6198
2723
  /**
@@ -6214,7 +2739,18 @@ export interface ContractEditCreditParams {
6214
2739
  * applicable_product_tags are not provided, the credit applies to all products.
6215
2740
  */
6216
2741
  applicable_product_tags?: Array<string> | null;
2742
+ /**
2743
+ * If multiple commits are applicable, the one with the lower priority will apply
2744
+ * first.
2745
+ */
2746
+ priority?: number | null;
6217
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';
6218
2754
  /**
6219
2755
  * List of filters that determine what kind of customer usage draws down a commit
6220
2756
  * or credit. A customer's usage needs to meet the condition of at least one of the
@@ -6223,7 +2759,7 @@ export interface ContractEditCreditParams {
6223
2759
  * Instead, to target usage by product or product tag, pass those values in the
6224
2760
  * body of `specifiers`.
6225
2761
  */
6226
- specifiers?: Array<ContractEditCreditParams.Specifier> | null;
2762
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
6227
2763
  }
6228
2764
  export declare namespace ContractEditCreditParams {
6229
2765
  interface AccessSchedule {
@@ -6247,23 +2783,6 @@ export declare namespace ContractEditCreditParams {
6247
2783
  starting_at?: string;
6248
2784
  }
6249
2785
  }
6250
- interface Specifier {
6251
- presentation_group_values?: {
6252
- [key: string]: string;
6253
- };
6254
- pricing_group_values?: {
6255
- [key: string]: string;
6256
- };
6257
- /**
6258
- * If provided, the specifier will only apply to the product with the specified ID.
6259
- */
6260
- product_id?: string;
6261
- /**
6262
- * If provided, the specifier will only apply to products with all the specified
6263
- * tags.
6264
- */
6265
- product_tags?: Array<string>;
6266
- }
6267
2786
  }
6268
2787
  export interface ContractGetEditHistoryParams {
6269
2788
  contract_id: string;