@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,6 +1,23 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import * as Shared from "./shared.js";
3
+ import * as Shared from './shared';
4
+ import { BodyCursorPage } from '../core/pagination';
5
+
6
+ export interface BaseThresholdCommit {
7
+ /**
8
+ * The commit product that will be used to generate the line item for commit
9
+ * payment.
10
+ */
11
+ product_id: string;
12
+
13
+ description?: string;
14
+
15
+ /**
16
+ * Specify the name of the line item for the threshold charge. If left blank, it
17
+ * will default to the commit product name.
18
+ */
19
+ name?: string;
20
+ }
4
21
 
5
22
  export interface BaseUsageFilter {
6
23
  group_key: string;
@@ -13,6 +30,15 @@ export interface BaseUsageFilter {
13
30
  export interface Commit {
14
31
  id: string;
15
32
 
33
+ /**
34
+ * Timestamp of when the commit was created.
35
+ *
36
+ * - Recurring commits: latter of commit service period date and parent commit
37
+ * start date
38
+ * - Rollover commits: when the new contract started
39
+ */
40
+ created_at: string;
41
+
16
42
  product: Commit.Product;
17
43
 
18
44
  type: 'PREPAID' | 'POSTPAID';
@@ -54,6 +80,9 @@ export interface Commit {
54
80
 
55
81
  contract?: Commit.Contract;
56
82
 
83
+ /**
84
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
85
+ */
57
86
  custom_fields?: { [key: string]: string };
58
87
 
59
88
  description?: string;
@@ -61,7 +90,7 @@ export interface Commit {
61
90
  /**
62
91
  * Optional configuration for commit hierarchy access control
63
92
  */
64
- hierarchy_configuration?: Commit.HierarchyConfiguration;
93
+ hierarchy_configuration?: CommitHierarchyConfiguration;
65
94
 
66
95
  /**
67
96
  * The contract that this commit will be billed on.
@@ -123,7 +152,7 @@ export interface Commit {
123
152
  * or credit. A customer's usage needs to meet the condition of at least one of the
124
153
  * specifiers to contribute to a commit's or credit's drawdown.
125
154
  */
126
- specifiers?: Array<Commit.Specifier>;
155
+ specifiers?: Array<CommitSpecifier>;
127
156
 
128
157
  /**
129
158
  * Prevents the creation of duplicates. If a request to create a commit or credit
@@ -145,32 +174,6 @@ export namespace Commit {
145
174
  id: string;
146
175
  }
147
176
 
148
- /**
149
- * Optional configuration for commit hierarchy access control
150
- */
151
- export interface HierarchyConfiguration {
152
- child_access:
153
- | HierarchyConfiguration.CommitHierarchyChildAccessAll
154
- | HierarchyConfiguration.CommitHierarchyChildAccessNone
155
- | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
156
- }
157
-
158
- export namespace HierarchyConfiguration {
159
- export interface CommitHierarchyChildAccessAll {
160
- type: 'ALL';
161
- }
162
-
163
- export interface CommitHierarchyChildAccessNone {
164
- type: 'NONE';
165
- }
166
-
167
- export interface CommitHierarchyChildAccessContractIDs {
168
- contract_ids: Array<string>;
169
-
170
- type: 'CONTRACT_IDS';
171
- }
172
- }
173
-
174
177
  /**
175
178
  * The contract that this commit will be billed on.
176
179
  */
@@ -341,43 +344,275 @@ export namespace Commit {
341
344
 
342
345
  contract_id: string;
343
346
  }
347
+ }
348
+
349
+ export interface CommitHierarchyConfiguration {
350
+ child_access:
351
+ | CommitHierarchyConfiguration.CommitHierarchyChildAccessAll
352
+ | CommitHierarchyConfiguration.CommitHierarchyChildAccessNone
353
+ | CommitHierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
354
+ }
355
+
356
+ export namespace CommitHierarchyConfiguration {
357
+ export interface CommitHierarchyChildAccessAll {
358
+ type: 'ALL';
359
+ }
360
+
361
+ export interface CommitHierarchyChildAccessNone {
362
+ type: 'NONE';
363
+ }
344
364
 
345
- export interface Specifier {
346
- presentation_group_values?: { [key: string]: string };
365
+ export interface CommitHierarchyChildAccessContractIDs {
366
+ contract_ids: Array<string>;
347
367
 
348
- pricing_group_values?: { [key: string]: string };
368
+ type: 'CONTRACT_IDS';
369
+ }
370
+ }
371
+
372
+ /**
373
+ * A distinct rate on the rate card. You can choose to use this rate rather than
374
+ * list rate when consuming a credit or commit.
375
+ */
376
+ export interface CommitRate {
377
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
378
+
379
+ /**
380
+ * Commit rate price. For FLAT rate_type, this must be >=0.
381
+ */
382
+ price?: number;
383
+
384
+ /**
385
+ * Only set for TIERED rate_type.
386
+ */
387
+ tiers?: Array<Tier>;
388
+ }
389
+
390
+ export interface CommitSpecifier {
391
+ presentation_group_values?: { [key: string]: string };
392
+
393
+ pricing_group_values?: { [key: string]: string };
394
+
395
+ /**
396
+ * If provided, the specifier will only apply to the product with the specified ID.
397
+ */
398
+ product_id?: string;
399
+
400
+ /**
401
+ * If provided, the specifier will only apply to products with all the specified
402
+ * tags.
403
+ */
404
+ product_tags?: Array<string>;
405
+ }
406
+
407
+ export interface CommitSpecifierInput {
408
+ presentation_group_values?: { [key: string]: string };
409
+
410
+ pricing_group_values?: { [key: string]: string };
411
+
412
+ /**
413
+ * If provided, the specifier will only apply to the product with the specified ID.
414
+ */
415
+ product_id?: string;
416
+
417
+ /**
418
+ * If provided, the specifier will only apply to products with all the specified
419
+ * tags.
420
+ */
421
+ product_tags?: Array<string>;
422
+ }
423
+
424
+ export interface Contract {
425
+ id: string;
426
+
427
+ amendments: Array<Contract.Amendment>;
428
+
429
+ current: ContractWithoutAmendments;
430
+
431
+ customer_id: string;
432
+
433
+ initial: ContractWithoutAmendments;
434
+
435
+ /**
436
+ * RFC 3339 timestamp indicating when the contract was archived. If not returned,
437
+ * the contract is not archived.
438
+ */
439
+ archived_at?: string;
440
+
441
+ /**
442
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
443
+ */
444
+ custom_fields?: { [key: string]: string };
445
+
446
+ /**
447
+ * The billing provider configuration associated with a contract.
448
+ */
449
+ customer_billing_provider_configuration?: Contract.CustomerBillingProviderConfiguration;
450
+
451
+ prepaid_balance_threshold_configuration?: PrepaidBalanceThresholdConfiguration;
452
+
453
+ /**
454
+ * Priority of the contract.
455
+ */
456
+ priority?: number;
457
+
458
+ /**
459
+ * Determines which scheduled and commit charges to consolidate onto the Contract's
460
+ * usage invoice. The charge's `timestamp` must match the usage invoice's
461
+ * `ending_before` date for consolidation to occur. This field cannot be modified
462
+ * after a Contract has been created. If this field is omitted, charges will appear
463
+ * on a separate invoice from usage charges.
464
+ */
465
+ scheduled_charges_on_usage_invoices?: 'ALL';
466
+
467
+ spend_threshold_configuration?: SpendThresholdConfiguration;
468
+
469
+ /**
470
+ * List of subscriptions on the contract.
471
+ */
472
+ subscriptions?: Array<Subscription>;
473
+
474
+ /**
475
+ * Prevents the creation of duplicates. If a request to create a record is made
476
+ * with a previously used uniqueness key, a new record will not be created and the
477
+ * request will fail with a 409 error.
478
+ */
479
+ uniqueness_key?: string;
480
+ }
481
+
482
+ export namespace Contract {
483
+ export interface Amendment {
484
+ id: string;
485
+
486
+ commits: Array<Shared.Commit>;
487
+
488
+ created_at: string;
489
+
490
+ created_by: string;
491
+
492
+ overrides: Array<Shared.Override>;
493
+
494
+ scheduled_charges: Array<Shared.ScheduledCharge>;
495
+
496
+ starting_at: string;
497
+
498
+ credits?: Array<Shared.Credit>;
349
499
 
350
500
  /**
351
- * If provided, the specifier will only apply to the product with the specified ID.
501
+ * This field's availability is dependent on your client's configuration.
352
502
  */
353
- product_id?: string;
503
+ discounts?: Array<Shared.Discount>;
354
504
 
355
505
  /**
356
- * If provided, the specifier will only apply to products with all the specified
357
- * tags.
506
+ * This field's availability is dependent on your client's configuration.
358
507
  */
359
- product_tags?: Array<string>;
508
+ netsuite_sales_order_id?: string;
509
+
510
+ /**
511
+ * This field's availability is dependent on your client's configuration.
512
+ */
513
+ professional_services?: Array<Shared.ProService>;
514
+
515
+ /**
516
+ * This field's availability is dependent on your client's configuration.
517
+ */
518
+ reseller_royalties?: Array<Amendment.ResellerRoyalty>;
519
+
520
+ /**
521
+ * This field's availability is dependent on your client's configuration.
522
+ */
523
+ salesforce_opportunity_id?: string;
524
+ }
525
+
526
+ export namespace Amendment {
527
+ export interface ResellerRoyalty {
528
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
529
+
530
+ aws_account_number?: string;
531
+
532
+ aws_offer_id?: string;
533
+
534
+ aws_payer_reference_id?: string;
535
+
536
+ ending_before?: string | null;
537
+
538
+ fraction?: number;
539
+
540
+ gcp_account_id?: string;
541
+
542
+ gcp_offer_id?: string;
543
+
544
+ netsuite_reseller_id?: string;
545
+
546
+ reseller_contract_value?: number;
547
+
548
+ starting_at?: string;
549
+ }
550
+ }
551
+
552
+ /**
553
+ * The billing provider configuration associated with a contract.
554
+ */
555
+ export interface CustomerBillingProviderConfiguration {
556
+ archived_at: string | null;
557
+
558
+ billing_provider:
559
+ | 'aws_marketplace'
560
+ | 'stripe'
561
+ | 'netsuite'
562
+ | 'custom'
563
+ | 'azure_marketplace'
564
+ | 'quickbooks_online'
565
+ | 'workday'
566
+ | 'gcp_marketplace';
567
+
568
+ delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
569
+
570
+ id?: string;
571
+
572
+ /**
573
+ * Configuration for the billing provider. The structure of this object is specific
574
+ * to the billing provider.
575
+ */
576
+ configuration?: { [key: string]: unknown };
360
577
  }
361
578
  }
362
579
 
363
- export interface ContractWithoutAmendments {
364
- commits: Array<Commit>;
580
+ export interface ContractV2 {
581
+ id: string;
582
+
583
+ commits: Array<ContractV2.Commit>;
365
584
 
366
585
  created_at: string;
367
586
 
368
587
  created_by: string;
369
588
 
370
- overrides: Array<Override>;
589
+ customer_id: string;
590
+
591
+ overrides: Array<ContractV2.Override>;
371
592
 
372
593
  scheduled_charges: Array<ScheduledCharge>;
373
594
 
374
595
  starting_at: string;
375
596
 
376
- transitions: Array<ContractWithoutAmendments.Transition>;
597
+ transitions: Array<ContractV2.Transition>;
377
598
 
378
- usage_statement_schedule: ContractWithoutAmendments.UsageStatementSchedule;
599
+ usage_filter: Array<ContractV2.UsageFilter>;
379
600
 
380
- credits?: Array<Credit>;
601
+ usage_statement_schedule: ContractV2.UsageStatementSchedule;
602
+
603
+ archived_at?: string;
604
+
605
+ credits?: Array<ContractV2.Credit>;
606
+
607
+ /**
608
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
609
+ */
610
+ custom_fields?: { [key: string]: string };
611
+
612
+ /**
613
+ * This field's availability is dependent on your client's configuration.
614
+ */
615
+ customer_billing_provider_configuration?: ContractV2.CustomerBillingProviderConfiguration;
381
616
 
382
617
  /**
383
618
  * This field's availability is dependent on your client's configuration.
@@ -386,13 +621,25 @@ export interface ContractWithoutAmendments {
386
621
 
387
622
  ending_before?: string;
388
623
 
624
+ /**
625
+ * Indicates whether there are more items than the limit for this endpoint. Use the
626
+ * respective list endpoints to get the full lists.
627
+ */
628
+ has_more?: ContractV2.HasMore;
629
+
389
630
  /**
390
631
  * Either a **parent** configuration with a list of children or a **child**
391
632
  * configuration with a single parent.
392
633
  */
393
- hierarchy_configuration?:
394
- | ContractWithoutAmendments.ParentHierarchyConfiguration
395
- | ContractWithoutAmendments.ChildHierarchyConfiguration;
634
+ hierarchy_configuration?: HierarchyConfiguration;
635
+
636
+ /**
637
+ * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
638
+ * prices automatically. EXPLICIT prioritization requires specifying priorities for
639
+ * each multiplier; the one with the lowest priority value will be prioritized
640
+ * first.
641
+ */
642
+ multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';
396
643
 
397
644
  name?: string;
398
645
 
@@ -403,7 +650,12 @@ export interface ContractWithoutAmendments {
403
650
  */
404
651
  netsuite_sales_order_id?: string;
405
652
 
406
- prepaid_balance_threshold_configuration?: ContractWithoutAmendments.PrepaidBalanceThresholdConfiguration;
653
+ prepaid_balance_threshold_configuration?: PrepaidBalanceThresholdConfigurationV2;
654
+
655
+ /**
656
+ * Priority of the contract.
657
+ */
658
+ priority?: number;
407
659
 
408
660
  /**
409
661
  * This field's availability is dependent on your client's configuration.
@@ -412,14 +664,14 @@ export interface ContractWithoutAmendments {
412
664
 
413
665
  rate_card_id?: string;
414
666
 
415
- recurring_commits?: Array<ContractWithoutAmendments.RecurringCommit>;
667
+ recurring_commits?: Array<ContractV2.RecurringCommit>;
416
668
 
417
- recurring_credits?: Array<ContractWithoutAmendments.RecurringCredit>;
669
+ recurring_credits?: Array<ContractV2.RecurringCredit>;
418
670
 
419
671
  /**
420
672
  * This field's availability is dependent on your client's configuration.
421
673
  */
422
- reseller_royalties?: Array<ContractWithoutAmendments.ResellerRoyalty>;
674
+ reseller_royalties?: Array<ContractV2.ResellerRoyalty>;
423
675
 
424
676
  /**
425
677
  * This field's availability is dependent on your client's configuration.
@@ -435,217 +687,1056 @@ export interface ContractWithoutAmendments {
435
687
  */
436
688
  scheduled_charges_on_usage_invoices?: 'ALL';
437
689
 
438
- spend_threshold_configuration?: ContractWithoutAmendments.SpendThresholdConfiguration;
690
+ spend_threshold_configuration?: SpendThresholdConfigurationV2;
439
691
 
440
692
  /**
441
- * This field's availability is dependent on your client's configuration.
693
+ * List of subscriptions on the contract.
442
694
  */
695
+ subscriptions?: Array<Subscription>;
696
+
443
697
  total_contract_value?: number;
444
698
 
445
- usage_filter?: ContractWithoutAmendments.UsageFilter;
699
+ /**
700
+ * Optional uniqueness key to prevent duplicate contract creations.
701
+ */
702
+ uniqueness_key?: string;
446
703
  }
447
704
 
448
- export namespace ContractWithoutAmendments {
449
- export interface Transition {
450
- from_contract_id: string;
451
-
452
- to_contract_id: string;
453
-
454
- type: 'SUPERSEDE' | 'RENEWAL';
455
- }
705
+ export namespace ContractV2 {
706
+ export interface Commit {
707
+ id: string;
456
708
 
457
- export interface UsageStatementSchedule {
458
709
  /**
459
- * Contract usage statements follow a selected cadence based on this date.
710
+ * Timestamp of when the commit was created.
711
+ *
712
+ * - Recurring commits: latter of commit service period date and parent commit
713
+ * start date
714
+ * - Rollover commits: when the new contract started
460
715
  */
461
- billing_anchor_date: string;
716
+ created_at: string;
462
717
 
463
- frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
464
- }
718
+ product: Commit.Product;
719
+
720
+ type: 'PREPAID' | 'POSTPAID';
465
721
 
466
- export interface ParentHierarchyConfiguration {
467
722
  /**
468
- * List of contracts that belong to this parent.
723
+ * The schedule that the customer will gain access to the credits purposed with
724
+ * this commit.
469
725
  */
470
- children: Array<ParentHierarchyConfiguration.Child>;
471
- }
726
+ access_schedule?: Shared.ScheduleDuration;
472
727
 
473
- export namespace ParentHierarchyConfiguration {
474
- export interface Child {
475
- contract_id: string;
728
+ applicable_contract_ids?: Array<string>;
476
729
 
477
- customer_id: string;
478
- }
479
- }
730
+ applicable_product_ids?: Array<string>;
480
731
 
481
- export interface ChildHierarchyConfiguration {
482
- /**
483
- * The single parent contract/customer for this child.
484
- */
485
- parent: ChildHierarchyConfiguration.Parent;
486
- }
732
+ applicable_product_tags?: Array<string>;
733
+
734
+ archived_at?: string;
487
735
 
488
- export namespace ChildHierarchyConfiguration {
489
736
  /**
490
- * The single parent contract/customer for this child.
737
+ * The current balance of the credit or commit. This balance reflects the amount of
738
+ * credit or commit that the customer has access to use at this moment - thus,
739
+ * expired and upcoming credit or commit segments contribute 0 to the balance. The
740
+ * balance will match the sum of all ledger entries with the exception of the case
741
+ * where the sum of negative manual ledger entries exceeds the positive amount
742
+ * remaining on the credit or commit - in that case, the balance will be 0. All
743
+ * manual ledger entries associated with active credit or commit segments are
744
+ * included in the balance, including future-dated manual ledger entries.
491
745
  */
492
- export interface Parent {
493
- contract_id: string;
494
-
495
- customer_id: string;
496
- }
497
- }
746
+ balance?: number;
498
747
 
499
- export interface PrepaidBalanceThresholdConfiguration {
500
- commit: PrepaidBalanceThresholdConfiguration.Commit;
748
+ contract?: Commit.Contract;
501
749
 
502
750
  /**
503
- * When set to false, the contract will not be evaluated against the
504
- * threshold_amount. Toggling to true will result an immediate evaluation,
505
- * regardless of prior state.
751
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
506
752
  */
507
- is_enabled: boolean;
753
+ custom_fields?: { [key: string]: string };
508
754
 
509
- payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
755
+ description?: string;
510
756
 
511
757
  /**
512
- * Specify the amount the balance should be recharged to.
758
+ * Optional configuration for commit hierarchy access control
513
759
  */
514
- recharge_to_amount: number;
760
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
515
761
 
516
762
  /**
517
- * Specify the threshold amount for the contract. Each time the contract's prepaid
518
- * balance lowers to this amount, a threshold charge will be initiated.
763
+ * The contract that this commit will be billed on.
519
764
  */
520
- threshold_amount: number;
765
+ invoice_contract?: Commit.InvoiceContract;
521
766
 
522
767
  /**
523
- * If provided, the threshold, recharge-to amount, and the resulting threshold
524
- * commit amount will be in terms of this credit type instead of the fiat currency.
768
+ * The schedule that the customer will be invoiced for this commit.
525
769
  */
526
- custom_credit_type_id?: string;
527
- }
770
+ invoice_schedule?: Shared.SchedulePointInTime;
528
771
 
529
- export namespace PrepaidBalanceThresholdConfiguration {
530
- export interface Commit {
531
- /**
532
- * The commit product that will be used to generate the line item for commit
533
- * payment.
534
- */
535
- product_id: string;
772
+ /**
773
+ * A list of ordered events that impact the balance of a commit. For example, an
774
+ * invoice deduction or a rollover.
775
+ */
776
+ ledger?: Array<
777
+ | Commit.PrepaidCommitSegmentStartLedgerEntry
778
+ | Commit.PrepaidCommitAutomatedInvoiceDeductionLedgerEntry
779
+ | Commit.PrepaidCommitRolloverLedgerEntry
780
+ | Commit.PrepaidCommitExpirationLedgerEntry
781
+ | Commit.PrepaidCommitCanceledLedgerEntry
782
+ | Commit.PrepaidCommitCreditedLedgerEntry
783
+ | Commit.PrepaidCommitSeatBasedAdjustmentLedgerEntry
784
+ | Commit.PostpaidCommitInitialBalanceLedgerEntry
785
+ | Commit.PostpaidCommitAutomatedInvoiceDeductionLedgerEntry
786
+ | Commit.PostpaidCommitRolloverLedgerEntry
787
+ | Commit.PostpaidCommitTrueupLedgerEntry
788
+ | Commit.PrepaidCommitManualLedgerEntry
789
+ | Commit.PostpaidCommitManualLedgerEntry
790
+ | Commit.PostpaidCommitExpirationLedgerEntry
791
+ >;
536
792
 
537
- /**
538
- * Which products the threshold commit applies to. If applicable_product_ids,
539
- * applicable_product_tags or specifiers are not provided, the commit applies to
540
- * all products.
541
- */
542
- applicable_product_ids?: Array<string>;
793
+ name?: string;
543
794
 
544
- /**
545
- * Which tags the threshold commit applies to. If applicable_product_ids,
546
- * applicable_product_tags or specifiers are not provided, the commit applies to
547
- * all products.
548
- */
549
- applicable_product_tags?: Array<string>;
795
+ /**
796
+ * This field's availability is dependent on your client's configuration.
797
+ */
798
+ netsuite_sales_order_id?: string;
550
799
 
551
- description?: string;
552
-
553
- /**
554
- * Specify the name of the line item for the threshold charge. If left blank, it
555
- * will default to the commit product name.
556
- */
557
- name?: string;
558
-
559
- /**
560
- * List of filters that determine what kind of customer usage draws down a commit
561
- * or credit. A customer's usage needs to meet the condition of at least one of the
562
- * specifiers to contribute to a commit's or credit's drawdown. This field cannot
563
- * be used together with `applicable_product_ids` or `applicable_product_tags`.
564
- */
565
- specifiers?: Array<Commit.Specifier>;
566
- }
800
+ /**
801
+ * If multiple credits or commits are applicable, the one with the lower priority
802
+ * will apply first.
803
+ */
804
+ priority?: number;
567
805
 
568
- export namespace Commit {
569
- export interface Specifier {
570
- presentation_group_values?: { [key: string]: string };
806
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
571
807
 
572
- pricing_group_values?: { [key: string]: string };
808
+ rolled_over_from?: Commit.RolledOverFrom;
573
809
 
574
- /**
575
- * If provided, the specifier will only apply to the product with the specified ID.
576
- */
577
- product_id?: string;
810
+ rollover_fraction?: number;
578
811
 
579
- /**
580
- * If provided, the specifier will only apply to products with all the specified
581
- * tags.
582
- */
583
- product_tags?: Array<string>;
584
- }
585
- }
812
+ /**
813
+ * This field's availability is dependent on your client's configuration.
814
+ */
815
+ salesforce_opportunity_id?: string;
586
816
 
587
- export interface PaymentGateConfig {
588
- /**
589
- * Gate access to the commit balance based on successful collection of payment.
590
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
591
- * facilitate payment using your own payment integration. Select NONE if you do not
592
- * wish to payment gate the commit balance.
593
- */
594
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
595
-
596
- /**
597
- * Only applicable if using PRECALCULATED as your tax type.
598
- */
599
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
600
-
601
- /**
602
- * Only applicable if using STRIPE as your payment gate type.
603
- */
604
- stripe_config?: PaymentGateConfig.StripeConfig;
605
-
606
- /**
607
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
608
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
609
- * will default to NONE.
610
- */
611
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
817
+ /**
818
+ * List of filters that determine what kind of customer usage draws down a commit
819
+ * or credit. A customer's usage needs to meet the condition of at least one of the
820
+ * specifiers to contribute to a commit's or credit's drawdown.
821
+ */
822
+ specifiers?: Array<Shared.CommitSpecifier>;
823
+ }
824
+
825
+ export namespace Commit {
826
+ export interface Product {
827
+ id: string;
828
+
829
+ name: string;
830
+ }
831
+
832
+ export interface Contract {
833
+ id: string;
834
+ }
835
+
836
+ /**
837
+ * The contract that this commit will be billed on.
838
+ */
839
+ export interface InvoiceContract {
840
+ id: string;
841
+ }
842
+
843
+ export interface PrepaidCommitSegmentStartLedgerEntry {
844
+ amount: number;
845
+
846
+ segment_id: string;
847
+
848
+ timestamp: string;
849
+
850
+ type: 'PREPAID_COMMIT_SEGMENT_START';
851
+ }
852
+
853
+ export interface PrepaidCommitAutomatedInvoiceDeductionLedgerEntry {
854
+ amount: number;
855
+
856
+ invoice_id: string;
857
+
858
+ segment_id: string;
859
+
860
+ timestamp: string;
861
+
862
+ type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
863
+
864
+ contract_id?: string;
865
+ }
866
+
867
+ export interface PrepaidCommitRolloverLedgerEntry {
868
+ amount: number;
869
+
870
+ new_contract_id: string;
871
+
872
+ segment_id: string;
873
+
874
+ timestamp: string;
875
+
876
+ type: 'PREPAID_COMMIT_ROLLOVER';
877
+ }
878
+
879
+ export interface PrepaidCommitExpirationLedgerEntry {
880
+ amount: number;
881
+
882
+ segment_id: string;
883
+
884
+ timestamp: string;
885
+
886
+ type: 'PREPAID_COMMIT_EXPIRATION';
887
+ }
888
+
889
+ export interface PrepaidCommitCanceledLedgerEntry {
890
+ amount: number;
891
+
892
+ invoice_id: string;
893
+
894
+ segment_id: string;
895
+
896
+ timestamp: string;
897
+
898
+ type: 'PREPAID_COMMIT_CANCELED';
899
+
900
+ contract_id?: string;
901
+ }
902
+
903
+ export interface PrepaidCommitCreditedLedgerEntry {
904
+ amount: number;
905
+
906
+ invoice_id: string;
907
+
908
+ segment_id: string;
909
+
910
+ timestamp: string;
911
+
912
+ type: 'PREPAID_COMMIT_CREDITED';
913
+
914
+ contract_id?: string;
915
+ }
916
+
917
+ export interface PrepaidCommitSeatBasedAdjustmentLedgerEntry {
918
+ amount: number;
919
+
920
+ segment_id: string;
921
+
922
+ timestamp: string;
923
+
924
+ type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT';
925
+ }
926
+
927
+ export interface PostpaidCommitInitialBalanceLedgerEntry {
928
+ amount: number;
929
+
930
+ timestamp: string;
931
+
932
+ type: 'POSTPAID_COMMIT_INITIAL_BALANCE';
933
+ }
934
+
935
+ export interface PostpaidCommitAutomatedInvoiceDeductionLedgerEntry {
936
+ amount: number;
937
+
938
+ invoice_id: string;
939
+
940
+ segment_id: string;
941
+
942
+ timestamp: string;
943
+
944
+ type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
945
+
946
+ contract_id?: string;
947
+ }
948
+
949
+ export interface PostpaidCommitRolloverLedgerEntry {
950
+ amount: number;
951
+
952
+ new_contract_id: string;
953
+
954
+ segment_id: string;
955
+
956
+ timestamp: string;
957
+
958
+ type: 'POSTPAID_COMMIT_ROLLOVER';
959
+ }
960
+
961
+ export interface PostpaidCommitTrueupLedgerEntry {
962
+ amount: number;
963
+
964
+ invoice_id: string;
965
+
966
+ timestamp: string;
967
+
968
+ type: 'POSTPAID_COMMIT_TRUEUP';
969
+
970
+ contract_id?: string;
971
+ }
972
+
973
+ export interface PrepaidCommitManualLedgerEntry {
974
+ amount: number;
975
+
976
+ reason: string;
977
+
978
+ timestamp: string;
979
+
980
+ type: 'PREPAID_COMMIT_MANUAL';
981
+ }
982
+
983
+ export interface PostpaidCommitManualLedgerEntry {
984
+ amount: number;
985
+
986
+ reason: string;
987
+
988
+ timestamp: string;
989
+
990
+ type: 'POSTPAID_COMMIT_MANUAL';
991
+ }
992
+
993
+ export interface PostpaidCommitExpirationLedgerEntry {
994
+ amount: number;
995
+
996
+ timestamp: string;
997
+
998
+ type: 'POSTPAID_COMMIT_EXPIRATION';
999
+ }
1000
+
1001
+ export interface RolledOverFrom {
1002
+ commit_id: string;
1003
+
1004
+ contract_id: string;
1005
+ }
1006
+ }
1007
+
1008
+ export interface Override {
1009
+ id: string;
1010
+
1011
+ starting_at: string;
1012
+
1013
+ applicable_product_tags?: Array<string>;
1014
+
1015
+ ending_before?: string;
1016
+
1017
+ entitled?: boolean;
1018
+
1019
+ is_commit_specific?: boolean;
1020
+
1021
+ multiplier?: number;
1022
+
1023
+ override_specifiers?: Array<Override.OverrideSpecifier>;
1024
+
1025
+ override_tiers?: Array<Shared.OverrideTier>;
1026
+
1027
+ overwrite_rate?: Shared.OverwriteRate;
1028
+
1029
+ priority?: number;
1030
+
1031
+ product?: Override.Product;
1032
+
1033
+ target?: 'COMMIT_RATE' | 'LIST_RATE';
1034
+
1035
+ type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
1036
+ }
1037
+
1038
+ export namespace Override {
1039
+ export interface OverrideSpecifier {
1040
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1041
+
1042
+ commit_ids?: Array<string>;
1043
+
1044
+ presentation_group_values?: { [key: string]: string | null };
1045
+
1046
+ pricing_group_values?: { [key: string]: string };
1047
+
1048
+ product_id?: string;
1049
+
1050
+ product_tags?: Array<string>;
1051
+
1052
+ recurring_commit_ids?: Array<string>;
1053
+
1054
+ recurring_credit_ids?: Array<string>;
1055
+ }
1056
+
1057
+ export interface Product {
1058
+ id: string;
1059
+
1060
+ name: string;
1061
+ }
1062
+ }
1063
+
1064
+ export interface Transition {
1065
+ from_contract_id: string;
1066
+
1067
+ to_contract_id: string;
1068
+
1069
+ type: 'SUPERSEDE' | 'RENEWAL';
1070
+ }
1071
+
1072
+ export interface UsageFilter {
1073
+ group_key: string;
1074
+
1075
+ group_values: Array<string>;
1076
+
1077
+ /**
1078
+ * This will match contract starting_at value if usage filter is active from the
1079
+ * beginning of the contract.
1080
+ */
1081
+ starting_at: string;
1082
+
1083
+ /**
1084
+ * This will match contract ending_before value if usage filter is active until the
1085
+ * end of the contract. It will be undefined if the contract is open-ended.
1086
+ */
1087
+ ending_before?: string;
1088
+ }
1089
+
1090
+ export interface UsageStatementSchedule {
1091
+ /**
1092
+ * Contract usage statements follow a selected cadence based on this date.
1093
+ */
1094
+ billing_anchor_date: string;
1095
+
1096
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1097
+ }
1098
+
1099
+ export interface Credit {
1100
+ id: string;
1101
+
1102
+ product: Credit.Product;
1103
+
1104
+ type: 'CREDIT';
1105
+
1106
+ /**
1107
+ * The schedule that the customer will gain access to the credits.
1108
+ */
1109
+ access_schedule?: Shared.ScheduleDuration;
1110
+
1111
+ applicable_contract_ids?: Array<string>;
1112
+
1113
+ applicable_product_ids?: Array<string>;
1114
+
1115
+ applicable_product_tags?: Array<string>;
1116
+
1117
+ /**
1118
+ * The current balance of the credit or commit. This balance reflects the amount of
1119
+ * credit or commit that the customer has access to use at this moment - thus,
1120
+ * expired and upcoming credit or commit segments contribute 0 to the balance. The
1121
+ * balance will match the sum of all ledger entries with the exception of the case
1122
+ * where the sum of negative manual ledger entries exceeds the positive amount
1123
+ * remaining on the credit or commit - in that case, the balance will be 0. All
1124
+ * manual ledger entries associated with active credit or commit segments are
1125
+ * included in the balance, including future-dated manual ledger entries.
1126
+ */
1127
+ balance?: number;
1128
+
1129
+ contract?: Credit.Contract;
1130
+
1131
+ /**
1132
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1133
+ */
1134
+ custom_fields?: { [key: string]: string };
1135
+
1136
+ description?: string;
1137
+
1138
+ /**
1139
+ * Optional configuration for credit hierarchy access control
1140
+ */
1141
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1142
+
1143
+ /**
1144
+ * A list of ordered events that impact the balance of a credit. For example, an
1145
+ * invoice deduction or an expiration.
1146
+ */
1147
+ ledger?: Array<
1148
+ | Credit.CreditSegmentStartLedgerEntry
1149
+ | Credit.CreditAutomatedInvoiceDeductionLedgerEntry
1150
+ | Credit.CreditExpirationLedgerEntry
1151
+ | Credit.CreditCanceledLedgerEntry
1152
+ | Credit.CreditCreditedLedgerEntry
1153
+ | Credit.CreditManualLedgerEntry
1154
+ | Credit.CreditSeatBasedAdjustmentLedgerEntry
1155
+ >;
1156
+
1157
+ name?: string;
1158
+
1159
+ /**
1160
+ * This field's availability is dependent on your client's configuration.
1161
+ */
1162
+ netsuite_sales_order_id?: string;
1163
+
1164
+ /**
1165
+ * If multiple credits or commits are applicable, the one with the lower priority
1166
+ * will apply first.
1167
+ */
1168
+ priority?: number;
1169
+
1170
+ /**
1171
+ * This field's availability is dependent on your client's configuration.
1172
+ */
1173
+ salesforce_opportunity_id?: string;
1174
+
1175
+ /**
1176
+ * List of filters that determine what kind of customer usage draws down a commit
1177
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1178
+ * specifiers to contribute to a commit's or credit's drawdown.
1179
+ */
1180
+ specifiers?: Array<Shared.CommitSpecifier>;
1181
+ }
1182
+
1183
+ export namespace Credit {
1184
+ export interface Product {
1185
+ id: string;
1186
+
1187
+ name: string;
1188
+ }
1189
+
1190
+ export interface Contract {
1191
+ id: string;
1192
+ }
1193
+
1194
+ export interface CreditSegmentStartLedgerEntry {
1195
+ amount: number;
1196
+
1197
+ segment_id: string;
1198
+
1199
+ timestamp: string;
1200
+
1201
+ type: 'CREDIT_SEGMENT_START';
1202
+ }
1203
+
1204
+ export interface CreditAutomatedInvoiceDeductionLedgerEntry {
1205
+ amount: number;
1206
+
1207
+ invoice_id: string;
1208
+
1209
+ segment_id: string;
1210
+
1211
+ timestamp: string;
1212
+
1213
+ type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION';
1214
+
1215
+ contract_id?: string;
1216
+ }
1217
+
1218
+ export interface CreditExpirationLedgerEntry {
1219
+ amount: number;
1220
+
1221
+ segment_id: string;
1222
+
1223
+ timestamp: string;
1224
+
1225
+ type: 'CREDIT_EXPIRATION';
1226
+ }
1227
+
1228
+ export interface CreditCanceledLedgerEntry {
1229
+ amount: number;
1230
+
1231
+ invoice_id: string;
1232
+
1233
+ segment_id: string;
1234
+
1235
+ timestamp: string;
1236
+
1237
+ type: 'CREDIT_CANCELED';
1238
+
1239
+ contract_id?: string;
1240
+ }
1241
+
1242
+ export interface CreditCreditedLedgerEntry {
1243
+ amount: number;
1244
+
1245
+ invoice_id: string;
1246
+
1247
+ segment_id: string;
1248
+
1249
+ timestamp: string;
1250
+
1251
+ type: 'CREDIT_CREDITED';
1252
+
1253
+ contract_id?: string;
1254
+ }
1255
+
1256
+ export interface CreditManualLedgerEntry {
1257
+ amount: number;
1258
+
1259
+ reason: string;
1260
+
1261
+ timestamp: string;
1262
+
1263
+ type: 'CREDIT_MANUAL';
1264
+ }
1265
+
1266
+ export interface CreditSeatBasedAdjustmentLedgerEntry {
1267
+ amount: number;
1268
+
1269
+ segment_id: string;
1270
+
1271
+ timestamp: string;
1272
+
1273
+ type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
1274
+ }
1275
+ }
1276
+
1277
+ /**
1278
+ * This field's availability is dependent on your client's configuration.
1279
+ */
1280
+ export interface CustomerBillingProviderConfiguration {
1281
+ /**
1282
+ * ID of Customer's billing provider configuration.
1283
+ */
1284
+ id: string;
1285
+
1286
+ billing_provider:
1287
+ | 'aws_marketplace'
1288
+ | 'stripe'
1289
+ | 'netsuite'
1290
+ | 'custom'
1291
+ | 'azure_marketplace'
1292
+ | 'quickbooks_online'
1293
+ | 'workday'
1294
+ | 'gcp_marketplace';
1295
+
1296
+ delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
1297
+ }
1298
+
1299
+ /**
1300
+ * Indicates whether there are more items than the limit for this endpoint. Use the
1301
+ * respective list endpoints to get the full lists.
1302
+ */
1303
+ export interface HasMore {
1304
+ /**
1305
+ * Whether there are more commits on this contract than the limit for this
1306
+ * endpoint. Use the /contracts/customerCommits/list endpoint to get the full list
1307
+ * of commits.
1308
+ */
1309
+ commits: boolean;
1310
+
1311
+ /**
1312
+ * Whether there are more credits on this contract than the limit for this
1313
+ * endpoint. Use the /contracts/customerCredits/list endpoint to get the full list
1314
+ * of credits.
1315
+ */
1316
+ credits: boolean;
1317
+ }
1318
+
1319
+ export interface RecurringCommit {
1320
+ id: string;
1321
+
1322
+ /**
1323
+ * The amount of commit to grant.
1324
+ */
1325
+ access_amount: RecurringCommit.AccessAmount;
1326
+
1327
+ /**
1328
+ * The amount of time the created commits will be valid for
1329
+ */
1330
+ commit_duration: RecurringCommit.CommitDuration;
1331
+
1332
+ /**
1333
+ * Will be passed down to the individual commits
1334
+ */
1335
+ priority: number;
1336
+
1337
+ product: RecurringCommit.Product;
1338
+
1339
+ /**
1340
+ * Whether the created commits will use the commit rate or list rate
1341
+ */
1342
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
1343
+
1344
+ /**
1345
+ * Determines the start time for the first commit
1346
+ */
1347
+ starting_at: string;
1348
+
1349
+ /**
1350
+ * Will be passed down to the individual commits
1351
+ */
1352
+ applicable_product_ids?: Array<string>;
1353
+
1354
+ /**
1355
+ * Will be passed down to the individual commits
1356
+ */
1357
+ applicable_product_tags?: Array<string>;
1358
+
1359
+ contract?: RecurringCommit.Contract;
1360
+
1361
+ /**
1362
+ * Will be passed down to the individual commits
1363
+ */
1364
+ description?: string;
1365
+
1366
+ /**
1367
+ * Determines when the contract will stop creating recurring commits. Optional
1368
+ */
1369
+ ending_before?: string;
1370
+
1371
+ /**
1372
+ * Optional configuration for recurring credit hierarchy access control
1373
+ */
1374
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1375
+
1376
+ /**
1377
+ * The amount the customer should be billed for the commit. Not required.
1378
+ */
1379
+ invoice_amount?: RecurringCommit.InvoiceAmount;
1380
+
1381
+ /**
1382
+ * Displayed on invoices. Will be passed through to the individual commits
1383
+ */
1384
+ name?: string;
1385
+
1386
+ /**
1387
+ * Will be passed down to the individual commits
1388
+ */
1389
+ netsuite_sales_order_id?: string;
1390
+
1391
+ /**
1392
+ * Determines whether the first and last commit will be prorated. If not provided,
1393
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1394
+ */
1395
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1396
+
1397
+ /**
1398
+ * The frequency at which the recurring commits will be created. If not provided: -
1399
+ * The commits will be created on the usage invoice frequency. If provided: - The
1400
+ * period defined in the duration will correspond to this frequency. - Commits will
1401
+ * be created aligned with the recurring commit's starting_at rather than the usage
1402
+ * invoice dates.
1403
+ */
1404
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1405
+
1406
+ /**
1407
+ * Will be passed down to the individual commits. This controls how much of an
1408
+ * individual unexpired commit will roll over upon contract transition. Must be
1409
+ * between 0 and 1.
1410
+ */
1411
+ rollover_fraction?: number;
1412
+
1413
+ /**
1414
+ * List of filters that determine what kind of customer usage draws down a commit
1415
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1416
+ * specifiers to contribute to a commit's or credit's drawdown.
1417
+ */
1418
+ specifiers?: Array<Shared.CommitSpecifier>;
1419
+
1420
+ /**
1421
+ * Attach a subscription to the recurring commit/credit.
1422
+ */
1423
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
1424
+ }
1425
+
1426
+ export namespace RecurringCommit {
1427
+ /**
1428
+ * The amount of commit to grant.
1429
+ */
1430
+ export interface AccessAmount {
1431
+ credit_type_id: string;
1432
+
1433
+ unit_price: number;
1434
+
1435
+ quantity?: number;
1436
+ }
1437
+
1438
+ /**
1439
+ * The amount of time the created commits will be valid for
1440
+ */
1441
+ export interface CommitDuration {
1442
+ value: number;
1443
+
1444
+ unit?: 'PERIODS';
1445
+ }
1446
+
1447
+ export interface Product {
1448
+ id: string;
1449
+
1450
+ name: string;
1451
+ }
1452
+
1453
+ export interface Contract {
1454
+ id: string;
1455
+ }
1456
+
1457
+ /**
1458
+ * The amount the customer should be billed for the commit. Not required.
1459
+ */
1460
+ export interface InvoiceAmount {
1461
+ credit_type_id: string;
1462
+
1463
+ quantity: number;
1464
+
1465
+ unit_price: number;
1466
+ }
1467
+ }
1468
+
1469
+ export interface RecurringCredit {
1470
+ id: string;
1471
+
1472
+ /**
1473
+ * The amount of commit to grant.
1474
+ */
1475
+ access_amount: RecurringCredit.AccessAmount;
1476
+
1477
+ /**
1478
+ * The amount of time the created commits will be valid for
1479
+ */
1480
+ commit_duration: RecurringCredit.CommitDuration;
1481
+
1482
+ /**
1483
+ * Will be passed down to the individual commits
1484
+ */
1485
+ priority: number;
1486
+
1487
+ product: RecurringCredit.Product;
1488
+
1489
+ /**
1490
+ * Whether the created commits will use the commit rate or list rate
1491
+ */
1492
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
1493
+
1494
+ /**
1495
+ * Determines the start time for the first commit
1496
+ */
1497
+ starting_at: string;
1498
+
1499
+ /**
1500
+ * Will be passed down to the individual commits
1501
+ */
1502
+ applicable_product_ids?: Array<string>;
1503
+
1504
+ /**
1505
+ * Will be passed down to the individual commits
1506
+ */
1507
+ applicable_product_tags?: Array<string>;
1508
+
1509
+ contract?: RecurringCredit.Contract;
1510
+
1511
+ /**
1512
+ * Will be passed down to the individual commits
1513
+ */
1514
+ description?: string;
1515
+
1516
+ /**
1517
+ * Determines when the contract will stop creating recurring commits. Optional
1518
+ */
1519
+ ending_before?: string;
1520
+
1521
+ /**
1522
+ * Optional configuration for recurring credit hierarchy access control
1523
+ */
1524
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1525
+
1526
+ /**
1527
+ * Displayed on invoices. Will be passed through to the individual commits
1528
+ */
1529
+ name?: string;
1530
+
1531
+ /**
1532
+ * Will be passed down to the individual commits
1533
+ */
1534
+ netsuite_sales_order_id?: string;
1535
+
1536
+ /**
1537
+ * Determines whether the first and last commit will be prorated. If not provided,
1538
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1539
+ */
1540
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1541
+
1542
+ /**
1543
+ * The frequency at which the recurring commits will be created. If not provided: -
1544
+ * The commits will be created on the usage invoice frequency. If provided: - The
1545
+ * period defined in the duration will correspond to this frequency. - Commits will
1546
+ * be created aligned with the recurring commit's starting_at rather than the usage
1547
+ * invoice dates.
1548
+ */
1549
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1550
+
1551
+ /**
1552
+ * Will be passed down to the individual commits. This controls how much of an
1553
+ * individual unexpired commit will roll over upon contract transition. Must be
1554
+ * between 0 and 1.
1555
+ */
1556
+ rollover_fraction?: number;
1557
+
1558
+ /**
1559
+ * List of filters that determine what kind of customer usage draws down a commit
1560
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1561
+ * specifiers to contribute to a commit's or credit's drawdown.
1562
+ */
1563
+ specifiers?: Array<Shared.CommitSpecifier>;
1564
+
1565
+ /**
1566
+ * Attach a subscription to the recurring commit/credit.
1567
+ */
1568
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
1569
+ }
1570
+
1571
+ export namespace RecurringCredit {
1572
+ /**
1573
+ * The amount of commit to grant.
1574
+ */
1575
+ export interface AccessAmount {
1576
+ credit_type_id: string;
1577
+
1578
+ unit_price: number;
1579
+
1580
+ quantity?: number;
1581
+ }
1582
+
1583
+ /**
1584
+ * The amount of time the created commits will be valid for
1585
+ */
1586
+ export interface CommitDuration {
1587
+ value: number;
1588
+
1589
+ unit?: 'PERIODS';
1590
+ }
1591
+
1592
+ export interface Product {
1593
+ id: string;
1594
+
1595
+ name: string;
1596
+ }
1597
+
1598
+ export interface Contract {
1599
+ id: string;
612
1600
  }
1601
+ }
1602
+
1603
+ export interface ResellerRoyalty {
1604
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
1605
+
1606
+ segments: Array<ResellerRoyalty.Segment>;
1607
+ }
1608
+
1609
+ export namespace ResellerRoyalty {
1610
+ export interface Segment {
1611
+ fraction: number;
1612
+
1613
+ netsuite_reseller_id: string;
1614
+
1615
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
1616
+
1617
+ starting_at: string;
1618
+
1619
+ applicable_product_ids?: Array<string>;
1620
+
1621
+ applicable_product_tags?: Array<string>;
1622
+
1623
+ aws_account_number?: string;
1624
+
1625
+ aws_offer_id?: string;
1626
+
1627
+ aws_payer_reference_id?: string;
613
1628
 
614
- export namespace PaymentGateConfig {
615
- /**
616
- * Only applicable if using PRECALCULATED as your tax type.
617
- */
618
- export interface PrecalculatedTaxConfig {
619
- /**
620
- * Amount of tax to be applied. This should be in the same currency and
621
- * denomination as the commit's invoice schedule
622
- */
623
- tax_amount: number;
624
-
625
- /**
626
- * Name of the tax to be applied. This may be used in an invoice line item
627
- * description.
628
- */
629
- tax_name?: string;
630
- }
631
-
632
- /**
633
- * Only applicable if using STRIPE as your payment gate type.
634
- */
635
- export interface StripeConfig {
636
- /**
637
- * If left blank, will default to INVOICE
638
- */
639
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
640
-
641
- /**
642
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
643
- * your payment type.
644
- */
645
- invoice_metadata?: { [key: string]: string };
646
- }
1629
+ ending_before?: string;
1630
+
1631
+ gcp_account_id?: string;
1632
+
1633
+ gcp_offer_id?: string;
1634
+
1635
+ reseller_contract_value?: number;
647
1636
  }
648
1637
  }
1638
+ }
1639
+
1640
+ export interface ContractWithoutAmendments {
1641
+ commits: Array<Commit>;
1642
+
1643
+ created_at: string;
1644
+
1645
+ created_by: string;
1646
+
1647
+ overrides: Array<Override>;
1648
+
1649
+ scheduled_charges: Array<ScheduledCharge>;
1650
+
1651
+ starting_at: string;
1652
+
1653
+ transitions: Array<ContractWithoutAmendments.Transition>;
1654
+
1655
+ usage_statement_schedule: ContractWithoutAmendments.UsageStatementSchedule;
1656
+
1657
+ credits?: Array<Credit>;
1658
+
1659
+ /**
1660
+ * This field's availability is dependent on your client's configuration.
1661
+ */
1662
+ discounts?: Array<Discount>;
1663
+
1664
+ ending_before?: string;
1665
+
1666
+ /**
1667
+ * Either a **parent** configuration with a list of children or a **child**
1668
+ * configuration with a single parent.
1669
+ */
1670
+ hierarchy_configuration?: HierarchyConfiguration;
1671
+
1672
+ name?: string;
1673
+
1674
+ net_payment_terms_days?: number;
1675
+
1676
+ /**
1677
+ * This field's availability is dependent on your client's configuration.
1678
+ */
1679
+ netsuite_sales_order_id?: string;
1680
+
1681
+ prepaid_balance_threshold_configuration?: PrepaidBalanceThresholdConfiguration;
1682
+
1683
+ /**
1684
+ * This field's availability is dependent on your client's configuration.
1685
+ */
1686
+ professional_services?: Array<ProService>;
1687
+
1688
+ rate_card_id?: string;
1689
+
1690
+ recurring_commits?: Array<ContractWithoutAmendments.RecurringCommit>;
1691
+
1692
+ recurring_credits?: Array<ContractWithoutAmendments.RecurringCredit>;
1693
+
1694
+ /**
1695
+ * This field's availability is dependent on your client's configuration.
1696
+ */
1697
+ reseller_royalties?: Array<ContractWithoutAmendments.ResellerRoyalty>;
1698
+
1699
+ /**
1700
+ * This field's availability is dependent on your client's configuration.
1701
+ */
1702
+ salesforce_opportunity_id?: string;
1703
+
1704
+ /**
1705
+ * Determines which scheduled and commit charges to consolidate onto the Contract's
1706
+ * usage invoice. The charge's `timestamp` must match the usage invoice's
1707
+ * `ending_before` date for consolidation to occur. This field cannot be modified
1708
+ * after a Contract has been created. If this field is omitted, charges will appear
1709
+ * on a separate invoice from usage charges.
1710
+ */
1711
+ scheduled_charges_on_usage_invoices?: 'ALL';
1712
+
1713
+ spend_threshold_configuration?: SpendThresholdConfiguration;
1714
+
1715
+ /**
1716
+ * This field's availability is dependent on your client's configuration.
1717
+ */
1718
+ total_contract_value?: number;
1719
+
1720
+ usage_filter?: ContractWithoutAmendments.UsageFilter;
1721
+ }
1722
+
1723
+ export namespace ContractWithoutAmendments {
1724
+ export interface Transition {
1725
+ from_contract_id: string;
1726
+
1727
+ to_contract_id: string;
1728
+
1729
+ type: 'SUPERSEDE' | 'RENEWAL';
1730
+ }
1731
+
1732
+ export interface UsageStatementSchedule {
1733
+ /**
1734
+ * Contract usage statements follow a selected cadence based on this date.
1735
+ */
1736
+ billing_anchor_date: string;
1737
+
1738
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1739
+ }
649
1740
 
650
1741
  export interface RecurringCommit {
651
1742
  id: string;
@@ -702,7 +1793,7 @@ export namespace ContractWithoutAmendments {
702
1793
  /**
703
1794
  * Optional configuration for recurring commit/credit hierarchy access control
704
1795
  */
705
- hierarchy_configuration?: RecurringCommit.HierarchyConfiguration;
1796
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
706
1797
 
707
1798
  /**
708
1799
  * The amount the customer should be billed for the commit. Not required.
@@ -746,12 +1837,12 @@ export namespace ContractWithoutAmendments {
746
1837
  * or credit. A customer's usage needs to meet the condition of at least one of the
747
1838
  * specifiers to contribute to a commit's or credit's drawdown.
748
1839
  */
749
- specifiers?: Array<RecurringCommit.Specifier>;
1840
+ specifiers?: Array<Shared.CommitSpecifier>;
750
1841
 
751
1842
  /**
752
1843
  * Attach a subscription to the recurring commit/credit.
753
1844
  */
754
- subscription_config?: RecurringCommit.SubscriptionConfig;
1845
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
755
1846
  }
756
1847
 
757
1848
  export namespace RecurringCommit {
@@ -785,32 +1876,6 @@ export namespace ContractWithoutAmendments {
785
1876
  id: string;
786
1877
  }
787
1878
 
788
- /**
789
- * Optional configuration for recurring commit/credit hierarchy access control
790
- */
791
- export interface HierarchyConfiguration {
792
- child_access:
793
- | HierarchyConfiguration.CommitHierarchyChildAccessAll
794
- | HierarchyConfiguration.CommitHierarchyChildAccessNone
795
- | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
796
- }
797
-
798
- export namespace HierarchyConfiguration {
799
- export interface CommitHierarchyChildAccessAll {
800
- type: 'ALL';
801
- }
802
-
803
- export interface CommitHierarchyChildAccessNone {
804
- type: 'NONE';
805
- }
806
-
807
- export interface CommitHierarchyChildAccessContractIDs {
808
- contract_ids: Array<string>;
809
-
810
- type: 'CONTRACT_IDS';
811
- }
812
- }
813
-
814
1879
  /**
815
1880
  * The amount the customer should be billed for the commit. Not required.
816
1881
  */
@@ -821,43 +1886,6 @@ export namespace ContractWithoutAmendments {
821
1886
 
822
1887
  unit_price: number;
823
1888
  }
824
-
825
- export interface Specifier {
826
- presentation_group_values?: { [key: string]: string };
827
-
828
- pricing_group_values?: { [key: string]: string };
829
-
830
- /**
831
- * If provided, the specifier will only apply to the product with the specified ID.
832
- */
833
- product_id?: string;
834
-
835
- /**
836
- * If provided, the specifier will only apply to products with all the specified
837
- * tags.
838
- */
839
- product_tags?: Array<string>;
840
- }
841
-
842
- /**
843
- * Attach a subscription to the recurring commit/credit.
844
- */
845
- export interface SubscriptionConfig {
846
- allocation: 'INDIVIDUAL' | 'POOLED';
847
-
848
- apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
849
-
850
- subscription_id: string;
851
- }
852
-
853
- export namespace SubscriptionConfig {
854
- export interface ApplySeatIncreaseConfig {
855
- /**
856
- * Indicates whether a mid-period seat increase should be prorated.
857
- */
858
- is_prorated: boolean;
859
- }
860
- }
861
1889
  }
862
1890
 
863
1891
  export interface RecurringCredit {
@@ -915,7 +1943,7 @@ export namespace ContractWithoutAmendments {
915
1943
  /**
916
1944
  * Optional configuration for recurring commit/credit hierarchy access control
917
1945
  */
918
- hierarchy_configuration?: RecurringCredit.HierarchyConfiguration;
1946
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
919
1947
 
920
1948
  /**
921
1949
  * Displayed on invoices. Will be passed through to the individual commits
@@ -954,12 +1982,12 @@ export namespace ContractWithoutAmendments {
954
1982
  * or credit. A customer's usage needs to meet the condition of at least one of the
955
1983
  * specifiers to contribute to a commit's or credit's drawdown.
956
1984
  */
957
- specifiers?: Array<RecurringCredit.Specifier>;
1985
+ specifiers?: Array<Shared.CommitSpecifier>;
958
1986
 
959
1987
  /**
960
1988
  * Attach a subscription to the recurring commit/credit.
961
1989
  */
962
- subscription_config?: RecurringCredit.SubscriptionConfig;
1990
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
963
1991
  }
964
1992
 
965
1993
  export namespace RecurringCredit {
@@ -992,69 +2020,6 @@ export namespace ContractWithoutAmendments {
992
2020
  export interface Contract {
993
2021
  id: string;
994
2022
  }
995
-
996
- /**
997
- * Optional configuration for recurring commit/credit hierarchy access control
998
- */
999
- export interface HierarchyConfiguration {
1000
- child_access:
1001
- | HierarchyConfiguration.CommitHierarchyChildAccessAll
1002
- | HierarchyConfiguration.CommitHierarchyChildAccessNone
1003
- | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1004
- }
1005
-
1006
- export namespace HierarchyConfiguration {
1007
- export interface CommitHierarchyChildAccessAll {
1008
- type: 'ALL';
1009
- }
1010
-
1011
- export interface CommitHierarchyChildAccessNone {
1012
- type: 'NONE';
1013
- }
1014
-
1015
- export interface CommitHierarchyChildAccessContractIDs {
1016
- contract_ids: Array<string>;
1017
-
1018
- type: 'CONTRACT_IDS';
1019
- }
1020
- }
1021
-
1022
- export interface Specifier {
1023
- presentation_group_values?: { [key: string]: string };
1024
-
1025
- pricing_group_values?: { [key: string]: string };
1026
-
1027
- /**
1028
- * If provided, the specifier will only apply to the product with the specified ID.
1029
- */
1030
- product_id?: string;
1031
-
1032
- /**
1033
- * If provided, the specifier will only apply to products with all the specified
1034
- * tags.
1035
- */
1036
- product_tags?: Array<string>;
1037
- }
1038
-
1039
- /**
1040
- * Attach a subscription to the recurring commit/credit.
1041
- */
1042
- export interface SubscriptionConfig {
1043
- allocation: 'INDIVIDUAL' | 'POOLED';
1044
-
1045
- apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
1046
-
1047
- subscription_id: string;
1048
- }
1049
-
1050
- export namespace SubscriptionConfig {
1051
- export interface ApplySeatIncreaseConfig {
1052
- /**
1053
- * Indicates whether a mid-period seat increase should be prorated.
1054
- */
1055
- is_prorated: boolean;
1056
- }
1057
- }
1058
2023
  }
1059
2024
 
1060
2025
  export interface ResellerRoyalty {
@@ -1085,105 +2050,6 @@ export namespace ContractWithoutAmendments {
1085
2050
  reseller_contract_value?: number;
1086
2051
  }
1087
2052
 
1088
- export interface SpendThresholdConfiguration {
1089
- commit: SpendThresholdConfiguration.Commit;
1090
-
1091
- /**
1092
- * When set to false, the contract will not be evaluated against the
1093
- * threshold_amount. Toggling to true will result an immediate evaluation,
1094
- * regardless of prior state.
1095
- */
1096
- is_enabled: boolean;
1097
-
1098
- payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
1099
-
1100
- /**
1101
- * Specify the threshold amount for the contract. Each time the contract's usage
1102
- * hits this amount, a threshold charge will be initiated.
1103
- */
1104
- threshold_amount: number;
1105
- }
1106
-
1107
- export namespace SpendThresholdConfiguration {
1108
- export interface Commit {
1109
- /**
1110
- * The commit product that will be used to generate the line item for commit
1111
- * payment.
1112
- */
1113
- product_id: string;
1114
-
1115
- description?: string;
1116
-
1117
- /**
1118
- * Specify the name of the line item for the threshold charge. If left blank, it
1119
- * will default to the commit product name.
1120
- */
1121
- name?: string;
1122
- }
1123
-
1124
- export interface PaymentGateConfig {
1125
- /**
1126
- * Gate access to the commit balance based on successful collection of payment.
1127
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1128
- * facilitate payment using your own payment integration. Select NONE if you do not
1129
- * wish to payment gate the commit balance.
1130
- */
1131
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1132
-
1133
- /**
1134
- * Only applicable if using PRECALCULATED as your tax type.
1135
- */
1136
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1137
-
1138
- /**
1139
- * Only applicable if using STRIPE as your payment gate type.
1140
- */
1141
- stripe_config?: PaymentGateConfig.StripeConfig;
1142
-
1143
- /**
1144
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1145
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1146
- * will default to NONE.
1147
- */
1148
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1149
- }
1150
-
1151
- export namespace PaymentGateConfig {
1152
- /**
1153
- * Only applicable if using PRECALCULATED as your tax type.
1154
- */
1155
- export interface PrecalculatedTaxConfig {
1156
- /**
1157
- * Amount of tax to be applied. This should be in the same currency and
1158
- * denomination as the commit's invoice schedule
1159
- */
1160
- tax_amount: number;
1161
-
1162
- /**
1163
- * Name of the tax to be applied. This may be used in an invoice line item
1164
- * description.
1165
- */
1166
- tax_name?: string;
1167
- }
1168
-
1169
- /**
1170
- * Only applicable if using STRIPE as your payment gate type.
1171
- */
1172
- export interface StripeConfig {
1173
- /**
1174
- * If left blank, will default to INVOICE
1175
- */
1176
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1177
-
1178
- /**
1179
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1180
- * your payment type.
1181
- */
1182
- invoice_metadata?: { [key: string]: string };
1183
- }
1184
- }
1185
- }
1186
-
1187
2053
  export interface UsageFilter {
1188
2054
  current: Shared.BaseUsageFilter | null;
1189
2055
 
@@ -1235,6 +2101,9 @@ export interface Credit {
1235
2101
 
1236
2102
  contract?: Credit.Contract;
1237
2103
 
2104
+ /**
2105
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2106
+ */
1238
2107
  custom_fields?: { [key: string]: string };
1239
2108
 
1240
2109
  description?: string;
@@ -1242,7 +2111,7 @@ export interface Credit {
1242
2111
  /**
1243
2112
  * Optional configuration for credit hierarchy access control
1244
2113
  */
1245
- hierarchy_configuration?: Credit.HierarchyConfiguration;
2114
+ hierarchy_configuration?: CommitHierarchyConfiguration;
1246
2115
 
1247
2116
  /**
1248
2117
  * A list of ordered events that impact the balance of a credit. For example, an
@@ -1283,7 +2152,7 @@ export interface Credit {
1283
2152
  * or credit. A customer's usage needs to meet the condition of at least one of the
1284
2153
  * specifiers to contribute to a commit's or credit's drawdown.
1285
2154
  */
1286
- specifiers?: Array<Credit.Specifier>;
2155
+ specifiers?: Array<CommitSpecifier>;
1287
2156
 
1288
2157
  /**
1289
2158
  * Prevents the creation of duplicates. If a request to create a commit or credit
@@ -1305,32 +2174,6 @@ export namespace Credit {
1305
2174
  id: string;
1306
2175
  }
1307
2176
 
1308
- /**
1309
- * Optional configuration for credit hierarchy access control
1310
- */
1311
- export interface HierarchyConfiguration {
1312
- child_access:
1313
- | HierarchyConfiguration.CommitHierarchyChildAccessAll
1314
- | HierarchyConfiguration.CommitHierarchyChildAccessNone
1315
- | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1316
- }
1317
-
1318
- export namespace HierarchyConfiguration {
1319
- export interface CommitHierarchyChildAccessAll {
1320
- type: 'ALL';
1321
- }
1322
-
1323
- export interface CommitHierarchyChildAccessNone {
1324
- type: 'NONE';
1325
- }
1326
-
1327
- export interface CommitHierarchyChildAccessContractIDs {
1328
- contract_ids: Array<string>;
1329
-
1330
- type: 'CONTRACT_IDS';
1331
- }
1332
- }
1333
-
1334
2177
  export interface CreditSegmentStartLedgerEntry {
1335
2178
  amount: number;
1336
2179
 
@@ -1412,23 +2255,6 @@ export namespace Credit {
1412
2255
 
1413
2256
  type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
1414
2257
  }
1415
-
1416
- export interface Specifier {
1417
- presentation_group_values?: { [key: string]: string };
1418
-
1419
- pricing_group_values?: { [key: string]: string };
1420
-
1421
- /**
1422
- * If provided, the specifier will only apply to the product with the specified ID.
1423
- */
1424
- product_id?: string;
1425
-
1426
- /**
1427
- * If provided, the specifier will only apply to products with all the specified
1428
- * tags.
1429
- */
1430
- product_tags?: Array<string>;
1431
- }
1432
2258
  }
1433
2259
 
1434
2260
  export interface CreditTypeData {
@@ -1444,6 +2270,9 @@ export interface Discount {
1444
2270
 
1445
2271
  schedule: SchedulePointInTime;
1446
2272
 
2273
+ /**
2274
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2275
+ */
1447
2276
  custom_fields?: { [key: string]: string };
1448
2277
 
1449
2278
  name?: string;
@@ -1473,12 +2302,55 @@ export interface EventTypeFilter {
1473
2302
  */
1474
2303
  in_values?: Array<string>;
1475
2304
 
1476
- /**
1477
- * A list of event types that are explicitly excluded from the billable metric. If
1478
- * specified, events of these types will not match the billable metric. Must be
1479
- * non-empty if present.
1480
- */
1481
- not_in_values?: Array<string>;
2305
+ /**
2306
+ * A list of event types that are explicitly excluded from the billable metric. If
2307
+ * specified, events of these types will not match the billable metric. Must be
2308
+ * non-empty if present.
2309
+ */
2310
+ not_in_values?: Array<string>;
2311
+ }
2312
+
2313
+ /**
2314
+ * Either a **parent** configuration with a list of children or a **child**
2315
+ * configuration with a single parent.
2316
+ */
2317
+ export type HierarchyConfiguration =
2318
+ | HierarchyConfiguration.ParentHierarchyConfiguration
2319
+ | HierarchyConfiguration.ChildHierarchyConfiguration;
2320
+
2321
+ export namespace HierarchyConfiguration {
2322
+ export interface ParentHierarchyConfiguration {
2323
+ /**
2324
+ * List of contracts that belong to this parent.
2325
+ */
2326
+ children: Array<ParentHierarchyConfiguration.Child>;
2327
+ }
2328
+
2329
+ export namespace ParentHierarchyConfiguration {
2330
+ export interface Child {
2331
+ contract_id: string;
2332
+
2333
+ customer_id: string;
2334
+ }
2335
+ }
2336
+
2337
+ export interface ChildHierarchyConfiguration {
2338
+ /**
2339
+ * The single parent contract/customer for this child.
2340
+ */
2341
+ parent: ChildHierarchyConfiguration.Parent;
2342
+ }
2343
+
2344
+ export namespace ChildHierarchyConfiguration {
2345
+ /**
2346
+ * The single parent contract/customer for this child.
2347
+ */
2348
+ export interface Parent {
2349
+ contract_id: string;
2350
+
2351
+ customer_id: string;
2352
+ }
2353
+ }
1482
2354
  }
1483
2355
 
1484
2356
  export interface ID {
@@ -1510,9 +2382,9 @@ export interface Override {
1510
2382
 
1511
2383
  override_specifiers?: Array<Override.OverrideSpecifier>;
1512
2384
 
1513
- override_tiers?: Array<Override.OverrideTier>;
2385
+ override_tiers?: Array<OverrideTier>;
1514
2386
 
1515
- overwrite_rate?: Override.OverwriteRate;
2387
+ overwrite_rate?: OverwriteRate;
1516
2388
 
1517
2389
  /**
1518
2390
  * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
@@ -1566,50 +2438,288 @@ export namespace Override {
1566
2438
  recurring_credit_ids?: Array<string>;
1567
2439
  }
1568
2440
 
1569
- export interface OverrideTier {
1570
- multiplier: number;
2441
+ export interface Product {
2442
+ id: string;
1571
2443
 
1572
- size?: number;
2444
+ name: string;
1573
2445
  }
2446
+ }
2447
+
2448
+ export interface OverrideTier {
2449
+ multiplier: number;
2450
+
2451
+ size?: number;
2452
+ }
2453
+
2454
+ export interface OverwriteRate {
2455
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
2456
+
2457
+ credit_type?: CreditTypeData;
2458
+
2459
+ /**
2460
+ * Only set for CUSTOM rate_type. This field is interpreted by custom rate
2461
+ * processors.
2462
+ */
2463
+ custom_rate?: { [key: string]: unknown };
2464
+
2465
+ /**
2466
+ * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
2467
+ * set to true.
2468
+ */
2469
+ is_prorated?: boolean;
2470
+
2471
+ /**
2472
+ * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
2473
+ * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
2474
+ */
2475
+ price?: number;
2476
+
2477
+ /**
2478
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
2479
+ */
2480
+ quantity?: number;
2481
+
2482
+ /**
2483
+ * Only set for TIERED rate_type.
2484
+ */
2485
+ tiers?: Array<Tier>;
2486
+ }
2487
+
2488
+ export interface PaymentGateConfig {
2489
+ /**
2490
+ * Gate access to the commit balance based on successful collection of payment.
2491
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
2492
+ * facilitate payment using your own payment integration. Select NONE if you do not
2493
+ * wish to payment gate the commit balance.
2494
+ */
2495
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
2496
+
2497
+ /**
2498
+ * Only applicable if using PRECALCULATED as your tax type.
2499
+ */
2500
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
2501
+
2502
+ /**
2503
+ * Only applicable if using STRIPE as your payment gate type.
2504
+ */
2505
+ stripe_config?: PaymentGateConfig.StripeConfig;
2506
+
2507
+ /**
2508
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
2509
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
2510
+ * will default to NONE.
2511
+ */
2512
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
2513
+ }
2514
+
2515
+ export namespace PaymentGateConfig {
2516
+ /**
2517
+ * Only applicable if using PRECALCULATED as your tax type.
2518
+ */
2519
+ export interface PrecalculatedTaxConfig {
2520
+ /**
2521
+ * Amount of tax to be applied. This should be in the same currency and
2522
+ * denomination as the commit's invoice schedule
2523
+ */
2524
+ tax_amount: number;
1574
2525
 
1575
- export interface OverwriteRate {
1576
- rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
2526
+ /**
2527
+ * Name of the tax to be applied. This may be used in an invoice line item
2528
+ * description.
2529
+ */
2530
+ tax_name?: string;
2531
+ }
1577
2532
 
1578
- credit_type?: Shared.CreditTypeData;
2533
+ /**
2534
+ * Only applicable if using STRIPE as your payment gate type.
2535
+ */
2536
+ export interface StripeConfig {
2537
+ /**
2538
+ * If left blank, will default to INVOICE
2539
+ */
2540
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1579
2541
 
1580
2542
  /**
1581
- * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1582
- * processors.
2543
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
2544
+ * your payment type.
1583
2545
  */
1584
- custom_rate?: { [key: string]: unknown };
2546
+ invoice_metadata?: { [key: string]: string };
2547
+ }
2548
+ }
2549
+
2550
+ export interface PaymentGateConfigV2 {
2551
+ /**
2552
+ * Gate access to the commit balance based on successful collection of payment.
2553
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
2554
+ * facilitate payment using your own payment integration. Select NONE if you do not
2555
+ * wish to payment gate the commit balance.
2556
+ */
2557
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
2558
+
2559
+ /**
2560
+ * Only applicable if using PRECALCULATED as your tax type.
2561
+ */
2562
+ precalculated_tax_config?: PaymentGateConfigV2.PrecalculatedTaxConfig;
2563
+
2564
+ /**
2565
+ * Only applicable if using STRIPE as your payment gateway type.
2566
+ */
2567
+ stripe_config?: PaymentGateConfigV2.StripeConfig;
1585
2568
 
2569
+ /**
2570
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
2571
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
2572
+ * will default to NONE.
2573
+ */
2574
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
2575
+ }
2576
+
2577
+ export namespace PaymentGateConfigV2 {
2578
+ /**
2579
+ * Only applicable if using PRECALCULATED as your tax type.
2580
+ */
2581
+ export interface PrecalculatedTaxConfig {
1586
2582
  /**
1587
- * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
1588
- * set to true.
2583
+ * Amount of tax to be applied. This should be in the same currency and
2584
+ * denomination as the commit's invoice schedule
1589
2585
  */
1590
- is_prorated?: boolean;
2586
+ tax_amount: number;
1591
2587
 
1592
2588
  /**
1593
- * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
1594
- * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
2589
+ * Name of the tax to be applied. This may be used in an invoice line item
2590
+ * description.
1595
2591
  */
1596
- price?: number;
2592
+ tax_name?: string;
2593
+ }
1597
2594
 
2595
+ /**
2596
+ * Only applicable if using STRIPE as your payment gateway type.
2597
+ */
2598
+ export interface StripeConfig {
1598
2599
  /**
1599
- * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
2600
+ * If left blank, will default to INVOICE
1600
2601
  */
1601
- quantity?: number;
2602
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1602
2603
 
1603
2604
  /**
1604
- * Only set for TIERED rate_type.
2605
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
2606
+ * your payment type.
1605
2607
  */
1606
- tiers?: Array<Shared.Tier>;
2608
+ invoice_metadata?: { [key: string]: string };
1607
2609
  }
2610
+ }
1608
2611
 
1609
- export interface Product {
1610
- id: string;
2612
+ export interface PrepaidBalanceThresholdConfiguration {
2613
+ commit: PrepaidBalanceThresholdConfiguration.Commit;
1611
2614
 
1612
- name: string;
2615
+ /**
2616
+ * When set to false, the contract will not be evaluated against the
2617
+ * threshold_amount. Toggling to true will result an immediate evaluation,
2618
+ * regardless of prior state.
2619
+ */
2620
+ is_enabled: boolean;
2621
+
2622
+ payment_gate_config: PaymentGateConfig;
2623
+
2624
+ /**
2625
+ * Specify the amount the balance should be recharged to.
2626
+ */
2627
+ recharge_to_amount: number;
2628
+
2629
+ /**
2630
+ * Specify the threshold amount for the contract. Each time the contract's prepaid
2631
+ * balance lowers to this amount, a threshold charge will be initiated.
2632
+ */
2633
+ threshold_amount: number;
2634
+
2635
+ /**
2636
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
2637
+ * commit amount will be in terms of this credit type instead of the fiat currency.
2638
+ */
2639
+ custom_credit_type_id?: string;
2640
+ }
2641
+
2642
+ export namespace PrepaidBalanceThresholdConfiguration {
2643
+ export interface Commit extends Shared.BaseThresholdCommit {
2644
+ /**
2645
+ * Which products the threshold commit applies to. If applicable_product_ids,
2646
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2647
+ * all products.
2648
+ */
2649
+ applicable_product_ids?: Array<string>;
2650
+
2651
+ /**
2652
+ * Which tags the threshold commit applies to. If applicable_product_ids,
2653
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2654
+ * all products.
2655
+ */
2656
+ applicable_product_tags?: Array<string>;
2657
+
2658
+ /**
2659
+ * List of filters that determine what kind of customer usage draws down a commit
2660
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2661
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2662
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2663
+ */
2664
+ specifiers?: Array<Shared.CommitSpecifierInput>;
2665
+ }
2666
+ }
2667
+
2668
+ export interface PrepaidBalanceThresholdConfigurationV2 {
2669
+ commit: PrepaidBalanceThresholdConfigurationV2.Commit;
2670
+
2671
+ /**
2672
+ * When set to false, the contract will not be evaluated against the
2673
+ * threshold_amount. Toggling to true will result an immediate evaluation,
2674
+ * regardless of prior state.
2675
+ */
2676
+ is_enabled: boolean;
2677
+
2678
+ payment_gate_config: PaymentGateConfigV2;
2679
+
2680
+ /**
2681
+ * Specify the amount the balance should be recharged to.
2682
+ */
2683
+ recharge_to_amount: number;
2684
+
2685
+ /**
2686
+ * Specify the threshold amount for the contract. Each time the contract's balance
2687
+ * lowers to this amount, a threshold charge will be initiated.
2688
+ */
2689
+ threshold_amount: number;
2690
+
2691
+ /**
2692
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
2693
+ * commit amount will be in terms of this credit type instead of the fiat currency.
2694
+ */
2695
+ custom_credit_type_id?: string;
2696
+ }
2697
+
2698
+ export namespace PrepaidBalanceThresholdConfigurationV2 {
2699
+ export interface Commit extends Shared.UpdateBaseThresholdCommit {
2700
+ /**
2701
+ * Which products the threshold commit applies to. If applicable_product_ids,
2702
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2703
+ * all products.
2704
+ */
2705
+ applicable_product_ids?: Array<string>;
2706
+
2707
+ /**
2708
+ * Which tags the threshold commit applies to. If applicable_product_ids,
2709
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2710
+ * all products.
2711
+ */
2712
+ applicable_product_tags?: Array<string>;
2713
+
2714
+ /**
2715
+ * List of filters that determine what kind of customer usage draws down a commit
2716
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2717
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2718
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2719
+ * Instead, to target usage by product or product tag, pass those values in the
2720
+ * body of `specifiers`.
2721
+ */
2722
+ specifiers?: Array<Shared.CommitSpecifierInput>;
1613
2723
  }
1614
2724
  }
1615
2725
 
@@ -1666,6 +2776,9 @@ export interface ProService {
1666
2776
  */
1667
2777
  unit_price: number;
1668
2778
 
2779
+ /**
2780
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2781
+ */
1669
2782
  custom_fields?: { [key: string]: string };
1670
2783
 
1671
2784
  description?: string;
@@ -1723,6 +2836,23 @@ export interface Rate {
1723
2836
  use_list_prices?: boolean;
1724
2837
  }
1725
2838
 
2839
+ export interface RecurringCommitSubscriptionConfig {
2840
+ allocation: 'INDIVIDUAL' | 'POOLED';
2841
+
2842
+ apply_seat_increase_config: RecurringCommitSubscriptionConfig.ApplySeatIncreaseConfig;
2843
+
2844
+ subscription_id: string;
2845
+ }
2846
+
2847
+ export namespace RecurringCommitSubscriptionConfig {
2848
+ export interface ApplySeatIncreaseConfig {
2849
+ /**
2850
+ * Indicates whether a mid-period seat increase should be prorated.
2851
+ */
2852
+ is_prorated: boolean;
2853
+ }
2854
+ }
2855
+
1726
2856
  export interface ScheduledCharge {
1727
2857
  id: string;
1728
2858
 
@@ -1732,6 +2862,9 @@ export interface ScheduledCharge {
1732
2862
 
1733
2863
  archived_at?: string;
1734
2864
 
2865
+ /**
2866
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2867
+ */
1735
2868
  custom_fields?: { [key: string]: string };
1736
2869
 
1737
2870
  /**
@@ -1774,6 +2907,12 @@ export namespace ScheduleDuration {
1774
2907
  export interface SchedulePointInTime {
1775
2908
  credit_type?: CreditTypeData;
1776
2909
 
2910
+ /**
2911
+ * This field is only applicable to commit invoice schedules. If true, this
2912
+ * schedule will not generate an invoice.
2913
+ */
2914
+ do_not_invoice?: boolean;
2915
+
1777
2916
  schedule_items?: Array<SchedulePointInTime.ScheduleItem>;
1778
2917
  }
1779
2918
 
@@ -1793,8 +2932,135 @@ export namespace SchedulePointInTime {
1793
2932
  }
1794
2933
  }
1795
2934
 
2935
+ export interface SpendThresholdConfiguration {
2936
+ commit: BaseThresholdCommit;
2937
+
2938
+ /**
2939
+ * When set to false, the contract will not be evaluated against the
2940
+ * threshold_amount. Toggling to true will result an immediate evaluation,
2941
+ * regardless of prior state.
2942
+ */
2943
+ is_enabled: boolean;
2944
+
2945
+ payment_gate_config: PaymentGateConfig;
2946
+
2947
+ /**
2948
+ * Specify the threshold amount for the contract. Each time the contract's usage
2949
+ * hits this amount, a threshold charge will be initiated.
2950
+ */
2951
+ threshold_amount: number;
2952
+ }
2953
+
2954
+ export interface SpendThresholdConfigurationV2 {
2955
+ commit: UpdateBaseThresholdCommit;
2956
+
2957
+ /**
2958
+ * When set to false, the contract will not be evaluated against the
2959
+ * threshold_amount. Toggling to true will result an immediate evaluation,
2960
+ * regardless of prior state.
2961
+ */
2962
+ is_enabled: boolean;
2963
+
2964
+ payment_gate_config: PaymentGateConfigV2;
2965
+
2966
+ /**
2967
+ * Specify the threshold amount for the contract. Each time the contract's usage
2968
+ * hits this amount, a threshold charge will be initiated.
2969
+ */
2970
+ threshold_amount: number;
2971
+ }
2972
+
2973
+ export interface Subscription {
2974
+ collection_schedule: 'ADVANCE' | 'ARREARS';
2975
+
2976
+ proration: Subscription.Proration;
2977
+
2978
+ /**
2979
+ * Determines how the subscription's quantity is controlled. Defaults to
2980
+ * QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
2981
+ * directly on the subscription. `initial_quantity` must be provided with this
2982
+ * option. Compatible with recurring commits/credits that use POOLED allocation.
2983
+ */
2984
+ quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY';
2985
+
2986
+ /**
2987
+ * List of quantity schedule items for the subscription. Only includes the current
2988
+ * quantity and future quantity changes.
2989
+ */
2990
+ quantity_schedule: Array<Subscription.QuantitySchedule>;
2991
+
2992
+ starting_at: string;
2993
+
2994
+ subscription_rate: Subscription.SubscriptionRate;
2995
+
2996
+ id?: string;
2997
+
2998
+ /**
2999
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
3000
+ */
3001
+ custom_fields?: { [key: string]: string };
3002
+
3003
+ description?: string;
3004
+
3005
+ ending_before?: string;
3006
+
3007
+ fiat_credit_type_id?: string;
3008
+
3009
+ name?: string;
3010
+ }
3011
+
3012
+ export namespace Subscription {
3013
+ export interface Proration {
3014
+ invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
3015
+
3016
+ is_prorated: boolean;
3017
+ }
3018
+
3019
+ export interface QuantitySchedule {
3020
+ quantity: number;
3021
+
3022
+ starting_at: string;
3023
+
3024
+ ending_before?: string;
3025
+ }
3026
+
3027
+ export interface SubscriptionRate {
3028
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
3029
+
3030
+ product: SubscriptionRate.Product;
3031
+ }
3032
+
3033
+ export namespace SubscriptionRate {
3034
+ export interface Product {
3035
+ id: string;
3036
+
3037
+ name: string;
3038
+ }
3039
+ }
3040
+ }
3041
+
1796
3042
  export interface Tier {
1797
3043
  price: number;
1798
3044
 
1799
3045
  size?: number;
1800
3046
  }
3047
+
3048
+ export interface UpdateBaseThresholdCommit {
3049
+ description?: string;
3050
+
3051
+ /**
3052
+ * Specify the name of the line item for the threshold charge. If left blank, it
3053
+ * will default to the commit product name.
3054
+ */
3055
+ name?: string;
3056
+
3057
+ /**
3058
+ * The commit product that will be used to generate the line item for commit
3059
+ * payment.
3060
+ */
3061
+ product_id?: string;
3062
+ }
3063
+
3064
+ export type CommitsBodyCursorPage = BodyCursorPage<Commit>;
3065
+
3066
+ export type CreditsBodyCursorPage = BodyCursorPage<Credit>;