@metronome/sdk 0.3.0 → 2.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 (817) hide show
  1. package/CHANGELOG.md +113 -28
  2. package/README.md +123 -51
  3. package/api-promise.d.mts +2 -0
  4. package/api-promise.d.mts.map +1 -0
  5. package/api-promise.d.ts +2 -0
  6. package/api-promise.d.ts.map +1 -0
  7. package/api-promise.js +6 -0
  8. package/api-promise.js.map +1 -0
  9. package/api-promise.mjs +2 -0
  10. package/api-promise.mjs.map +1 -0
  11. package/bin/cli +46 -0
  12. package/bin/migration-config.json +6 -0
  13. package/client.d.mts +232 -0
  14. package/client.d.mts.map +1 -0
  15. package/client.d.ts +232 -0
  16. package/client.d.ts.map +1 -0
  17. package/client.js +464 -0
  18. package/client.js.map +1 -0
  19. package/client.mjs +460 -0
  20. package/client.mjs.map +1 -0
  21. package/core/api-promise.d.mts +46 -0
  22. package/core/api-promise.d.mts.map +1 -0
  23. package/core/api-promise.d.ts +46 -0
  24. package/core/api-promise.d.ts.map +1 -0
  25. package/core/api-promise.js +74 -0
  26. package/core/api-promise.js.map +1 -0
  27. package/core/api-promise.mjs +70 -0
  28. package/core/api-promise.mjs.map +1 -0
  29. package/core/error.d.mts +46 -0
  30. package/core/error.d.mts.map +1 -0
  31. package/core/error.d.ts +46 -0
  32. package/core/error.d.ts.map +1 -0
  33. package/core/error.js +113 -0
  34. package/core/error.js.map +1 -0
  35. package/core/error.mjs +97 -0
  36. package/core/error.mjs.map +1 -0
  37. package/core/pagination.d.mts +137 -0
  38. package/core/pagination.d.mts.map +1 -0
  39. package/core/pagination.d.ts +137 -0
  40. package/core/pagination.d.ts.map +1 -0
  41. package/core/pagination.js +158 -0
  42. package/core/pagination.js.map +1 -0
  43. package/core/pagination.mjs +150 -0
  44. package/core/pagination.mjs.map +1 -0
  45. package/core/resource.d.mts +6 -0
  46. package/core/resource.d.mts.map +1 -0
  47. package/core/resource.d.ts +6 -0
  48. package/core/resource.d.ts.map +1 -0
  49. package/core/resource.js +11 -0
  50. package/core/resource.js.map +1 -0
  51. package/core/resource.mjs +7 -0
  52. package/core/resource.mjs.map +1 -0
  53. package/core/uploads.d.mts +3 -0
  54. package/core/uploads.d.mts.map +1 -0
  55. package/core/uploads.d.ts +3 -0
  56. package/core/uploads.d.ts.map +1 -0
  57. package/core/uploads.js +6 -0
  58. package/core/uploads.js.map +1 -0
  59. package/core/uploads.mjs +2 -0
  60. package/core/uploads.mjs.map +1 -0
  61. package/error.d.mts +2 -0
  62. package/error.d.mts.map +1 -0
  63. package/error.d.ts +1 -46
  64. package/error.d.ts.map +1 -1
  65. package/error.js +3 -110
  66. package/error.js.map +1 -1
  67. package/error.mjs +1 -96
  68. package/error.mjs.map +1 -1
  69. package/index.d.mts +7 -144
  70. package/index.d.mts.map +1 -0
  71. package/index.d.ts +6 -143
  72. package/index.d.ts.map +1 -1
  73. package/index.js +14 -120
  74. package/index.js.map +1 -1
  75. package/index.mjs +6 -93
  76. package/index.mjs.map +1 -1
  77. package/internal/builtin-types.d.mts +73 -0
  78. package/internal/builtin-types.d.mts.map +1 -0
  79. package/internal/builtin-types.d.ts +73 -0
  80. package/internal/builtin-types.d.ts.map +1 -0
  81. package/internal/builtin-types.js +4 -0
  82. package/internal/builtin-types.js.map +1 -0
  83. package/internal/builtin-types.mjs +3 -0
  84. package/internal/builtin-types.mjs.map +1 -0
  85. package/internal/detect-platform.d.mts +15 -0
  86. package/internal/detect-platform.d.mts.map +1 -0
  87. package/internal/detect-platform.d.ts +15 -0
  88. package/internal/detect-platform.d.ts.map +1 -0
  89. package/internal/detect-platform.js +162 -0
  90. package/internal/detect-platform.js.map +1 -0
  91. package/internal/detect-platform.mjs +157 -0
  92. package/internal/detect-platform.mjs.map +1 -0
  93. package/internal/errors.d.mts +3 -0
  94. package/internal/errors.d.mts.map +1 -0
  95. package/internal/errors.d.ts +3 -0
  96. package/internal/errors.d.ts.map +1 -0
  97. package/internal/errors.js +41 -0
  98. package/internal/errors.js.map +1 -0
  99. package/internal/errors.mjs +36 -0
  100. package/internal/errors.mjs.map +1 -0
  101. package/internal/headers.d.mts +26 -0
  102. package/internal/headers.d.mts.map +1 -0
  103. package/internal/headers.d.ts +26 -0
  104. package/internal/headers.d.ts.map +1 -0
  105. package/internal/headers.js +120 -0
  106. package/internal/headers.js.map +1 -0
  107. package/internal/headers.mjs +112 -0
  108. package/internal/headers.mjs.map +1 -0
  109. package/internal/parse.d.mts +12 -0
  110. package/internal/parse.d.mts.map +1 -0
  111. package/internal/parse.d.ts +12 -0
  112. package/internal/parse.d.ts.map +1 -0
  113. package/internal/parse.js +35 -0
  114. package/internal/parse.js.map +1 -0
  115. package/internal/parse.mjs +32 -0
  116. package/internal/parse.mjs.map +1 -0
  117. package/internal/qs/formats.d.mts +7 -0
  118. package/internal/qs/formats.d.mts.map +1 -0
  119. package/internal/qs/formats.d.ts +1 -0
  120. package/internal/qs/formats.d.ts.map +1 -1
  121. package/internal/qs/formats.js +4 -2
  122. package/internal/qs/formats.js.map +1 -1
  123. package/internal/qs/formats.mjs +2 -1
  124. package/internal/qs/formats.mjs.map +1 -1
  125. package/internal/qs/index.d.mts +10 -0
  126. package/internal/qs/index.d.mts.map +1 -0
  127. package/internal/qs/index.d.ts.map +1 -1
  128. package/internal/qs/stringify.d.mts +3 -0
  129. package/internal/qs/stringify.d.mts.map +1 -0
  130. package/internal/qs/stringify.d.ts.map +1 -1
  131. package/internal/qs/stringify.js +16 -19
  132. package/internal/qs/stringify.js.map +1 -1
  133. package/internal/qs/stringify.mjs +17 -19
  134. package/internal/qs/stringify.mjs.map +1 -1
  135. package/internal/qs/types.d.mts +57 -0
  136. package/internal/qs/types.d.mts.map +1 -0
  137. package/internal/qs/utils.d.mts +15 -0
  138. package/internal/qs/utils.d.mts.map +1 -0
  139. package/internal/qs/utils.d.ts +1 -0
  140. package/internal/qs/utils.d.ts.map +1 -1
  141. package/internal/qs/utils.js +22 -21
  142. package/internal/qs/utils.js.map +1 -1
  143. package/internal/qs/utils.mjs +12 -12
  144. package/internal/qs/utils.mjs.map +1 -1
  145. package/internal/request-options.d.mts +75 -0
  146. package/internal/request-options.d.mts.map +1 -0
  147. package/internal/request-options.d.ts +75 -0
  148. package/internal/request-options.d.ts.map +1 -0
  149. package/internal/request-options.js +14 -0
  150. package/internal/request-options.js.map +1 -0
  151. package/internal/request-options.mjs +10 -0
  152. package/internal/request-options.mjs.map +1 -0
  153. package/internal/shim-types.d.mts +17 -0
  154. package/internal/shim-types.d.mts.map +1 -0
  155. package/internal/shim-types.d.ts +17 -0
  156. package/internal/shim-types.d.ts.map +1 -0
  157. package/internal/shim-types.js +4 -0
  158. package/internal/shim-types.js.map +1 -0
  159. package/internal/shim-types.mjs +3 -0
  160. package/internal/shim-types.mjs.map +1 -0
  161. package/internal/shims.d.mts +20 -0
  162. package/internal/shims.d.mts.map +1 -0
  163. package/internal/shims.d.ts +20 -0
  164. package/internal/shims.d.ts.map +1 -0
  165. package/internal/shims.js +92 -0
  166. package/internal/shims.js.map +1 -0
  167. package/internal/shims.mjs +85 -0
  168. package/internal/shims.mjs.map +1 -0
  169. package/internal/to-file.d.mts +45 -0
  170. package/internal/to-file.d.mts.map +1 -0
  171. package/internal/to-file.d.ts +45 -0
  172. package/internal/to-file.d.ts.map +1 -0
  173. package/internal/to-file.js +91 -0
  174. package/internal/to-file.js.map +1 -0
  175. package/internal/to-file.mjs +88 -0
  176. package/internal/to-file.mjs.map +1 -0
  177. package/internal/tslib.js +81 -0
  178. package/internal/tslib.mjs +17 -0
  179. package/internal/types.d.mts +69 -0
  180. package/internal/types.d.mts.map +1 -0
  181. package/internal/types.d.ts +69 -0
  182. package/internal/types.d.ts.map +1 -0
  183. package/internal/types.js +4 -0
  184. package/internal/types.js.map +1 -0
  185. package/internal/types.mjs +3 -0
  186. package/internal/types.mjs.map +1 -0
  187. package/internal/uploads.d.mts +42 -0
  188. package/internal/uploads.d.mts.map +1 -0
  189. package/internal/uploads.d.ts +42 -0
  190. package/internal/uploads.d.ts.map +1 -0
  191. package/internal/uploads.js +141 -0
  192. package/internal/uploads.js.map +1 -0
  193. package/internal/uploads.mjs +131 -0
  194. package/internal/uploads.mjs.map +1 -0
  195. package/internal/utils/base64.d.mts +3 -0
  196. package/internal/utils/base64.d.mts.map +1 -0
  197. package/internal/utils/base64.d.ts +3 -0
  198. package/internal/utils/base64.d.ts.map +1 -0
  199. package/internal/utils/base64.js +38 -0
  200. package/internal/utils/base64.js.map +1 -0
  201. package/internal/utils/base64.mjs +33 -0
  202. package/internal/utils/base64.mjs.map +1 -0
  203. package/internal/utils/bytes.d.mts +4 -0
  204. package/internal/utils/bytes.d.mts.map +1 -0
  205. package/internal/utils/bytes.d.ts +4 -0
  206. package/internal/utils/bytes.d.ts.map +1 -0
  207. package/internal/utils/bytes.js +31 -0
  208. package/internal/utils/bytes.js.map +1 -0
  209. package/internal/utils/bytes.mjs +26 -0
  210. package/internal/utils/bytes.mjs.map +1 -0
  211. package/internal/utils/env.d.mts +9 -0
  212. package/internal/utils/env.d.mts.map +1 -0
  213. package/internal/utils/env.d.ts +9 -0
  214. package/internal/utils/env.d.ts.map +1 -0
  215. package/internal/utils/env.js +22 -0
  216. package/internal/utils/env.js.map +1 -0
  217. package/internal/utils/env.mjs +18 -0
  218. package/internal/utils/env.mjs.map +1 -0
  219. package/internal/utils/log.d.mts +37 -0
  220. package/internal/utils/log.d.mts.map +1 -0
  221. package/internal/utils/log.d.ts +37 -0
  222. package/internal/utils/log.d.ts.map +1 -0
  223. package/internal/utils/log.js +85 -0
  224. package/internal/utils/log.js.map +1 -0
  225. package/internal/utils/log.mjs +79 -0
  226. package/internal/utils/log.mjs.map +1 -0
  227. package/internal/utils/path.d.mts +15 -0
  228. package/internal/utils/path.d.mts.map +1 -0
  229. package/internal/utils/path.d.ts +15 -0
  230. package/internal/utils/path.d.ts.map +1 -0
  231. package/internal/utils/path.js +79 -0
  232. package/internal/utils/path.js.map +1 -0
  233. package/internal/utils/path.mjs +74 -0
  234. package/internal/utils/path.mjs.map +1 -0
  235. package/internal/utils/sleep.d.mts +2 -0
  236. package/internal/utils/sleep.d.mts.map +1 -0
  237. package/internal/utils/sleep.d.ts +2 -0
  238. package/internal/utils/sleep.d.ts.map +1 -0
  239. package/internal/utils/sleep.js +7 -0
  240. package/internal/utils/sleep.js.map +1 -0
  241. package/internal/utils/sleep.mjs +3 -0
  242. package/internal/utils/sleep.mjs.map +1 -0
  243. package/internal/utils/uuid.d.mts +5 -0
  244. package/internal/utils/uuid.d.mts.map +1 -0
  245. package/internal/utils/uuid.d.ts +5 -0
  246. package/internal/utils/uuid.d.ts.map +1 -0
  247. package/internal/utils/uuid.js +19 -0
  248. package/internal/utils/uuid.js.map +1 -0
  249. package/internal/utils/uuid.mjs +15 -0
  250. package/internal/utils/uuid.mjs.map +1 -0
  251. package/internal/utils/values.d.mts +18 -0
  252. package/internal/utils/values.d.mts.map +1 -0
  253. package/internal/utils/values.d.ts +18 -0
  254. package/internal/utils/values.d.ts.map +1 -0
  255. package/internal/utils/values.js +112 -0
  256. package/internal/utils/values.js.map +1 -0
  257. package/internal/utils/values.mjs +94 -0
  258. package/internal/utils/values.mjs.map +1 -0
  259. package/internal/utils.d.mts +7 -0
  260. package/internal/utils.d.mts.map +1 -0
  261. package/internal/utils.d.ts +7 -0
  262. package/internal/utils.d.ts.map +1 -0
  263. package/internal/utils.js +11 -0
  264. package/internal/utils.js.map +1 -0
  265. package/internal/utils.mjs +8 -0
  266. package/internal/utils.mjs.map +1 -0
  267. package/package.json +113 -64
  268. package/pagination.d.mts +2 -0
  269. package/pagination.d.mts.map +1 -0
  270. package/pagination.d.ts +1 -36
  271. package/pagination.d.ts.map +1 -1
  272. package/pagination.js +3 -40
  273. package/pagination.js.map +1 -1
  274. package/pagination.mjs +1 -38
  275. package/pagination.mjs.map +1 -1
  276. package/resource.d.mts +2 -0
  277. package/resource.d.mts.map +1 -0
  278. package/resource.d.ts +1 -5
  279. package/resource.d.ts.map +1 -1
  280. package/resource.js +3 -8
  281. package/resource.js.map +1 -1
  282. package/resource.mjs +1 -6
  283. package/resource.mjs.map +1 -1
  284. package/resources/index.d.mts +5 -0
  285. package/resources/index.d.mts.map +1 -0
  286. package/resources/index.d.ts.map +1 -1
  287. package/resources/index.js +2 -15
  288. package/resources/index.js.map +1 -1
  289. package/resources/shared.d.mts +2363 -0
  290. package/resources/shared.d.mts.map +1 -0
  291. package/resources/shared.d.ts +1470 -465
  292. package/resources/shared.d.ts.map +1 -1
  293. package/resources/v1/alerts.d.mts +207 -0
  294. package/resources/v1/alerts.d.mts.map +1 -0
  295. package/resources/v1/alerts.d.ts +107 -32
  296. package/resources/v1/alerts.d.ts.map +1 -1
  297. package/resources/v1/alerts.js +74 -3
  298. package/resources/v1/alerts.js.map +1 -1
  299. package/resources/v1/alerts.mjs +74 -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 +3006 -0
  318. package/resources/v1/contracts/contracts.d.mts.map +1 -0
  319. package/resources/v1/contracts/contracts.d.ts +428 -1299
  320. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  321. package/resources/v1/contracts/contracts.js +269 -50
  322. package/resources/v1/contracts/contracts.js.map +1 -1
  323. package/resources/v1/contracts/contracts.mjs +267 -26
  324. package/resources/v1/contracts/contracts.mjs.map +1 -1
  325. package/resources/v1/contracts/index.d.mts +5 -0
  326. package/resources/v1/contracts/index.d.mts.map +1 -0
  327. package/resources/v1/contracts/index.d.ts +3 -3
  328. package/resources/v1/contracts/index.d.ts.map +1 -1
  329. package/resources/v1/contracts/index.js +1 -3
  330. package/resources/v1/contracts/index.js.map +1 -1
  331. package/resources/v1/contracts/index.mjs +2 -2
  332. package/resources/v1/contracts/index.mjs.map +1 -1
  333. package/resources/v1/contracts/named-schedules.d.mts +82 -0
  334. package/resources/v1/contracts/named-schedules.d.mts.map +1 -0
  335. package/resources/v1/contracts/named-schedules.d.ts +5 -4
  336. package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
  337. package/resources/v1/contracts/named-schedules.js +3 -2
  338. package/resources/v1/contracts/named-schedules.js.map +1 -1
  339. package/resources/v1/contracts/named-schedules.mjs +3 -2
  340. package/resources/v1/contracts/named-schedules.mjs.map +1 -1
  341. package/resources/v1/contracts/products.d.mts +502 -0
  342. package/resources/v1/contracts/products.d.mts.map +1 -0
  343. package/resources/v1/contracts/products.d.ts +44 -17
  344. package/resources/v1/contracts/products.d.ts.map +1 -1
  345. package/resources/v1/contracts/products.js +41 -17
  346. package/resources/v1/contracts/products.js.map +1 -1
  347. package/resources/v1/contracts/products.mjs +40 -15
  348. package/resources/v1/contracts/products.mjs.map +1 -1
  349. package/resources/v1/contracts/rate-cards/index.d.mts +5 -0
  350. package/resources/v1/contracts/rate-cards/index.d.mts.map +1 -0
  351. package/resources/v1/contracts/rate-cards/index.d.ts +2 -2
  352. package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
  353. package/resources/v1/contracts/rate-cards/index.js +1 -3
  354. package/resources/v1/contracts/rate-cards/index.js.map +1 -1
  355. package/resources/v1/contracts/rate-cards/index.mjs +2 -2
  356. package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
  357. package/resources/v1/contracts/rate-cards/named-schedules.d.mts +94 -0
  358. package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -0
  359. package/resources/v1/contracts/rate-cards/named-schedules.d.ts +5 -4
  360. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
  361. package/resources/v1/contracts/rate-cards/named-schedules.js +3 -2
  362. package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
  363. package/resources/v1/contracts/rate-cards/named-schedules.mjs +3 -2
  364. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
  365. package/resources/v1/contracts/rate-cards/product-orders.d.mts +85 -0
  366. package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -0
  367. package/resources/v1/contracts/rate-cards/product-orders.d.ts +12 -6
  368. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
  369. package/resources/v1/contracts/rate-cards/product-orders.js +8 -3
  370. package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
  371. package/resources/v1/contracts/rate-cards/product-orders.mjs +8 -3
  372. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
  373. package/resources/v1/contracts/rate-cards/rate-cards.d.mts +452 -0
  374. package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -0
  375. package/resources/v1/contracts/rate-cards/rate-cards.d.ts +134 -41
  376. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
  377. package/resources/v1/contracts/rate-cards/rate-cards.js +127 -47
  378. package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
  379. package/resources/v1/contracts/rate-cards/rate-cards.mjs +123 -20
  380. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
  381. package/resources/v1/contracts/rate-cards/rates.d.mts +382 -0
  382. package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -0
  383. package/resources/v1/contracts/rate-cards/rates.d.ts +25 -82
  384. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  385. package/resources/v1/contracts/rate-cards/rates.js +13 -9
  386. package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
  387. package/resources/v1/contracts/rate-cards/rates.mjs +12 -7
  388. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  389. package/resources/v1/contracts/rate-cards.d.mts +2 -0
  390. package/resources/v1/contracts/rate-cards.d.mts.map +1 -0
  391. package/resources/v1/contracts/rate-cards.d.ts.map +1 -1
  392. package/resources/v1/contracts/rate-cards.js +2 -15
  393. package/resources/v1/contracts/rate-cards.js.map +1 -1
  394. package/resources/v1/contracts.d.mts +2 -0
  395. package/resources/v1/contracts.d.mts.map +1 -0
  396. package/resources/v1/contracts.d.ts.map +1 -1
  397. package/resources/v1/contracts.js +2 -15
  398. package/resources/v1/contracts.js.map +1 -1
  399. package/resources/v1/credit-grants.d.mts +505 -0
  400. package/resources/v1/credit-grants.d.mts.map +1 -0
  401. package/resources/v1/credit-grants.d.ts +73 -74
  402. package/resources/v1/credit-grants.d.ts.map +1 -1
  403. package/resources/v1/credit-grants.js +52 -18
  404. package/resources/v1/credit-grants.js.map +1 -1
  405. package/resources/v1/credit-grants.mjs +51 -16
  406. package/resources/v1/credit-grants.mjs.map +1 -1
  407. package/resources/v1/custom-fields.d.mts +151 -0
  408. package/resources/v1/custom-fields.d.mts.map +1 -0
  409. package/resources/v1/custom-fields.d.ts +69 -38
  410. package/resources/v1/custom-fields.d.ts.map +1 -1
  411. package/resources/v1/custom-fields.js +66 -22
  412. package/resources/v1/custom-fields.js.map +1 -1
  413. package/resources/v1/custom-fields.mjs +66 -22
  414. package/resources/v1/custom-fields.mjs.map +1 -1
  415. package/resources/v1/customers/alerts.d.mts +309 -0
  416. package/resources/v1/customers/alerts.d.mts.map +1 -0
  417. package/resources/v1/customers/alerts.d.ts +176 -50
  418. package/resources/v1/customers/alerts.d.ts.map +1 -1
  419. package/resources/v1/customers/alerts.js +131 -10
  420. package/resources/v1/customers/alerts.js.map +1 -1
  421. package/resources/v1/customers/alerts.mjs +131 -10
  422. package/resources/v1/customers/alerts.mjs.map +1 -1
  423. package/resources/v1/customers/billing-config.d.mts +125 -0
  424. package/resources/v1/customers/billing-config.d.mts.map +1 -0
  425. package/resources/v1/customers/billing-config.d.ts +8 -7
  426. package/resources/v1/customers/billing-config.d.ts.map +1 -1
  427. package/resources/v1/customers/billing-config.js +8 -6
  428. package/resources/v1/customers/billing-config.js.map +1 -1
  429. package/resources/v1/customers/billing-config.mjs +8 -6
  430. package/resources/v1/customers/billing-config.mjs.map +1 -1
  431. package/resources/v1/customers/commits.d.mts +456 -0
  432. package/resources/v1/customers/commits.d.mts.map +1 -0
  433. package/resources/v1/customers/commits.d.ts +139 -47
  434. package/resources/v1/customers/commits.d.ts.map +1 -1
  435. package/resources/v1/customers/commits.js +131 -12
  436. package/resources/v1/customers/commits.js.map +1 -1
  437. package/resources/v1/customers/commits.mjs +131 -12
  438. package/resources/v1/customers/commits.mjs.map +1 -1
  439. package/resources/v1/customers/credits.d.mts +310 -0
  440. package/resources/v1/customers/credits.d.mts.map +1 -0
  441. package/resources/v1/customers/credits.d.ts +124 -46
  442. package/resources/v1/customers/credits.d.ts.map +1 -1
  443. package/resources/v1/customers/credits.js +116 -11
  444. package/resources/v1/customers/credits.js.map +1 -1
  445. package/resources/v1/customers/credits.mjs +116 -11
  446. package/resources/v1/customers/credits.mjs.map +1 -1
  447. package/resources/v1/customers/customers.d.mts +819 -0
  448. package/resources/v1/customers/customers.d.mts.map +1 -0
  449. package/resources/v1/customers/customers.d.ts +319 -55
  450. package/resources/v1/customers/customers.d.ts.map +1 -1
  451. package/resources/v1/customers/customers.js +220 -76
  452. package/resources/v1/customers/customers.js.map +1 -1
  453. package/resources/v1/customers/customers.mjs +213 -44
  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 +825 -0
  464. package/resources/v1/customers/invoices.d.mts.map +1 -0
  465. package/resources/v1/customers/invoices.d.ts +309 -25
  466. package/resources/v1/customers/invoices.d.ts.map +1 -1
  467. package/resources/v1/customers/invoices.js +180 -22
  468. package/resources/v1/customers/invoices.js.map +1 -1
  469. package/resources/v1/customers/invoices.mjs +179 -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 +16 -0
  501. package/resources/v1/index.d.mts.map +1 -0
  502. package/resources/v1/index.d.ts +10 -9
  503. package/resources/v1/index.d.ts.map +1 -1
  504. package/resources/v1/index.js +3 -12
  505. package/resources/v1/index.js.map +1 -1
  506. package/resources/v1/index.mjs +8 -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/payments.d.mts +116 -0
  517. package/resources/v1/payments.d.mts.map +1 -0
  518. package/resources/v1/payments.d.ts +116 -0
  519. package/resources/v1/payments.d.ts.map +1 -0
  520. package/resources/v1/payments.js +71 -0
  521. package/resources/v1/payments.js.map +1 -0
  522. package/resources/v1/payments.mjs +67 -0
  523. package/resources/v1/payments.mjs.map +1 -0
  524. package/resources/v1/plans.d.mts +240 -0
  525. package/resources/v1/plans.d.mts.map +1 -0
  526. package/resources/v1/plans.d.ts +24 -15
  527. package/resources/v1/plans.d.ts.map +1 -1
  528. package/resources/v1/plans.js +19 -26
  529. package/resources/v1/plans.js.map +1 -1
  530. package/resources/v1/plans.mjs +18 -22
  531. package/resources/v1/plans.mjs.map +1 -1
  532. package/resources/v1/pricing-units.d.mts +34 -0
  533. package/resources/v1/pricing-units.d.mts.map +1 -0
  534. package/resources/v1/pricing-units.d.ts +12 -9
  535. package/resources/v1/pricing-units.d.ts.map +1 -1
  536. package/resources/v1/pricing-units.js +20 -12
  537. package/resources/v1/pricing-units.js.map +1 -1
  538. package/resources/v1/pricing-units.mjs +19 -10
  539. package/resources/v1/pricing-units.mjs.map +1 -1
  540. package/resources/v1/services.d.mts +33 -0
  541. package/resources/v1/services.d.mts.map +1 -0
  542. package/resources/v1/services.d.ts +10 -7
  543. package/resources/v1/services.d.ts.map +1 -1
  544. package/resources/v1/services.js +7 -5
  545. package/resources/v1/services.js.map +1 -1
  546. package/resources/v1/services.mjs +7 -5
  547. package/resources/v1/services.mjs.map +1 -1
  548. package/resources/v1/usage.d.mts +490 -0
  549. package/resources/v1/usage.d.mts.map +1 -0
  550. package/resources/v1/usage.d.ts +223 -58
  551. package/resources/v1/usage.d.ts.map +1 -1
  552. package/resources/v1/usage.js +214 -26
  553. package/resources/v1/usage.js.map +1 -1
  554. package/resources/v1/usage.mjs +213 -24
  555. package/resources/v1/usage.mjs.map +1 -1
  556. package/resources/v1/v1.d.mts +62 -0
  557. package/resources/v1/v1.d.mts.map +1 -0
  558. package/resources/v1/v1.d.ts +19 -15
  559. package/resources/v1/v1.d.ts.map +1 -1
  560. package/resources/v1/v1.js +19 -48
  561. package/resources/v1/v1.js.map +1 -1
  562. package/resources/v1/v1.mjs +12 -19
  563. package/resources/v1/v1.mjs.map +1 -1
  564. package/resources/v1.d.mts +2 -0
  565. package/resources/v1.d.mts.map +1 -0
  566. package/resources/v1.d.ts.map +1 -1
  567. package/resources/v1.js +2 -15
  568. package/resources/v1.js.map +1 -1
  569. package/resources/v2/contracts.d.mts +2900 -0
  570. package/resources/v2/contracts.d.mts.map +1 -0
  571. package/resources/v2/contracts.d.ts +399 -3830
  572. package/resources/v2/contracts.d.ts.map +1 -1
  573. package/resources/v2/contracts.js +102 -12
  574. package/resources/v2/contracts.js.map +1 -1
  575. package/resources/v2/contracts.mjs +102 -12
  576. package/resources/v2/contracts.mjs.map +1 -1
  577. package/resources/v2/index.d.mts +3 -0
  578. package/resources/v2/index.d.mts.map +1 -0
  579. package/resources/v2/index.d.ts.map +1 -1
  580. package/resources/v2/v2.d.mts +10 -0
  581. package/resources/v2/v2.d.mts.map +1 -0
  582. package/resources/v2/v2.d.ts +1 -1
  583. package/resources/v2/v2.d.ts.map +1 -1
  584. package/resources/v2/v2.js +3 -25
  585. package/resources/v2/v2.js.map +1 -1
  586. package/resources/v2/v2.mjs +1 -1
  587. package/resources/v2.d.mts +2 -0
  588. package/resources/v2.d.mts.map +1 -0
  589. package/resources/v2.d.ts.map +1 -1
  590. package/resources/v2.js +2 -15
  591. package/resources/v2.js.map +1 -1
  592. package/resources/webhooks.d.mts +22 -0
  593. package/resources/webhooks.d.mts.map +1 -0
  594. package/resources/webhooks.d.ts +1 -1
  595. package/resources/webhooks.d.ts.map +1 -1
  596. package/resources/webhooks.js +3 -3
  597. package/resources/webhooks.js.map +1 -1
  598. package/resources/webhooks.mjs +1 -1
  599. package/resources/webhooks.mjs.map +1 -1
  600. package/resources.d.mts +2 -0
  601. package/resources.d.mts.map +1 -0
  602. package/resources.d.ts.map +1 -1
  603. package/resources.js +2 -15
  604. package/resources.js.map +1 -1
  605. package/src/api-promise.ts +2 -0
  606. package/src/client.ts +809 -0
  607. package/src/core/README.md +3 -0
  608. package/src/core/api-promise.ts +92 -0
  609. package/src/core/error.ts +130 -0
  610. package/src/core/pagination.ts +319 -0
  611. package/src/core/resource.ts +11 -0
  612. package/src/core/uploads.ts +2 -0
  613. package/src/error.ts +2 -130
  614. package/src/index.ts +6 -221
  615. package/src/internal/README.md +3 -0
  616. package/src/internal/builtin-types.ts +93 -0
  617. package/src/internal/detect-platform.ts +196 -0
  618. package/src/internal/errors.ts +33 -0
  619. package/src/internal/headers.ts +144 -0
  620. package/src/internal/parse.ts +50 -0
  621. package/src/internal/qs/formats.ts +3 -2
  622. package/src/internal/qs/index.ts +3 -3
  623. package/src/internal/qs/stringify.ts +18 -21
  624. package/src/internal/qs/utils.ts +16 -16
  625. package/src/internal/request-options.ts +91 -0
  626. package/src/internal/shim-types.ts +26 -0
  627. package/src/internal/shims.ts +107 -0
  628. package/src/internal/to-file.ts +154 -0
  629. package/src/internal/types.ts +95 -0
  630. package/src/internal/uploads.ts +187 -0
  631. package/src/internal/utils/base64.ts +40 -0
  632. package/src/internal/utils/bytes.ts +32 -0
  633. package/src/internal/utils/env.ts +18 -0
  634. package/src/internal/utils/log.ts +126 -0
  635. package/src/internal/utils/path.ts +88 -0
  636. package/src/internal/utils/sleep.ts +3 -0
  637. package/src/internal/utils/uuid.ts +17 -0
  638. package/src/internal/utils/values.ts +105 -0
  639. package/src/internal/utils.ts +8 -0
  640. package/src/pagination.ts +2 -82
  641. package/src/resource.ts +2 -11
  642. package/src/resources/index.ts +4 -4
  643. package/src/resources/shared.ts +1921 -506
  644. package/src/resources/v1/alerts.ts +108 -33
  645. package/src/resources/v1/audit-logs.ts +48 -26
  646. package/src/resources/v1/billable-metrics.ts +79 -34
  647. package/src/resources/v1/contracts/contracts.ts +490 -1632
  648. package/src/resources/v1/contracts/index.ts +7 -6
  649. package/src/resources/v1/contracts/named-schedules.ts +8 -6
  650. package/src/resources/v1/contracts/products.ts +50 -38
  651. package/src/resources/v1/contracts/rate-cards/index.ts +6 -6
  652. package/src/resources/v1/contracts/rate-cards/named-schedules.ts +8 -6
  653. package/src/resources/v1/contracts/rate-cards/product-orders.ts +13 -10
  654. package/src/resources/v1/contracts/rate-cards/rate-cards.ts +145 -72
  655. package/src/resources/v1/contracts/rate-cards/rates.ts +28 -98
  656. package/src/resources/v1/contracts/rate-cards.ts +1 -1
  657. package/src/resources/v1/contracts.ts +1 -1
  658. package/src/resources/v1/credit-grants.ts +100 -112
  659. package/src/resources/v1/custom-fields.ts +106 -74
  660. package/src/resources/v1/customers/alerts.ts +195 -55
  661. package/src/resources/v1/customers/billing-config.ts +27 -13
  662. package/src/resources/v1/customers/commits.ts +146 -54
  663. package/src/resources/v1/customers/credits.ts +131 -53
  664. package/src/resources/v1/customers/customers.ts +407 -115
  665. package/src/resources/v1/customers/index.ts +20 -18
  666. package/src/resources/v1/customers/invoices.ts +343 -42
  667. package/src/resources/v1/customers/named-schedules.ts +8 -6
  668. package/src/resources/v1/customers/plans.ts +24 -22
  669. package/src/resources/v1/customers.ts +1 -1
  670. package/src/resources/v1/dashboards.ts +34 -7
  671. package/src/resources/v1/index.ts +43 -25
  672. package/src/resources/v1/invoices.ts +28 -9
  673. package/src/resources/v1/payments.ts +170 -0
  674. package/src/resources/v1/plans.ts +42 -43
  675. package/src/resources/v1/pricing-units.ts +15 -23
  676. package/src/resources/v1/services.ts +10 -7
  677. package/src/resources/v1/usage.ts +247 -73
  678. package/src/resources/v1/v1.ts +78 -49
  679. package/src/resources/v1.ts +1 -1
  680. package/src/resources/v2/contracts.ts +469 -4930
  681. package/src/resources/v2/index.ts +2 -2
  682. package/src/resources/v2/v2.ts +3 -3
  683. package/src/resources/v2.ts +1 -1
  684. package/src/resources/webhooks.ts +2 -2
  685. package/src/resources.ts +1 -1
  686. package/src/tsconfig.json +2 -2
  687. package/src/uploads.ts +2 -255
  688. package/src/version.ts +1 -1
  689. package/uploads.d.mts +2 -0
  690. package/uploads.d.mts.map +1 -0
  691. package/uploads.d.ts +1 -74
  692. package/uploads.d.ts.map +1 -1
  693. package/uploads.js +3 -168
  694. package/uploads.js.map +1 -1
  695. package/uploads.mjs +1 -157
  696. package/uploads.mjs.map +1 -1
  697. package/version.d.mts +2 -0
  698. package/version.d.mts.map +1 -0
  699. package/version.d.ts +1 -1
  700. package/version.js +1 -1
  701. package/version.mjs +1 -1
  702. package/_shims/MultipartBody.d.ts +0 -9
  703. package/_shims/MultipartBody.d.ts.map +0 -1
  704. package/_shims/MultipartBody.js +0 -16
  705. package/_shims/MultipartBody.js.map +0 -1
  706. package/_shims/MultipartBody.mjs +0 -12
  707. package/_shims/MultipartBody.mjs.map +0 -1
  708. package/_shims/README.md +0 -46
  709. package/_shims/auto/runtime-bun.d.ts +0 -5
  710. package/_shims/auto/runtime-bun.d.ts.map +0 -1
  711. package/_shims/auto/runtime-bun.js +0 -21
  712. package/_shims/auto/runtime-bun.js.map +0 -1
  713. package/_shims/auto/runtime-bun.mjs +0 -2
  714. package/_shims/auto/runtime-bun.mjs.map +0 -1
  715. package/_shims/auto/runtime-node.d.ts +0 -5
  716. package/_shims/auto/runtime-node.d.ts.map +0 -1
  717. package/_shims/auto/runtime-node.js +0 -21
  718. package/_shims/auto/runtime-node.js.map +0 -1
  719. package/_shims/auto/runtime-node.mjs +0 -2
  720. package/_shims/auto/runtime-node.mjs.map +0 -1
  721. package/_shims/auto/runtime.d.ts +0 -5
  722. package/_shims/auto/runtime.d.ts.map +0 -1
  723. package/_shims/auto/runtime.js +0 -21
  724. package/_shims/auto/runtime.js.map +0 -1
  725. package/_shims/auto/runtime.mjs +0 -2
  726. package/_shims/auto/runtime.mjs.map +0 -1
  727. package/_shims/auto/types-node.d.ts +0 -5
  728. package/_shims/auto/types-node.d.ts.map +0 -1
  729. package/_shims/auto/types-node.js +0 -21
  730. package/_shims/auto/types-node.js.map +0 -1
  731. package/_shims/auto/types-node.mjs +0 -2
  732. package/_shims/auto/types-node.mjs.map +0 -1
  733. package/_shims/auto/types.d.ts +0 -101
  734. package/_shims/auto/types.js +0 -3
  735. package/_shims/auto/types.mjs +0 -3
  736. package/_shims/bun-runtime.d.ts +0 -6
  737. package/_shims/bun-runtime.d.ts.map +0 -1
  738. package/_shims/bun-runtime.js +0 -14
  739. package/_shims/bun-runtime.js.map +0 -1
  740. package/_shims/bun-runtime.mjs +0 -10
  741. package/_shims/bun-runtime.mjs.map +0 -1
  742. package/_shims/index.d.ts +0 -83
  743. package/_shims/index.js +0 -17
  744. package/_shims/index.mjs +0 -11
  745. package/_shims/manual-types.d.ts +0 -12
  746. package/_shims/manual-types.js +0 -3
  747. package/_shims/manual-types.mjs +0 -3
  748. package/_shims/node-runtime.d.ts +0 -3
  749. package/_shims/node-runtime.d.ts.map +0 -1
  750. package/_shims/node-runtime.js +0 -89
  751. package/_shims/node-runtime.js.map +0 -1
  752. package/_shims/node-runtime.mjs +0 -56
  753. package/_shims/node-runtime.mjs.map +0 -1
  754. package/_shims/node-types.d.ts +0 -42
  755. package/_shims/node-types.js +0 -3
  756. package/_shims/node-types.mjs +0 -3
  757. package/_shims/registry.d.ts +0 -37
  758. package/_shims/registry.d.ts.map +0 -1
  759. package/_shims/registry.js +0 -41
  760. package/_shims/registry.js.map +0 -1
  761. package/_shims/registry.mjs +0 -37
  762. package/_shims/registry.mjs.map +0 -1
  763. package/_shims/web-runtime.d.ts +0 -5
  764. package/_shims/web-runtime.d.ts.map +0 -1
  765. package/_shims/web-runtime.js +0 -78
  766. package/_shims/web-runtime.js.map +0 -1
  767. package/_shims/web-runtime.mjs +0 -71
  768. package/_shims/web-runtime.mjs.map +0 -1
  769. package/_shims/web-types.d.ts +0 -83
  770. package/_shims/web-types.js +0 -3
  771. package/_shims/web-types.mjs +0 -3
  772. package/core.d.ts +0 -255
  773. package/core.d.ts.map +0 -1
  774. package/core.js +0 -924
  775. package/core.js.map +0 -1
  776. package/core.mjs +0 -892
  777. package/core.mjs.map +0 -1
  778. package/shims/node.d.ts +0 -30
  779. package/shims/node.d.ts.map +0 -1
  780. package/shims/node.js +0 -31
  781. package/shims/node.js.map +0 -1
  782. package/shims/node.mjs +0 -5
  783. package/shims/node.mjs.map +0 -1
  784. package/shims/web.d.ts +0 -26
  785. package/shims/web.d.ts.map +0 -1
  786. package/shims/web.js +0 -31
  787. package/shims/web.js.map +0 -1
  788. package/shims/web.mjs +0 -5
  789. package/shims/web.mjs.map +0 -1
  790. package/src/_shims/MultipartBody.ts +0 -9
  791. package/src/_shims/README.md +0 -46
  792. package/src/_shims/auto/runtime-bun.ts +0 -4
  793. package/src/_shims/auto/runtime-node.ts +0 -4
  794. package/src/_shims/auto/runtime.ts +0 -4
  795. package/src/_shims/auto/types-node.ts +0 -4
  796. package/src/_shims/auto/types.d.ts +0 -101
  797. package/src/_shims/auto/types.js +0 -3
  798. package/src/_shims/auto/types.mjs +0 -3
  799. package/src/_shims/bun-runtime.ts +0 -14
  800. package/src/_shims/index.d.ts +0 -83
  801. package/src/_shims/index.js +0 -17
  802. package/src/_shims/index.mjs +0 -11
  803. package/src/_shims/manual-types.d.ts +0 -12
  804. package/src/_shims/manual-types.js +0 -3
  805. package/src/_shims/manual-types.mjs +0 -3
  806. package/src/_shims/node-runtime.ts +0 -81
  807. package/src/_shims/node-types.d.ts +0 -42
  808. package/src/_shims/node-types.js +0 -3
  809. package/src/_shims/node-types.mjs +0 -3
  810. package/src/_shims/registry.ts +0 -67
  811. package/src/_shims/web-runtime.ts +0 -103
  812. package/src/_shims/web-types.d.ts +0 -83
  813. package/src/_shims/web-types.js +0 -3
  814. package/src/_shims/web-types.mjs +0 -3
  815. package/src/core.ts +0 -1236
  816. package/src/shims/node.ts +0 -50
  817. package/src/shims/web.ts +0 -50
@@ -1,4 +1,18 @@
1
1
  import * as Shared from "./shared.js";
2
+ import { BodyCursorPage } from "../core/pagination.js";
3
+ export interface BaseThresholdCommit {
4
+ /**
5
+ * The commit product that will be used to generate the line item for commit
6
+ * payment.
7
+ */
8
+ product_id: string;
9
+ description?: string;
10
+ /**
11
+ * Specify the name of the line item for the threshold charge. If left blank, it
12
+ * will default to the commit product name.
13
+ */
14
+ name?: string;
15
+ }
2
16
  export interface BaseUsageFilter {
3
17
  group_key: string;
4
18
  group_values: Array<string>;
@@ -6,6 +20,14 @@ export interface BaseUsageFilter {
6
20
  }
7
21
  export interface Commit {
8
22
  id: string;
23
+ /**
24
+ * Timestamp of when the commit was created.
25
+ *
26
+ * - Recurring commits: latter of commit service period date and parent commit
27
+ * start date
28
+ * - Rollover commits: when the new contract started
29
+ */
30
+ created_at: string;
9
31
  product: Commit.Product;
10
32
  type: 'PREPAID' | 'POSTPAID';
11
33
  /**
@@ -37,6 +59,9 @@ export interface Commit {
37
59
  */
38
60
  balance?: number;
39
61
  contract?: Commit.Contract;
62
+ /**
63
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
64
+ */
40
65
  custom_fields?: {
41
66
  [key: string]: string;
42
67
  };
@@ -44,7 +69,7 @@ export interface Commit {
44
69
  /**
45
70
  * Optional configuration for commit hierarchy access control
46
71
  */
47
- hierarchy_configuration?: Commit.HierarchyConfiguration;
72
+ hierarchy_configuration?: CommitHierarchyConfiguration;
48
73
  /**
49
74
  * The contract that this commit will be billed on.
50
75
  */
@@ -80,7 +105,7 @@ export interface Commit {
80
105
  * or credit. A customer's usage needs to meet the condition of at least one of the
81
106
  * specifiers to contribute to a commit's or credit's drawdown.
82
107
  */
83
- specifiers?: Array<Commit.Specifier>;
108
+ specifiers?: Array<CommitSpecifier>;
84
109
  /**
85
110
  * Prevents the creation of duplicates. If a request to create a commit or credit
86
111
  * is made with a uniqueness key that was previously used to create a commit or
@@ -97,24 +122,6 @@ export declare namespace Commit {
97
122
  interface Contract {
98
123
  id: string;
99
124
  }
100
- /**
101
- * Optional configuration for commit hierarchy access control
102
- */
103
- interface HierarchyConfiguration {
104
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
105
- }
106
- namespace HierarchyConfiguration {
107
- interface CommitHierarchyChildAccessAll {
108
- type: 'ALL';
109
- }
110
- interface CommitHierarchyChildAccessNone {
111
- type: 'NONE';
112
- }
113
- interface CommitHierarchyChildAccessContractIDs {
114
- contract_ids: Array<string>;
115
- type: 'CONTRACT_IDS';
116
- }
117
- }
118
125
  /**
119
126
  * The contract that this commit will be billed on.
120
127
  */
@@ -218,22 +225,994 @@ export declare namespace Commit {
218
225
  commit_id: string;
219
226
  contract_id: string;
220
227
  }
221
- interface Specifier {
222
- presentation_group_values?: {
223
- [key: string]: string;
224
- };
225
- pricing_group_values?: {
226
- [key: string]: string;
227
- };
228
+ }
229
+ export interface CommitHierarchyConfiguration {
230
+ child_access: CommitHierarchyConfiguration.CommitHierarchyChildAccessAll | CommitHierarchyConfiguration.CommitHierarchyChildAccessNone | CommitHierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
231
+ }
232
+ export declare namespace CommitHierarchyConfiguration {
233
+ interface CommitHierarchyChildAccessAll {
234
+ type: 'ALL';
235
+ }
236
+ interface CommitHierarchyChildAccessNone {
237
+ type: 'NONE';
238
+ }
239
+ interface CommitHierarchyChildAccessContractIDs {
240
+ contract_ids: Array<string>;
241
+ type: 'CONTRACT_IDS';
242
+ }
243
+ }
244
+ /**
245
+ * A distinct rate on the rate card. You can choose to use this rate rather than
246
+ * list rate when consuming a credit or commit.
247
+ */
248
+ export interface CommitRate {
249
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
250
+ /**
251
+ * Commit rate price. For FLAT rate_type, this must be >=0.
252
+ */
253
+ price?: number;
254
+ /**
255
+ * Only set for TIERED rate_type.
256
+ */
257
+ tiers?: Array<Tier>;
258
+ }
259
+ export interface CommitSpecifier {
260
+ presentation_group_values?: {
261
+ [key: string]: string;
262
+ };
263
+ pricing_group_values?: {
264
+ [key: string]: string;
265
+ };
266
+ /**
267
+ * If provided, the specifier will only apply to the product with the specified ID.
268
+ */
269
+ product_id?: string;
270
+ /**
271
+ * If provided, the specifier will only apply to products with all the specified
272
+ * tags.
273
+ */
274
+ product_tags?: Array<string>;
275
+ }
276
+ export interface CommitSpecifierInput {
277
+ presentation_group_values?: {
278
+ [key: string]: string;
279
+ };
280
+ pricing_group_values?: {
281
+ [key: string]: string;
282
+ };
283
+ /**
284
+ * If provided, the specifier will only apply to the product with the specified ID.
285
+ */
286
+ product_id?: string;
287
+ /**
288
+ * If provided, the specifier will only apply to products with all the specified
289
+ * tags.
290
+ */
291
+ product_tags?: Array<string>;
292
+ }
293
+ export interface Contract {
294
+ id: string;
295
+ amendments: Array<Contract.Amendment>;
296
+ current: ContractWithoutAmendments;
297
+ customer_id: string;
298
+ initial: ContractWithoutAmendments;
299
+ /**
300
+ * RFC 3339 timestamp indicating when the contract was archived. If not returned,
301
+ * the contract is not archived.
302
+ */
303
+ archived_at?: string;
304
+ /**
305
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
306
+ */
307
+ custom_fields?: {
308
+ [key: string]: string;
309
+ };
310
+ /**
311
+ * The billing provider configuration associated with a contract.
312
+ */
313
+ customer_billing_provider_configuration?: Contract.CustomerBillingProviderConfiguration;
314
+ prepaid_balance_threshold_configuration?: PrepaidBalanceThresholdConfiguration;
315
+ /**
316
+ * Priority of the contract.
317
+ */
318
+ priority?: number;
319
+ /**
320
+ * Determines which scheduled and commit charges to consolidate onto the Contract's
321
+ * usage invoice. The charge's `timestamp` must match the usage invoice's
322
+ * `ending_before` date for consolidation to occur. This field cannot be modified
323
+ * after a Contract has been created. If this field is omitted, charges will appear
324
+ * on a separate invoice from usage charges.
325
+ */
326
+ scheduled_charges_on_usage_invoices?: 'ALL';
327
+ spend_threshold_configuration?: SpendThresholdConfiguration;
328
+ /**
329
+ * List of subscriptions on the contract.
330
+ */
331
+ subscriptions?: Array<Subscription>;
332
+ /**
333
+ * Prevents the creation of duplicates. If a request to create a record is made
334
+ * with a previously used uniqueness key, a new record will not be created and the
335
+ * request will fail with a 409 error.
336
+ */
337
+ uniqueness_key?: string;
338
+ }
339
+ export declare namespace Contract {
340
+ interface Amendment {
341
+ id: string;
342
+ commits: Array<Shared.Commit>;
343
+ created_at: string;
344
+ created_by: string;
345
+ overrides: Array<Shared.Override>;
346
+ scheduled_charges: Array<Shared.ScheduledCharge>;
347
+ starting_at: string;
348
+ credits?: Array<Shared.Credit>;
349
+ /**
350
+ * This field's availability is dependent on your client's configuration.
351
+ */
352
+ discounts?: Array<Shared.Discount>;
353
+ /**
354
+ * This field's availability is dependent on your client's configuration.
355
+ */
356
+ netsuite_sales_order_id?: string;
357
+ /**
358
+ * This field's availability is dependent on your client's configuration.
359
+ */
360
+ professional_services?: Array<Shared.ProService>;
361
+ /**
362
+ * This field's availability is dependent on your client's configuration.
363
+ */
364
+ reseller_royalties?: Array<Amendment.ResellerRoyalty>;
365
+ /**
366
+ * This field's availability is dependent on your client's configuration.
367
+ */
368
+ salesforce_opportunity_id?: string;
369
+ }
370
+ namespace Amendment {
371
+ interface ResellerRoyalty {
372
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
373
+ aws_account_number?: string;
374
+ aws_offer_id?: string;
375
+ aws_payer_reference_id?: string;
376
+ ending_before?: string | null;
377
+ fraction?: number;
378
+ gcp_account_id?: string;
379
+ gcp_offer_id?: string;
380
+ netsuite_reseller_id?: string;
381
+ reseller_contract_value?: number;
382
+ starting_at?: string;
383
+ }
384
+ }
385
+ /**
386
+ * The billing provider configuration associated with a contract.
387
+ */
388
+ interface CustomerBillingProviderConfiguration {
389
+ archived_at: string | null;
390
+ billing_provider: 'aws_marketplace' | 'stripe' | 'netsuite' | 'custom' | 'azure_marketplace' | 'quickbooks_online' | 'workday' | 'gcp_marketplace';
391
+ delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
392
+ id?: string;
393
+ /**
394
+ * Configuration for the billing provider. The structure of this object is specific
395
+ * to the billing provider.
396
+ */
397
+ configuration?: {
398
+ [key: string]: unknown;
399
+ };
400
+ }
401
+ }
402
+ export interface ContractV2 {
403
+ id: string;
404
+ commits: Array<ContractV2.Commit>;
405
+ created_at: string;
406
+ created_by: string;
407
+ customer_id: string;
408
+ overrides: Array<ContractV2.Override>;
409
+ scheduled_charges: Array<ScheduledCharge>;
410
+ starting_at: string;
411
+ transitions: Array<ContractV2.Transition>;
412
+ usage_filter: Array<ContractV2.UsageFilter>;
413
+ usage_statement_schedule: ContractV2.UsageStatementSchedule;
414
+ archived_at?: string;
415
+ credits?: Array<ContractV2.Credit>;
416
+ /**
417
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
418
+ */
419
+ custom_fields?: {
420
+ [key: string]: string;
421
+ };
422
+ /**
423
+ * This field's availability is dependent on your client's configuration.
424
+ */
425
+ customer_billing_provider_configuration?: ContractV2.CustomerBillingProviderConfiguration;
426
+ /**
427
+ * This field's availability is dependent on your client's configuration.
428
+ */
429
+ discounts?: Array<Discount>;
430
+ ending_before?: string;
431
+ /**
432
+ * Indicates whether there are more items than the limit for this endpoint. Use the
433
+ * respective list endpoints to get the full lists.
434
+ */
435
+ has_more?: ContractV2.HasMore;
436
+ /**
437
+ * Either a **parent** configuration with a list of children or a **child**
438
+ * configuration with a single parent.
439
+ */
440
+ hierarchy_configuration?: ContractV2.ParentHierarchyConfiguration | ContractV2.ChildHierarchyConfigurationV2;
441
+ /**
442
+ * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
443
+ * prices automatically. EXPLICIT prioritization requires specifying priorities for
444
+ * each multiplier; the one with the lowest priority value will be prioritized
445
+ * first.
446
+ */
447
+ multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';
448
+ name?: string;
449
+ net_payment_terms_days?: number;
450
+ /**
451
+ * This field's availability is dependent on your client's configuration.
452
+ */
453
+ netsuite_sales_order_id?: string;
454
+ prepaid_balance_threshold_configuration?: PrepaidBalanceThresholdConfigurationV2;
455
+ /**
456
+ * Priority of the contract.
457
+ */
458
+ priority?: number;
459
+ /**
460
+ * This field's availability is dependent on your client's configuration.
461
+ */
462
+ professional_services?: Array<ProService>;
463
+ rate_card_id?: string;
464
+ recurring_commits?: Array<ContractV2.RecurringCommit>;
465
+ recurring_credits?: Array<ContractV2.RecurringCredit>;
466
+ /**
467
+ * This field's availability is dependent on your client's configuration.
468
+ */
469
+ reseller_royalties?: Array<ContractV2.ResellerRoyalty>;
470
+ /**
471
+ * This field's availability is dependent on your client's configuration.
472
+ */
473
+ salesforce_opportunity_id?: string;
474
+ /**
475
+ * Determines which scheduled and commit charges to consolidate onto the Contract's
476
+ * usage invoice. The charge's `timestamp` must match the usage invoice's
477
+ * `ending_before` date for consolidation to occur. This field cannot be modified
478
+ * after a Contract has been created. If this field is omitted, charges will appear
479
+ * on a separate invoice from usage charges.
480
+ */
481
+ scheduled_charges_on_usage_invoices?: 'ALL';
482
+ spend_threshold_configuration?: SpendThresholdConfigurationV2;
483
+ /**
484
+ * List of subscriptions on the contract.
485
+ */
486
+ subscriptions?: Array<Subscription>;
487
+ total_contract_value?: number;
488
+ /**
489
+ * Optional uniqueness key to prevent duplicate contract creations.
490
+ */
491
+ uniqueness_key?: string;
492
+ }
493
+ export declare namespace ContractV2 {
494
+ interface Commit {
495
+ id: string;
496
+ /**
497
+ * Timestamp of when the commit was created.
498
+ *
499
+ * - Recurring commits: latter of commit service period date and parent commit
500
+ * start date
501
+ * - Rollover commits: when the new contract started
502
+ */
503
+ created_at: string;
504
+ product: Commit.Product;
505
+ type: 'PREPAID' | 'POSTPAID';
506
+ /**
507
+ * The schedule that the customer will gain access to the credits purposed with
508
+ * this commit.
509
+ */
510
+ access_schedule?: Shared.ScheduleDuration;
511
+ applicable_contract_ids?: Array<string>;
512
+ applicable_product_ids?: Array<string>;
513
+ applicable_product_tags?: Array<string>;
514
+ archived_at?: string;
515
+ /**
516
+ * The current balance of the credit or commit. This balance reflects the amount of
517
+ * credit or commit that the customer has access to use at this moment - thus,
518
+ * expired and upcoming credit or commit segments contribute 0 to the balance. The
519
+ * balance will match the sum of all ledger entries with the exception of the case
520
+ * where the sum of negative manual ledger entries exceeds the positive amount
521
+ * remaining on the credit or commit - in that case, the balance will be 0. All
522
+ * manual ledger entries associated with active credit or commit segments are
523
+ * included in the balance, including future-dated manual ledger entries.
524
+ */
525
+ balance?: number;
526
+ contract?: Commit.Contract;
527
+ /**
528
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
529
+ */
530
+ custom_fields?: {
531
+ [key: string]: string;
532
+ };
533
+ description?: string;
534
+ /**
535
+ * Optional configuration for commit hierarchy access control
536
+ */
537
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
538
+ /**
539
+ * The contract that this commit will be billed on.
540
+ */
541
+ invoice_contract?: Commit.InvoiceContract;
542
+ /**
543
+ * The schedule that the customer will be invoiced for this commit.
544
+ */
545
+ invoice_schedule?: Shared.SchedulePointInTime;
546
+ /**
547
+ * A list of ordered events that impact the balance of a commit. For example, an
548
+ * invoice deduction or a rollover.
549
+ */
550
+ ledger?: Array<Commit.PrepaidCommitSegmentStartLedgerEntry | Commit.PrepaidCommitAutomatedInvoiceDeductionLedgerEntry | Commit.PrepaidCommitRolloverLedgerEntry | Commit.PrepaidCommitExpirationLedgerEntry | Commit.PrepaidCommitCanceledLedgerEntry | Commit.PrepaidCommitCreditedLedgerEntry | Commit.PrepaidCommitSeatBasedAdjustmentLedgerEntry | Commit.PostpaidCommitInitialBalanceLedgerEntry | Commit.PostpaidCommitAutomatedInvoiceDeductionLedgerEntry | Commit.PostpaidCommitRolloverLedgerEntry | Commit.PostpaidCommitTrueupLedgerEntry | Commit.PrepaidCommitManualLedgerEntry | Commit.PostpaidCommitManualLedgerEntry | Commit.PostpaidCommitExpirationLedgerEntry>;
551
+ name?: string;
552
+ /**
553
+ * This field's availability is dependent on your client's configuration.
554
+ */
555
+ netsuite_sales_order_id?: string;
556
+ /**
557
+ * If multiple credits or commits are applicable, the one with the lower priority
558
+ * will apply first.
559
+ */
560
+ priority?: number;
561
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
562
+ rolled_over_from?: Commit.RolledOverFrom;
563
+ rollover_fraction?: number;
564
+ /**
565
+ * This field's availability is dependent on your client's configuration.
566
+ */
567
+ salesforce_opportunity_id?: string;
568
+ /**
569
+ * List of filters that determine what kind of customer usage draws down a commit
570
+ * or credit. A customer's usage needs to meet the condition of at least one of the
571
+ * specifiers to contribute to a commit's or credit's drawdown.
572
+ */
573
+ specifiers?: Array<Shared.CommitSpecifier>;
574
+ }
575
+ namespace Commit {
576
+ interface Product {
577
+ id: string;
578
+ name: string;
579
+ }
580
+ interface Contract {
581
+ id: string;
582
+ }
583
+ /**
584
+ * The contract that this commit will be billed on.
585
+ */
586
+ interface InvoiceContract {
587
+ id: string;
588
+ }
589
+ interface PrepaidCommitSegmentStartLedgerEntry {
590
+ amount: number;
591
+ segment_id: string;
592
+ timestamp: string;
593
+ type: 'PREPAID_COMMIT_SEGMENT_START';
594
+ }
595
+ interface PrepaidCommitAutomatedInvoiceDeductionLedgerEntry {
596
+ amount: number;
597
+ invoice_id: string;
598
+ segment_id: string;
599
+ timestamp: string;
600
+ type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
601
+ contract_id?: string;
602
+ }
603
+ interface PrepaidCommitRolloverLedgerEntry {
604
+ amount: number;
605
+ new_contract_id: string;
606
+ segment_id: string;
607
+ timestamp: string;
608
+ type: 'PREPAID_COMMIT_ROLLOVER';
609
+ }
610
+ interface PrepaidCommitExpirationLedgerEntry {
611
+ amount: number;
612
+ segment_id: string;
613
+ timestamp: string;
614
+ type: 'PREPAID_COMMIT_EXPIRATION';
615
+ }
616
+ interface PrepaidCommitCanceledLedgerEntry {
617
+ amount: number;
618
+ invoice_id: string;
619
+ segment_id: string;
620
+ timestamp: string;
621
+ type: 'PREPAID_COMMIT_CANCELED';
622
+ contract_id?: string;
623
+ }
624
+ interface PrepaidCommitCreditedLedgerEntry {
625
+ amount: number;
626
+ invoice_id: string;
627
+ segment_id: string;
628
+ timestamp: string;
629
+ type: 'PREPAID_COMMIT_CREDITED';
630
+ contract_id?: string;
631
+ }
632
+ interface PrepaidCommitSeatBasedAdjustmentLedgerEntry {
633
+ amount: number;
634
+ segment_id: string;
635
+ timestamp: string;
636
+ type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT';
637
+ }
638
+ interface PostpaidCommitInitialBalanceLedgerEntry {
639
+ amount: number;
640
+ timestamp: string;
641
+ type: 'POSTPAID_COMMIT_INITIAL_BALANCE';
642
+ }
643
+ interface PostpaidCommitAutomatedInvoiceDeductionLedgerEntry {
644
+ amount: number;
645
+ invoice_id: string;
646
+ segment_id: string;
647
+ timestamp: string;
648
+ type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
649
+ contract_id?: string;
650
+ }
651
+ interface PostpaidCommitRolloverLedgerEntry {
652
+ amount: number;
653
+ new_contract_id: string;
654
+ segment_id: string;
655
+ timestamp: string;
656
+ type: 'POSTPAID_COMMIT_ROLLOVER';
657
+ }
658
+ interface PostpaidCommitTrueupLedgerEntry {
659
+ amount: number;
660
+ invoice_id: string;
661
+ timestamp: string;
662
+ type: 'POSTPAID_COMMIT_TRUEUP';
663
+ contract_id?: string;
664
+ }
665
+ interface PrepaidCommitManualLedgerEntry {
666
+ amount: number;
667
+ reason: string;
668
+ timestamp: string;
669
+ type: 'PREPAID_COMMIT_MANUAL';
670
+ }
671
+ interface PostpaidCommitManualLedgerEntry {
672
+ amount: number;
673
+ reason: string;
674
+ timestamp: string;
675
+ type: 'POSTPAID_COMMIT_MANUAL';
676
+ }
677
+ interface PostpaidCommitExpirationLedgerEntry {
678
+ amount: number;
679
+ timestamp: string;
680
+ type: 'POSTPAID_COMMIT_EXPIRATION';
681
+ }
682
+ interface RolledOverFrom {
683
+ commit_id: string;
684
+ contract_id: string;
685
+ }
686
+ }
687
+ interface Override {
688
+ id: string;
689
+ starting_at: string;
690
+ applicable_product_tags?: Array<string>;
691
+ ending_before?: string;
692
+ entitled?: boolean;
693
+ is_commit_specific?: boolean;
694
+ multiplier?: number;
695
+ override_specifiers?: Array<Override.OverrideSpecifier>;
696
+ override_tiers?: Array<Shared.OverrideTier>;
697
+ overwrite_rate?: Override.OverwriteRate;
698
+ priority?: number;
699
+ product?: Override.Product;
700
+ target?: 'COMMIT_RATE' | 'LIST_RATE';
701
+ type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
702
+ }
703
+ namespace Override {
704
+ interface OverrideSpecifier {
705
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
706
+ commit_ids?: Array<string>;
707
+ presentation_group_values?: {
708
+ [key: string]: string | null;
709
+ };
710
+ pricing_group_values?: {
711
+ [key: string]: string;
712
+ };
713
+ product_id?: string;
714
+ product_tags?: Array<string>;
715
+ recurring_commit_ids?: Array<string>;
716
+ recurring_credit_ids?: Array<string>;
717
+ }
718
+ interface OverwriteRate {
719
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
720
+ credit_type?: Shared.CreditTypeData;
721
+ /**
722
+ * Only set for CUSTOM rate_type. This field is interpreted by custom rate
723
+ * processors.
724
+ */
725
+ custom_rate?: {
726
+ [key: string]: unknown;
727
+ };
728
+ /**
729
+ * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
730
+ * set to true.
731
+ */
732
+ is_prorated?: boolean;
733
+ /**
734
+ * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
735
+ * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
736
+ */
737
+ price?: number;
738
+ /**
739
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
740
+ */
741
+ quantity?: number;
742
+ /**
743
+ * Only set for TIERED rate_type.
744
+ */
745
+ tiers?: Array<Shared.Tier>;
746
+ }
747
+ interface Product {
748
+ id: string;
749
+ name: string;
750
+ }
751
+ }
752
+ interface Transition {
753
+ from_contract_id: string;
754
+ to_contract_id: string;
755
+ type: 'SUPERSEDE' | 'RENEWAL';
756
+ }
757
+ interface UsageFilter {
758
+ group_key: string;
759
+ group_values: Array<string>;
760
+ /**
761
+ * This will match contract starting_at value if usage filter is active from the
762
+ * beginning of the contract.
763
+ */
764
+ starting_at: string;
765
+ /**
766
+ * This will match contract ending_before value if usage filter is active until the
767
+ * end of the contract. It will be undefined if the contract is open-ended.
768
+ */
769
+ ending_before?: string;
770
+ }
771
+ interface UsageStatementSchedule {
772
+ /**
773
+ * Contract usage statements follow a selected cadence based on this date.
774
+ */
775
+ billing_anchor_date: string;
776
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
777
+ }
778
+ interface Credit {
779
+ id: string;
780
+ product: Credit.Product;
781
+ type: 'CREDIT';
782
+ /**
783
+ * The schedule that the customer will gain access to the credits.
784
+ */
785
+ access_schedule?: Shared.ScheduleDuration;
786
+ applicable_contract_ids?: Array<string>;
787
+ applicable_product_ids?: Array<string>;
788
+ applicable_product_tags?: Array<string>;
789
+ /**
790
+ * The current balance of the credit or commit. This balance reflects the amount of
791
+ * credit or commit that the customer has access to use at this moment - thus,
792
+ * expired and upcoming credit or commit segments contribute 0 to the balance. The
793
+ * balance will match the sum of all ledger entries with the exception of the case
794
+ * where the sum of negative manual ledger entries exceeds the positive amount
795
+ * remaining on the credit or commit - in that case, the balance will be 0. All
796
+ * manual ledger entries associated with active credit or commit segments are
797
+ * included in the balance, including future-dated manual ledger entries.
798
+ */
799
+ balance?: number;
800
+ contract?: Credit.Contract;
801
+ /**
802
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
803
+ */
804
+ custom_fields?: {
805
+ [key: string]: string;
806
+ };
807
+ description?: string;
808
+ /**
809
+ * Optional configuration for credit hierarchy access control
810
+ */
811
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
812
+ /**
813
+ * A list of ordered events that impact the balance of a credit. For example, an
814
+ * invoice deduction or an expiration.
815
+ */
816
+ ledger?: Array<Credit.CreditSegmentStartLedgerEntry | Credit.CreditAutomatedInvoiceDeductionLedgerEntry | Credit.CreditExpirationLedgerEntry | Credit.CreditCanceledLedgerEntry | Credit.CreditCreditedLedgerEntry | Credit.CreditManualLedgerEntry | Credit.CreditSeatBasedAdjustmentLedgerEntry>;
817
+ name?: string;
818
+ /**
819
+ * This field's availability is dependent on your client's configuration.
820
+ */
821
+ netsuite_sales_order_id?: string;
822
+ /**
823
+ * If multiple credits or commits are applicable, the one with the lower priority
824
+ * will apply first.
825
+ */
826
+ priority?: number;
827
+ /**
828
+ * This field's availability is dependent on your client's configuration.
829
+ */
830
+ salesforce_opportunity_id?: string;
831
+ /**
832
+ * List of filters that determine what kind of customer usage draws down a commit
833
+ * or credit. A customer's usage needs to meet the condition of at least one of the
834
+ * specifiers to contribute to a commit's or credit's drawdown.
835
+ */
836
+ specifiers?: Array<Shared.CommitSpecifier>;
837
+ }
838
+ namespace Credit {
839
+ interface Product {
840
+ id: string;
841
+ name: string;
842
+ }
843
+ interface Contract {
844
+ id: string;
845
+ }
846
+ interface CreditSegmentStartLedgerEntry {
847
+ amount: number;
848
+ segment_id: string;
849
+ timestamp: string;
850
+ type: 'CREDIT_SEGMENT_START';
851
+ }
852
+ interface CreditAutomatedInvoiceDeductionLedgerEntry {
853
+ amount: number;
854
+ invoice_id: string;
855
+ segment_id: string;
856
+ timestamp: string;
857
+ type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION';
858
+ contract_id?: string;
859
+ }
860
+ interface CreditExpirationLedgerEntry {
861
+ amount: number;
862
+ segment_id: string;
863
+ timestamp: string;
864
+ type: 'CREDIT_EXPIRATION';
865
+ }
866
+ interface CreditCanceledLedgerEntry {
867
+ amount: number;
868
+ invoice_id: string;
869
+ segment_id: string;
870
+ timestamp: string;
871
+ type: 'CREDIT_CANCELED';
872
+ contract_id?: string;
873
+ }
874
+ interface CreditCreditedLedgerEntry {
875
+ amount: number;
876
+ invoice_id: string;
877
+ segment_id: string;
878
+ timestamp: string;
879
+ type: 'CREDIT_CREDITED';
880
+ contract_id?: string;
881
+ }
882
+ interface CreditManualLedgerEntry {
883
+ amount: number;
884
+ reason: string;
885
+ timestamp: string;
886
+ type: 'CREDIT_MANUAL';
887
+ }
888
+ interface CreditSeatBasedAdjustmentLedgerEntry {
889
+ amount: number;
890
+ segment_id: string;
891
+ timestamp: string;
892
+ type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
893
+ }
894
+ }
895
+ /**
896
+ * This field's availability is dependent on your client's configuration.
897
+ */
898
+ interface CustomerBillingProviderConfiguration {
899
+ /**
900
+ * ID of Customer's billing provider configuration.
901
+ */
902
+ id: string;
903
+ billing_provider: 'aws_marketplace' | 'stripe' | 'netsuite' | 'custom' | 'azure_marketplace' | 'quickbooks_online' | 'workday' | 'gcp_marketplace';
904
+ delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
905
+ }
906
+ /**
907
+ * Indicates whether there are more items than the limit for this endpoint. Use the
908
+ * respective list endpoints to get the full lists.
909
+ */
910
+ interface HasMore {
911
+ /**
912
+ * Whether there are more commits on this contract than the limit for this
913
+ * endpoint. Use the /contracts/customerCommits/list endpoint to get the full list
914
+ * of commits.
915
+ */
916
+ commits: boolean;
917
+ /**
918
+ * Whether there are more credits on this contract than the limit for this
919
+ * endpoint. Use the /contracts/customerCredits/list endpoint to get the full list
920
+ * of credits.
921
+ */
922
+ credits: boolean;
923
+ }
924
+ interface ParentHierarchyConfiguration {
925
+ /**
926
+ * List of contracts that belong to this parent.
927
+ */
928
+ children: Array<ParentHierarchyConfiguration.Child>;
929
+ parent_behavior?: ParentHierarchyConfiguration.ParentBehavior;
930
+ }
931
+ namespace ParentHierarchyConfiguration {
932
+ interface Child {
933
+ contract_id: string;
934
+ customer_id: string;
935
+ }
936
+ interface ParentBehavior {
937
+ /**
938
+ * Indicates the desired behavior of consolidated invoices generated by the parent
939
+ * in a customer hierarchy **CONCATENATE**: Statements on the invoices of child
940
+ * customers will be appended to the consolidated invoice **NONE**: Do not generate
941
+ * consolidated invoices
942
+ */
943
+ invoice_consolidation_type?: 'CONCATENATE' | 'NONE';
944
+ }
945
+ }
946
+ interface ChildHierarchyConfigurationV2 {
947
+ /**
948
+ * The single parent contract/customer for this child.
949
+ */
950
+ parent: ChildHierarchyConfigurationV2.Parent;
951
+ /**
952
+ * Indicates whether the child or parent should pay for the child's invoice charges
953
+ */
954
+ payer?: 'SELF' | 'PARENT';
955
+ /**
956
+ * Indicates the behavior of the child's invoice statements on the parent's
957
+ * invoices **CONSOLIDATE**: Child's invoice statements will be added to parent's
958
+ * consolidated invoices **SEPARATE**: Child's invoice statements will appear not
959
+ * appear on parent's consolidated invoices
960
+ */
961
+ usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE';
962
+ }
963
+ namespace ChildHierarchyConfigurationV2 {
964
+ /**
965
+ * The single parent contract/customer for this child.
966
+ */
967
+ interface Parent {
968
+ contract_id: string;
969
+ customer_id: string;
970
+ }
971
+ }
972
+ interface RecurringCommit {
973
+ id: string;
974
+ /**
975
+ * The amount of commit to grant.
976
+ */
977
+ access_amount: RecurringCommit.AccessAmount;
978
+ /**
979
+ * The amount of time the created commits will be valid for
980
+ */
981
+ commit_duration: RecurringCommit.CommitDuration;
982
+ /**
983
+ * Will be passed down to the individual commits
984
+ */
985
+ priority: number;
986
+ product: RecurringCommit.Product;
987
+ /**
988
+ * Whether the created commits will use the commit rate or list rate
989
+ */
990
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
991
+ /**
992
+ * Determines the start time for the first commit
993
+ */
994
+ starting_at: string;
995
+ /**
996
+ * Will be passed down to the individual commits
997
+ */
998
+ applicable_product_ids?: Array<string>;
999
+ /**
1000
+ * Will be passed down to the individual commits
1001
+ */
1002
+ applicable_product_tags?: Array<string>;
1003
+ contract?: RecurringCommit.Contract;
1004
+ /**
1005
+ * Will be passed down to the individual commits
1006
+ */
1007
+ description?: string;
1008
+ /**
1009
+ * Determines when the contract will stop creating recurring commits. Optional
1010
+ */
1011
+ ending_before?: string;
1012
+ /**
1013
+ * Optional configuration for recurring credit hierarchy access control
1014
+ */
1015
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1016
+ /**
1017
+ * The amount the customer should be billed for the commit. Not required.
1018
+ */
1019
+ invoice_amount?: RecurringCommit.InvoiceAmount;
1020
+ /**
1021
+ * Displayed on invoices. Will be passed through to the individual commits
1022
+ */
1023
+ name?: string;
1024
+ /**
1025
+ * Will be passed down to the individual commits
1026
+ */
1027
+ netsuite_sales_order_id?: string;
1028
+ /**
1029
+ * Determines whether the first and last commit will be prorated. If not provided,
1030
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1031
+ */
1032
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1033
+ /**
1034
+ * The frequency at which the recurring commits will be created. If not provided: -
1035
+ * The commits will be created on the usage invoice frequency. If provided: - The
1036
+ * period defined in the duration will correspond to this frequency. - Commits will
1037
+ * be created aligned with the recurring commit's starting_at rather than the usage
1038
+ * invoice dates.
1039
+ */
1040
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1041
+ /**
1042
+ * Will be passed down to the individual commits. This controls how much of an
1043
+ * individual unexpired commit will roll over upon contract transition. Must be
1044
+ * between 0 and 1.
1045
+ */
1046
+ rollover_fraction?: number;
1047
+ /**
1048
+ * List of filters that determine what kind of customer usage draws down a commit
1049
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1050
+ * specifiers to contribute to a commit's or credit's drawdown.
1051
+ */
1052
+ specifiers?: Array<Shared.CommitSpecifier>;
1053
+ /**
1054
+ * Attach a subscription to the recurring commit/credit.
1055
+ */
1056
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
1057
+ }
1058
+ namespace RecurringCommit {
1059
+ /**
1060
+ * The amount of commit to grant.
1061
+ */
1062
+ interface AccessAmount {
1063
+ credit_type_id: string;
1064
+ unit_price: number;
1065
+ quantity?: number;
1066
+ }
1067
+ /**
1068
+ * The amount of time the created commits will be valid for
1069
+ */
1070
+ interface CommitDuration {
1071
+ value: number;
1072
+ unit?: 'PERIODS';
1073
+ }
1074
+ interface Product {
1075
+ id: string;
1076
+ name: string;
1077
+ }
1078
+ interface Contract {
1079
+ id: string;
1080
+ }
1081
+ /**
1082
+ * The amount the customer should be billed for the commit. Not required.
1083
+ */
1084
+ interface InvoiceAmount {
1085
+ credit_type_id: string;
1086
+ quantity: number;
1087
+ unit_price: number;
1088
+ }
1089
+ }
1090
+ interface RecurringCredit {
1091
+ id: string;
1092
+ /**
1093
+ * The amount of commit to grant.
1094
+ */
1095
+ access_amount: RecurringCredit.AccessAmount;
1096
+ /**
1097
+ * The amount of time the created commits will be valid for
1098
+ */
1099
+ commit_duration: RecurringCredit.CommitDuration;
1100
+ /**
1101
+ * Will be passed down to the individual commits
1102
+ */
1103
+ priority: number;
1104
+ product: RecurringCredit.Product;
1105
+ /**
1106
+ * Whether the created commits will use the commit rate or list rate
1107
+ */
1108
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
1109
+ /**
1110
+ * Determines the start time for the first commit
1111
+ */
1112
+ starting_at: string;
1113
+ /**
1114
+ * Will be passed down to the individual commits
1115
+ */
1116
+ applicable_product_ids?: Array<string>;
1117
+ /**
1118
+ * Will be passed down to the individual commits
1119
+ */
1120
+ applicable_product_tags?: Array<string>;
1121
+ contract?: RecurringCredit.Contract;
1122
+ /**
1123
+ * Will be passed down to the individual commits
1124
+ */
1125
+ description?: string;
1126
+ /**
1127
+ * Determines when the contract will stop creating recurring commits. Optional
1128
+ */
1129
+ ending_before?: string;
1130
+ /**
1131
+ * Optional configuration for recurring credit hierarchy access control
1132
+ */
1133
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1134
+ /**
1135
+ * Displayed on invoices. Will be passed through to the individual commits
1136
+ */
1137
+ name?: string;
1138
+ /**
1139
+ * Will be passed down to the individual commits
1140
+ */
1141
+ netsuite_sales_order_id?: string;
1142
+ /**
1143
+ * Determines whether the first and last commit will be prorated. If not provided,
1144
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1145
+ */
1146
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1147
+ /**
1148
+ * The frequency at which the recurring commits will be created. If not provided: -
1149
+ * The commits will be created on the usage invoice frequency. If provided: - The
1150
+ * period defined in the duration will correspond to this frequency. - Commits will
1151
+ * be created aligned with the recurring commit's starting_at rather than the usage
1152
+ * invoice dates.
1153
+ */
1154
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1155
+ /**
1156
+ * Will be passed down to the individual commits. This controls how much of an
1157
+ * individual unexpired commit will roll over upon contract transition. Must be
1158
+ * between 0 and 1.
1159
+ */
1160
+ rollover_fraction?: number;
1161
+ /**
1162
+ * List of filters that determine what kind of customer usage draws down a commit
1163
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1164
+ * specifiers to contribute to a commit's or credit's drawdown.
1165
+ */
1166
+ specifiers?: Array<Shared.CommitSpecifier>;
1167
+ /**
1168
+ * Attach a subscription to the recurring commit/credit.
1169
+ */
1170
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
1171
+ }
1172
+ namespace RecurringCredit {
228
1173
  /**
229
- * If provided, the specifier will only apply to the product with the specified ID.
1174
+ * The amount of commit to grant.
230
1175
  */
231
- product_id?: string;
1176
+ interface AccessAmount {
1177
+ credit_type_id: string;
1178
+ unit_price: number;
1179
+ quantity?: number;
1180
+ }
232
1181
  /**
233
- * If provided, the specifier will only apply to products with all the specified
234
- * tags.
1182
+ * The amount of time the created commits will be valid for
235
1183
  */
236
- product_tags?: Array<string>;
1184
+ interface CommitDuration {
1185
+ value: number;
1186
+ unit?: 'PERIODS';
1187
+ }
1188
+ interface Product {
1189
+ id: string;
1190
+ name: string;
1191
+ }
1192
+ interface Contract {
1193
+ id: string;
1194
+ }
1195
+ }
1196
+ interface ResellerRoyalty {
1197
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
1198
+ segments: Array<ResellerRoyalty.Segment>;
1199
+ }
1200
+ namespace ResellerRoyalty {
1201
+ interface Segment {
1202
+ fraction: number;
1203
+ netsuite_reseller_id: string;
1204
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
1205
+ starting_at: string;
1206
+ applicable_product_ids?: Array<string>;
1207
+ applicable_product_tags?: Array<string>;
1208
+ aws_account_number?: string;
1209
+ aws_offer_id?: string;
1210
+ aws_payer_reference_id?: string;
1211
+ ending_before?: string;
1212
+ gcp_account_id?: string;
1213
+ gcp_offer_id?: string;
1214
+ reseller_contract_value?: number;
1215
+ }
237
1216
  }
238
1217
  }
239
1218
  export interface ContractWithoutAmendments {
@@ -247,7 +1226,7 @@ export interface ContractWithoutAmendments {
247
1226
  usage_statement_schedule: ContractWithoutAmendments.UsageStatementSchedule;
248
1227
  credits?: Array<Credit>;
249
1228
  /**
250
- * This field's availability is dependent on your client's configuration.
1229
+ * This field's availability is dependent on your client's
251
1230
  */
252
1231
  discounts?: Array<Discount>;
253
1232
  ending_before?: string;
@@ -255,14 +1234,14 @@ export interface ContractWithoutAmendments {
255
1234
  * Either a **parent** configuration with a list of children or a **child**
256
1235
  * configuration with a single parent.
257
1236
  */
258
- hierarchy_configuration?: ContractWithoutAmendments.ParentHierarchyConfiguration | ContractWithoutAmendments.ChildHierarchyConfiguration;
1237
+ hierarchy_configuration?: HierarchyConfiguration;
259
1238
  name?: string;
260
1239
  net_payment_terms_days?: number;
261
1240
  /**
262
1241
  * This field's availability is dependent on your client's configuration.
263
1242
  */
264
1243
  netsuite_sales_order_id?: string;
265
- prepaid_balance_threshold_configuration?: ContractWithoutAmendments.PrepaidBalanceThresholdConfiguration;
1244
+ prepaid_balance_threshold_configuration?: PrepaidBalanceThresholdConfiguration;
266
1245
  /**
267
1246
  * This field's availability is dependent on your client's configuration.
268
1247
  */
@@ -286,7 +1265,7 @@ export interface ContractWithoutAmendments {
286
1265
  * on a separate invoice from usage charges.
287
1266
  */
288
1267
  scheduled_charges_on_usage_invoices?: 'ALL';
289
- spend_threshold_configuration?: ContractWithoutAmendments.SpendThresholdConfiguration;
1268
+ spend_threshold_configuration?: SpendThresholdConfiguration;
290
1269
  /**
291
1270
  * This field's availability is dependent on your client's configuration.
292
1271
  */
@@ -306,166 +1285,6 @@ export declare namespace ContractWithoutAmendments {
306
1285
  billing_anchor_date: string;
307
1286
  frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
308
1287
  }
309
- interface ParentHierarchyConfiguration {
310
- /**
311
- * List of contracts that belong to this parent.
312
- */
313
- children: Array<ParentHierarchyConfiguration.Child>;
314
- }
315
- namespace ParentHierarchyConfiguration {
316
- interface Child {
317
- contract_id: string;
318
- customer_id: string;
319
- }
320
- }
321
- interface ChildHierarchyConfiguration {
322
- /**
323
- * The single parent contract/customer for this child.
324
- */
325
- parent: ChildHierarchyConfiguration.Parent;
326
- }
327
- namespace ChildHierarchyConfiguration {
328
- /**
329
- * The single parent contract/customer for this child.
330
- */
331
- interface Parent {
332
- contract_id: string;
333
- customer_id: string;
334
- }
335
- }
336
- interface PrepaidBalanceThresholdConfiguration {
337
- commit: PrepaidBalanceThresholdConfiguration.Commit;
338
- /**
339
- * When set to false, the contract will not be evaluated against the
340
- * threshold_amount. Toggling to true will result an immediate evaluation,
341
- * regardless of prior state.
342
- */
343
- is_enabled: boolean;
344
- payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
345
- /**
346
- * Specify the amount the balance should be recharged to.
347
- */
348
- recharge_to_amount: number;
349
- /**
350
- * Specify the threshold amount for the contract. Each time the contract's prepaid
351
- * balance lowers to this amount, a threshold charge will be initiated.
352
- */
353
- threshold_amount: number;
354
- /**
355
- * If provided, the threshold, recharge-to amount, and the resulting threshold
356
- * commit amount will be in terms of this credit type instead of the fiat currency.
357
- */
358
- custom_credit_type_id?: string;
359
- }
360
- namespace PrepaidBalanceThresholdConfiguration {
361
- interface Commit {
362
- /**
363
- * The commit product that will be used to generate the line item for commit
364
- * payment.
365
- */
366
- product_id: string;
367
- /**
368
- * Which products the threshold commit applies to. If applicable_product_ids,
369
- * applicable_product_tags or specifiers are not provided, the commit applies to
370
- * all products.
371
- */
372
- applicable_product_ids?: Array<string>;
373
- /**
374
- * Which tags the threshold commit applies to. If applicable_product_ids,
375
- * applicable_product_tags or specifiers are not provided, the commit applies to
376
- * all products.
377
- */
378
- applicable_product_tags?: Array<string>;
379
- description?: string;
380
- /**
381
- * Specify the name of the line item for the threshold charge. If left blank, it
382
- * will default to the commit product name.
383
- */
384
- name?: string;
385
- /**
386
- * List of filters that determine what kind of customer usage draws down a commit
387
- * or credit. A customer's usage needs to meet the condition of at least one of the
388
- * specifiers to contribute to a commit's or credit's drawdown. This field cannot
389
- * be used together with `applicable_product_ids` or `applicable_product_tags`.
390
- */
391
- specifiers?: Array<Commit.Specifier>;
392
- }
393
- namespace Commit {
394
- interface Specifier {
395
- presentation_group_values?: {
396
- [key: string]: string;
397
- };
398
- pricing_group_values?: {
399
- [key: string]: string;
400
- };
401
- /**
402
- * If provided, the specifier will only apply to the product with the specified ID.
403
- */
404
- product_id?: string;
405
- /**
406
- * If provided, the specifier will only apply to products with all the specified
407
- * tags.
408
- */
409
- product_tags?: Array<string>;
410
- }
411
- }
412
- interface PaymentGateConfig {
413
- /**
414
- * Gate access to the commit balance based on successful collection of payment.
415
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
416
- * facilitate payment using your own payment integration. Select NONE if you do not
417
- * wish to payment gate the commit balance.
418
- */
419
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
420
- /**
421
- * Only applicable if using PRECALCULATED as your tax type.
422
- */
423
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
424
- /**
425
- * Only applicable if using STRIPE as your payment gate type.
426
- */
427
- stripe_config?: PaymentGateConfig.StripeConfig;
428
- /**
429
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
430
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
431
- * will default to NONE.
432
- */
433
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
434
- }
435
- namespace PaymentGateConfig {
436
- /**
437
- * Only applicable if using PRECALCULATED as your tax type.
438
- */
439
- interface PrecalculatedTaxConfig {
440
- /**
441
- * Amount of tax to be applied. This should be in the same currency and
442
- * denomination as the commit's invoice schedule
443
- */
444
- tax_amount: number;
445
- /**
446
- * Name of the tax to be applied. This may be used in an invoice line item
447
- * description.
448
- */
449
- tax_name?: string;
450
- }
451
- /**
452
- * Only applicable if using STRIPE as your payment gate type.
453
- */
454
- interface StripeConfig {
455
- /**
456
- * If left blank, will default to INVOICE
457
- */
458
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
459
- /**
460
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
461
- * your payment type.
462
- */
463
- invoice_metadata?: {
464
- [key: string]: string;
465
- };
466
- }
467
- }
468
- }
469
1288
  interface RecurringCommit {
470
1289
  id: string;
471
1290
  /**
@@ -509,7 +1328,7 @@ export declare namespace ContractWithoutAmendments {
509
1328
  /**
510
1329
  * Optional configuration for recurring commit/credit hierarchy access control
511
1330
  */
512
- hierarchy_configuration?: RecurringCommit.HierarchyConfiguration;
1331
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
513
1332
  /**
514
1333
  * The amount the customer should be billed for the commit. Not required.
515
1334
  */
@@ -546,11 +1365,11 @@ export declare namespace ContractWithoutAmendments {
546
1365
  * or credit. A customer's usage needs to meet the condition of at least one of the
547
1366
  * specifiers to contribute to a commit's or credit's drawdown.
548
1367
  */
549
- specifiers?: Array<RecurringCommit.Specifier>;
1368
+ specifiers?: Array<Shared.CommitSpecifier>;
550
1369
  /**
551
1370
  * Attach a subscription to the recurring commit/credit.
552
1371
  */
553
- subscription_config?: RecurringCommit.SubscriptionConfig;
1372
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
554
1373
  }
555
1374
  namespace RecurringCommit {
556
1375
  /**
@@ -575,24 +1394,6 @@ export declare namespace ContractWithoutAmendments {
575
1394
  interface Contract {
576
1395
  id: string;
577
1396
  }
578
- /**
579
- * Optional configuration for recurring commit/credit hierarchy access control
580
- */
581
- interface HierarchyConfiguration {
582
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
583
- }
584
- namespace HierarchyConfiguration {
585
- interface CommitHierarchyChildAccessAll {
586
- type: 'ALL';
587
- }
588
- interface CommitHierarchyChildAccessNone {
589
- type: 'NONE';
590
- }
591
- interface CommitHierarchyChildAccessContractIDs {
592
- contract_ids: Array<string>;
593
- type: 'CONTRACT_IDS';
594
- }
595
- }
596
1397
  /**
597
1398
  * The amount the customer should be billed for the commit. Not required.
598
1399
  */
@@ -601,39 +1402,6 @@ export declare namespace ContractWithoutAmendments {
601
1402
  quantity: number;
602
1403
  unit_price: number;
603
1404
  }
604
- interface Specifier {
605
- presentation_group_values?: {
606
- [key: string]: string;
607
- };
608
- pricing_group_values?: {
609
- [key: string]: string;
610
- };
611
- /**
612
- * If provided, the specifier will only apply to the product with the specified ID.
613
- */
614
- product_id?: string;
615
- /**
616
- * If provided, the specifier will only apply to products with all the specified
617
- * tags.
618
- */
619
- product_tags?: Array<string>;
620
- }
621
- /**
622
- * Attach a subscription to the recurring commit/credit.
623
- */
624
- interface SubscriptionConfig {
625
- allocation: 'INDIVIDUAL' | 'POOLED';
626
- apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
627
- subscription_id: string;
628
- }
629
- namespace SubscriptionConfig {
630
- interface ApplySeatIncreaseConfig {
631
- /**
632
- * Indicates whether a mid-period seat increase should be prorated.
633
- */
634
- is_prorated: boolean;
635
- }
636
- }
637
1405
  }
638
1406
  interface RecurringCredit {
639
1407
  id: string;
@@ -678,7 +1446,7 @@ export declare namespace ContractWithoutAmendments {
678
1446
  /**
679
1447
  * Optional configuration for recurring commit/credit hierarchy access control
680
1448
  */
681
- hierarchy_configuration?: RecurringCredit.HierarchyConfiguration;
1449
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
682
1450
  /**
683
1451
  * Displayed on invoices. Will be passed through to the individual commits
684
1452
  */
@@ -711,11 +1479,11 @@ export declare namespace ContractWithoutAmendments {
711
1479
  * or credit. A customer's usage needs to meet the condition of at least one of the
712
1480
  * specifiers to contribute to a commit's or credit's drawdown.
713
1481
  */
714
- specifiers?: Array<RecurringCredit.Specifier>;
1482
+ specifiers?: Array<Shared.CommitSpecifier>;
715
1483
  /**
716
1484
  * Attach a subscription to the recurring commit/credit.
717
1485
  */
718
- subscription_config?: RecurringCredit.SubscriptionConfig;
1486
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
719
1487
  }
720
1488
  namespace RecurringCredit {
721
1489
  /**
@@ -740,158 +1508,21 @@ export declare namespace ContractWithoutAmendments {
740
1508
  interface Contract {
741
1509
  id: string;
742
1510
  }
743
- /**
744
- * Optional configuration for recurring commit/credit hierarchy access control
745
- */
746
- interface HierarchyConfiguration {
747
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
748
- }
749
- namespace HierarchyConfiguration {
750
- interface CommitHierarchyChildAccessAll {
751
- type: 'ALL';
752
- }
753
- interface CommitHierarchyChildAccessNone {
754
- type: 'NONE';
755
- }
756
- interface CommitHierarchyChildAccessContractIDs {
757
- contract_ids: Array<string>;
758
- type: 'CONTRACT_IDS';
759
- }
760
- }
761
- interface Specifier {
762
- presentation_group_values?: {
763
- [key: string]: string;
764
- };
765
- pricing_group_values?: {
766
- [key: string]: string;
767
- };
768
- /**
769
- * If provided, the specifier will only apply to the product with the specified ID.
770
- */
771
- product_id?: string;
772
- /**
773
- * If provided, the specifier will only apply to products with all the specified
774
- * tags.
775
- */
776
- product_tags?: Array<string>;
777
- }
778
- /**
779
- * Attach a subscription to the recurring commit/credit.
780
- */
781
- interface SubscriptionConfig {
782
- allocation: 'INDIVIDUAL' | 'POOLED';
783
- apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
784
- subscription_id: string;
785
- }
786
- namespace SubscriptionConfig {
787
- interface ApplySeatIncreaseConfig {
788
- /**
789
- * Indicates whether a mid-period seat increase should be prorated.
790
- */
791
- is_prorated: boolean;
792
- }
793
- }
794
1511
  }
795
1512
  interface ResellerRoyalty {
796
- fraction: number;
797
- netsuite_reseller_id: string;
798
- reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
799
- starting_at: string;
800
- applicable_product_ids?: Array<string>;
801
- applicable_product_tags?: Array<string>;
802
- aws_account_number?: string;
803
- aws_offer_id?: string;
804
- aws_payer_reference_id?: string;
805
- ending_before?: string;
806
- gcp_account_id?: string;
807
- gcp_offer_id?: string;
808
- reseller_contract_value?: number;
809
- }
810
- interface SpendThresholdConfiguration {
811
- commit: SpendThresholdConfiguration.Commit;
812
- /**
813
- * When set to false, the contract will not be evaluated against the
814
- * threshold_amount. Toggling to true will result an immediate evaluation,
815
- * regardless of prior state.
816
- */
817
- is_enabled: boolean;
818
- payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
819
- /**
820
- * Specify the threshold amount for the contract. Each time the contract's usage
821
- * hits this amount, a threshold charge will be initiated.
822
- */
823
- threshold_amount: number;
824
- }
825
- namespace SpendThresholdConfiguration {
826
- interface Commit {
827
- /**
828
- * The commit product that will be used to generate the line item for commit
829
- * payment.
830
- */
831
- product_id: string;
832
- description?: string;
833
- /**
834
- * Specify the name of the line item for the threshold charge. If left blank, it
835
- * will default to the commit product name.
836
- */
837
- name?: string;
838
- }
839
- interface PaymentGateConfig {
840
- /**
841
- * Gate access to the commit balance based on successful collection of payment.
842
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
843
- * facilitate payment using your own payment integration. Select NONE if you do not
844
- * wish to payment gate the commit balance.
845
- */
846
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
847
- /**
848
- * Only applicable if using PRECALCULATED as your tax type.
849
- */
850
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
851
- /**
852
- * Only applicable if using STRIPE as your payment gate type.
853
- */
854
- stripe_config?: PaymentGateConfig.StripeConfig;
855
- /**
856
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
857
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
858
- * will default to NONE.
859
- */
860
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
861
- }
862
- namespace PaymentGateConfig {
863
- /**
864
- * Only applicable if using PRECALCULATED as your tax type.
865
- */
866
- interface PrecalculatedTaxConfig {
867
- /**
868
- * Amount of tax to be applied. This should be in the same currency and
869
- * denomination as the commit's invoice schedule
870
- */
871
- tax_amount: number;
872
- /**
873
- * Name of the tax to be applied. This may be used in an invoice line item
874
- * description.
875
- */
876
- tax_name?: string;
877
- }
878
- /**
879
- * Only applicable if using STRIPE as your payment gate type.
880
- */
881
- interface StripeConfig {
882
- /**
883
- * If left blank, will default to INVOICE
884
- */
885
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
886
- /**
887
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
888
- * your payment type.
889
- */
890
- invoice_metadata?: {
891
- [key: string]: string;
892
- };
893
- }
894
- }
1513
+ fraction: number;
1514
+ netsuite_reseller_id: string;
1515
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
1516
+ starting_at: string;
1517
+ applicable_product_ids?: Array<string>;
1518
+ applicable_product_tags?: Array<string>;
1519
+ aws_account_number?: string;
1520
+ aws_offer_id?: string;
1521
+ aws_payer_reference_id?: string;
1522
+ ending_before?: string;
1523
+ gcp_account_id?: string;
1524
+ gcp_offer_id?: string;
1525
+ reseller_contract_value?: number;
895
1526
  }
896
1527
  interface UsageFilter {
897
1528
  current: Shared.BaseUsageFilter | null;
@@ -929,6 +1560,9 @@ export interface Credit {
929
1560
  */
930
1561
  balance?: number;
931
1562
  contract?: Credit.Contract;
1563
+ /**
1564
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1565
+ */
932
1566
  custom_fields?: {
933
1567
  [key: string]: string;
934
1568
  };
@@ -936,7 +1570,7 @@ export interface Credit {
936
1570
  /**
937
1571
  * Optional configuration for credit hierarchy access control
938
1572
  */
939
- hierarchy_configuration?: Credit.HierarchyConfiguration;
1573
+ hierarchy_configuration?: CommitHierarchyConfiguration;
940
1574
  /**
941
1575
  * A list of ordered events that impact the balance of a credit. For example, an
942
1576
  * invoice deduction or an expiration.
@@ -962,7 +1596,7 @@ export interface Credit {
962
1596
  * or credit. A customer's usage needs to meet the condition of at least one of the
963
1597
  * specifiers to contribute to a commit's or credit's drawdown.
964
1598
  */
965
- specifiers?: Array<Credit.Specifier>;
1599
+ specifiers?: Array<CommitSpecifier>;
966
1600
  /**
967
1601
  * Prevents the creation of duplicates. If a request to create a commit or credit
968
1602
  * is made with a uniqueness key that was previously used to create a commit or
@@ -979,24 +1613,6 @@ export declare namespace Credit {
979
1613
  interface Contract {
980
1614
  id: string;
981
1615
  }
982
- /**
983
- * Optional configuration for credit hierarchy access control
984
- */
985
- interface HierarchyConfiguration {
986
- child_access: HierarchyConfiguration.CommitHierarchyChildAccessAll | HierarchyConfiguration.CommitHierarchyChildAccessNone | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
987
- }
988
- namespace HierarchyConfiguration {
989
- interface CommitHierarchyChildAccessAll {
990
- type: 'ALL';
991
- }
992
- interface CommitHierarchyChildAccessNone {
993
- type: 'NONE';
994
- }
995
- interface CommitHierarchyChildAccessContractIDs {
996
- contract_ids: Array<string>;
997
- type: 'CONTRACT_IDS';
998
- }
999
- }
1000
1616
  interface CreditSegmentStartLedgerEntry {
1001
1617
  amount: number;
1002
1618
  segment_id: string;
@@ -1045,23 +1661,6 @@ export declare namespace Credit {
1045
1661
  timestamp: string;
1046
1662
  type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
1047
1663
  }
1048
- interface Specifier {
1049
- presentation_group_values?: {
1050
- [key: string]: string;
1051
- };
1052
- pricing_group_values?: {
1053
- [key: string]: string;
1054
- };
1055
- /**
1056
- * If provided, the specifier will only apply to the product with the specified ID.
1057
- */
1058
- product_id?: string;
1059
- /**
1060
- * If provided, the specifier will only apply to products with all the specified
1061
- * tags.
1062
- */
1063
- product_tags?: Array<string>;
1064
- }
1065
1664
  }
1066
1665
  export interface CreditTypeData {
1067
1666
  id: string;
@@ -1071,6 +1670,9 @@ export interface Discount {
1071
1670
  id: string;
1072
1671
  product: Discount.Product;
1073
1672
  schedule: SchedulePointInTime;
1673
+ /**
1674
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1675
+ */
1074
1676
  custom_fields?: {
1075
1677
  [key: string]: string;
1076
1678
  };
@@ -1103,6 +1705,61 @@ export interface EventTypeFilter {
1103
1705
  */
1104
1706
  not_in_values?: Array<string>;
1105
1707
  }
1708
+ /**
1709
+ * Either a **parent** configuration with a list of children or a **child**
1710
+ * configuration with a single parent.
1711
+ */
1712
+ export type HierarchyConfiguration = HierarchyConfiguration.ParentHierarchyConfiguration | HierarchyConfiguration.ChildHierarchyConfiguration;
1713
+ export declare namespace HierarchyConfiguration {
1714
+ interface ParentHierarchyConfiguration {
1715
+ /**
1716
+ * List of contracts that belong to this parent.
1717
+ */
1718
+ children: Array<ParentHierarchyConfiguration.Child>;
1719
+ parent_behavior?: ParentHierarchyConfiguration.ParentBehavior;
1720
+ }
1721
+ namespace ParentHierarchyConfiguration {
1722
+ interface Child {
1723
+ contract_id: string;
1724
+ customer_id: string;
1725
+ }
1726
+ interface ParentBehavior {
1727
+ /**
1728
+ * Indicates the desired behavior of consolidated invoices generated by the parent
1729
+ * in a customer hierarchy **CONCATENATE**: Statements on the invoices of child
1730
+ * customers will be appended to the consolidated invoice **NONE**: Do not generate
1731
+ * consolidated invoices
1732
+ */
1733
+ invoice_consolidation_type?: 'CONCATENATE' | 'NONE';
1734
+ }
1735
+ }
1736
+ interface ChildHierarchyConfiguration {
1737
+ /**
1738
+ * The single parent contract/customer for this child.
1739
+ */
1740
+ parent: ChildHierarchyConfiguration.Parent;
1741
+ /**
1742
+ * Indicates whether the parent should pay for the child's invoice charges
1743
+ */
1744
+ payer?: 'SELF' | 'PARENT';
1745
+ /**
1746
+ * Indicates the behavior of the child's invoice statements on the parent's
1747
+ * invoices **CONSOLIDATE**: Child's invoice statements will be added to parent's
1748
+ * consolidated invoices **SEPARATE**: Child's invoice statements will appear not
1749
+ * appear on parent's consolidated invoices
1750
+ */
1751
+ usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE';
1752
+ }
1753
+ namespace ChildHierarchyConfiguration {
1754
+ /**
1755
+ * The single parent contract/customer for this child.
1756
+ */
1757
+ interface Parent {
1758
+ contract_id: string;
1759
+ customer_id: string;
1760
+ }
1761
+ }
1762
+ }
1106
1763
  export interface ID {
1107
1764
  id: string;
1108
1765
  }
@@ -1121,8 +1778,8 @@ export interface Override {
1121
1778
  is_prorated?: boolean;
1122
1779
  multiplier?: number;
1123
1780
  override_specifiers?: Array<Override.OverrideSpecifier>;
1124
- override_tiers?: Array<Override.OverrideTier>;
1125
- overwrite_rate?: Override.OverwriteRate;
1781
+ override_tiers?: Array<OverrideTier>;
1782
+ overwrite_rate?: OverwriteRate;
1126
1783
  /**
1127
1784
  * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
1128
1785
  * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
@@ -1164,42 +1821,250 @@ export declare namespace Override {
1164
1821
  recurring_commit_ids?: Array<string>;
1165
1822
  recurring_credit_ids?: Array<string>;
1166
1823
  }
1167
- interface OverrideTier {
1168
- multiplier: number;
1169
- size?: number;
1824
+ interface Product {
1825
+ id: string;
1826
+ name: string;
1827
+ }
1828
+ }
1829
+ export interface OverrideTier {
1830
+ multiplier: number;
1831
+ size?: number;
1832
+ }
1833
+ export interface OverwriteRate {
1834
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
1835
+ credit_type?: CreditTypeData;
1836
+ /**
1837
+ * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1838
+ * processors.
1839
+ */
1840
+ custom_rate?: {
1841
+ [key: string]: unknown;
1842
+ };
1843
+ /**
1844
+ * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
1845
+ * set to true.
1846
+ */
1847
+ is_prorated?: boolean;
1848
+ /**
1849
+ * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
1850
+ * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
1851
+ */
1852
+ price?: number;
1853
+ /**
1854
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
1855
+ */
1856
+ quantity?: number;
1857
+ /**
1858
+ * Only set for TIERED rate_type.
1859
+ */
1860
+ tiers?: Array<Tier>;
1861
+ }
1862
+ export interface PaymentGateConfig {
1863
+ /**
1864
+ * Gate access to the commit balance based on successful collection of payment.
1865
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1866
+ * facilitate payment using your own payment integration. Select NONE if you do not
1867
+ * wish to payment gate the commit balance.
1868
+ */
1869
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1870
+ /**
1871
+ * Only applicable if using PRECALCULATED as your tax type.
1872
+ */
1873
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1874
+ /**
1875
+ * Only applicable if using STRIPE as your payment gate type.
1876
+ */
1877
+ stripe_config?: PaymentGateConfig.StripeConfig;
1878
+ /**
1879
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1880
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1881
+ * will default to NONE.
1882
+ */
1883
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'AVALARA' | 'PRECALCULATED';
1884
+ }
1885
+ export declare namespace PaymentGateConfig {
1886
+ /**
1887
+ * Only applicable if using PRECALCULATED as your tax type.
1888
+ */
1889
+ interface PrecalculatedTaxConfig {
1890
+ /**
1891
+ * Amount of tax to be applied. This should be in the same currency and
1892
+ * denomination as the commit's invoice schedule
1893
+ */
1894
+ tax_amount: number;
1895
+ /**
1896
+ * Name of the tax to be applied. This may be used in an invoice line item
1897
+ * description.
1898
+ */
1899
+ tax_name?: string;
1170
1900
  }
1171
- interface OverwriteRate {
1172
- rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
1173
- credit_type?: Shared.CreditTypeData;
1901
+ /**
1902
+ * Only applicable if using STRIPE as your payment gate type.
1903
+ */
1904
+ interface StripeConfig {
1174
1905
  /**
1175
- * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1176
- * processors.
1906
+ * If left blank, will default to INVOICE
1177
1907
  */
1178
- custom_rate?: {
1179
- [key: string]: unknown;
1908
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1909
+ /**
1910
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1911
+ * your payment type.
1912
+ */
1913
+ invoice_metadata?: {
1914
+ [key: string]: string;
1180
1915
  };
1916
+ }
1917
+ }
1918
+ export interface PaymentGateConfigV2 {
1919
+ /**
1920
+ * Gate access to the commit balance based on successful collection of payment.
1921
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1922
+ * facilitate payment using your own payment integration. Select NONE if you do not
1923
+ * wish to payment gate the commit balance.
1924
+ */
1925
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1926
+ /**
1927
+ * Only applicable if using PRECALCULATED as your tax type.
1928
+ */
1929
+ precalculated_tax_config?: PaymentGateConfigV2.PrecalculatedTaxConfig;
1930
+ /**
1931
+ * Only applicable if using STRIPE as your payment gateway type.
1932
+ */
1933
+ stripe_config?: PaymentGateConfigV2.StripeConfig;
1934
+ /**
1935
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1936
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1937
+ * will default to NONE.
1938
+ */
1939
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'AVALARA' | 'PRECALCULATED';
1940
+ }
1941
+ export declare namespace PaymentGateConfigV2 {
1942
+ /**
1943
+ * Only applicable if using PRECALCULATED as your tax type.
1944
+ */
1945
+ interface PrecalculatedTaxConfig {
1181
1946
  /**
1182
- * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
1183
- * set to true.
1947
+ * Amount of tax to be applied. This should be in the same currency and
1948
+ * denomination as the commit's invoice schedule
1184
1949
  */
1185
- is_prorated?: boolean;
1950
+ tax_amount: number;
1186
1951
  /**
1187
- * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
1188
- * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
1952
+ * Name of the tax to be applied. This may be used in an invoice line item
1953
+ * description.
1189
1954
  */
1190
- price?: number;
1955
+ tax_name?: string;
1956
+ }
1957
+ /**
1958
+ * Only applicable if using STRIPE as your payment gateway type.
1959
+ */
1960
+ interface StripeConfig {
1191
1961
  /**
1192
- * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
1962
+ * If left blank, will default to INVOICE
1193
1963
  */
1194
- quantity?: number;
1964
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1195
1965
  /**
1196
- * Only set for TIERED rate_type.
1966
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1967
+ * your payment type.
1197
1968
  */
1198
- tiers?: Array<Shared.Tier>;
1969
+ invoice_metadata?: {
1970
+ [key: string]: string;
1971
+ };
1199
1972
  }
1200
- interface Product {
1201
- id: string;
1202
- name: string;
1973
+ }
1974
+ export interface PrepaidBalanceThresholdConfiguration {
1975
+ commit: PrepaidBalanceThresholdConfiguration.Commit;
1976
+ /**
1977
+ * When set to false, the contract will not be evaluated against the
1978
+ * threshold_amount. Toggling to true will result an immediate evaluation,
1979
+ * regardless of prior state.
1980
+ */
1981
+ is_enabled: boolean;
1982
+ payment_gate_config: PaymentGateConfig;
1983
+ /**
1984
+ * Specify the amount the balance should be recharged to.
1985
+ */
1986
+ recharge_to_amount: number;
1987
+ /**
1988
+ * Specify the threshold amount for the contract. Each time the contract's prepaid
1989
+ * balance lowers to this amount, a threshold charge will be initiated.
1990
+ */
1991
+ threshold_amount: number;
1992
+ /**
1993
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
1994
+ * commit amount will be in terms of this credit type instead of the fiat currency.
1995
+ */
1996
+ custom_credit_type_id?: string;
1997
+ }
1998
+ export declare namespace PrepaidBalanceThresholdConfiguration {
1999
+ interface Commit extends Shared.BaseThresholdCommit {
2000
+ /**
2001
+ * Which products the threshold commit applies to. If applicable_product_ids,
2002
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2003
+ * all products.
2004
+ */
2005
+ applicable_product_ids?: Array<string>;
2006
+ /**
2007
+ * Which tags the threshold commit applies to. If applicable_product_ids,
2008
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2009
+ * all products.
2010
+ */
2011
+ applicable_product_tags?: Array<string>;
2012
+ /**
2013
+ * List of filters that determine what kind of customer usage draws down a commit
2014
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2015
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2016
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2017
+ */
2018
+ specifiers?: Array<Shared.CommitSpecifierInput>;
2019
+ }
2020
+ }
2021
+ export interface PrepaidBalanceThresholdConfigurationV2 {
2022
+ commit: PrepaidBalanceThresholdConfigurationV2.Commit;
2023
+ /**
2024
+ * When set to false, the contract will not be evaluated against the
2025
+ * threshold_amount. Toggling to true will result an immediate evaluation,
2026
+ * regardless of prior state.
2027
+ */
2028
+ is_enabled: boolean;
2029
+ payment_gate_config: PaymentGateConfigV2;
2030
+ /**
2031
+ * Specify the amount the balance should be recharged to.
2032
+ */
2033
+ recharge_to_amount: number;
2034
+ /**
2035
+ * Specify the threshold amount for the contract. Each time the contract's balance
2036
+ * lowers to this amount, a threshold charge will be initiated.
2037
+ */
2038
+ threshold_amount: number;
2039
+ /**
2040
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
2041
+ * commit amount will be in terms of this credit type instead of the fiat currency.
2042
+ */
2043
+ custom_credit_type_id?: string;
2044
+ }
2045
+ export declare namespace PrepaidBalanceThresholdConfigurationV2 {
2046
+ interface Commit extends Shared.UpdateBaseThresholdCommit {
2047
+ /**
2048
+ * Which products the threshold commit applies to. If applicable_product_ids,
2049
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2050
+ * all products.
2051
+ */
2052
+ applicable_product_ids?: Array<string>;
2053
+ /**
2054
+ * Which tags the threshold commit applies to. If applicable_product_ids,
2055
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2056
+ * all products.
2057
+ */
2058
+ applicable_product_tags?: Array<string>;
2059
+ /**
2060
+ * List of filters that determine what kind of customer usage draws down a commit
2061
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2062
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2063
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2064
+ * Instead, to target usage by product or product tag, pass those values in the
2065
+ * body of `specifiers`.
2066
+ */
2067
+ specifiers?: Array<Shared.CommitSpecifierInput>;
1203
2068
  }
1204
2069
  }
1205
2070
  export interface PropertyFilter {
@@ -1246,6 +2111,9 @@ export interface ProService {
1246
2111
  * amount and must be specified.
1247
2112
  */
1248
2113
  unit_price: number;
2114
+ /**
2115
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2116
+ */
1249
2117
  custom_fields?: {
1250
2118
  [key: string]: string;
1251
2119
  };
@@ -1297,11 +2165,27 @@ export interface Rate {
1297
2165
  */
1298
2166
  use_list_prices?: boolean;
1299
2167
  }
2168
+ export interface RecurringCommitSubscriptionConfig {
2169
+ allocation: 'INDIVIDUAL' | 'POOLED';
2170
+ apply_seat_increase_config: RecurringCommitSubscriptionConfig.ApplySeatIncreaseConfig;
2171
+ subscription_id: string;
2172
+ }
2173
+ export declare namespace RecurringCommitSubscriptionConfig {
2174
+ interface ApplySeatIncreaseConfig {
2175
+ /**
2176
+ * Indicates whether a mid-period seat increase should be prorated.
2177
+ */
2178
+ is_prorated: boolean;
2179
+ }
2180
+ }
1300
2181
  export interface ScheduledCharge {
1301
2182
  id: string;
1302
2183
  product: ScheduledCharge.Product;
1303
2184
  schedule: SchedulePointInTime;
1304
2185
  archived_at?: string;
2186
+ /**
2187
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2188
+ */
1305
2189
  custom_fields?: {
1306
2190
  [key: string]: string;
1307
2191
  };
@@ -1351,8 +2235,129 @@ export declare namespace SchedulePointInTime {
1351
2235
  invoice_id?: string | null;
1352
2236
  }
1353
2237
  }
2238
+ export interface SpendThresholdConfiguration {
2239
+ commit: BaseThresholdCommit;
2240
+ /**
2241
+ * When set to false, the contract will not be evaluated against the
2242
+ * threshold_amount. Toggling to true will result an immediate evaluation,
2243
+ * regardless of prior state.
2244
+ */
2245
+ is_enabled: boolean;
2246
+ payment_gate_config: PaymentGateConfig;
2247
+ /**
2248
+ * Specify the threshold amount for the contract. Each time the contract's usage
2249
+ * hits this amount, a threshold charge will be initiated.
2250
+ */
2251
+ threshold_amount: number;
2252
+ }
2253
+ export interface SpendThresholdConfigurationV2 {
2254
+ commit: UpdateBaseThresholdCommit;
2255
+ /**
2256
+ * When set to false, the contract will not be evaluated against the
2257
+ * threshold_amount. Toggling to true will result an immediate evaluation,
2258
+ * regardless of prior state.
2259
+ */
2260
+ is_enabled: boolean;
2261
+ payment_gate_config: PaymentGateConfigV2;
2262
+ /**
2263
+ * Specify the threshold amount for the contract. Each time the contract's usage
2264
+ * hits this amount, a threshold charge will be initiated.
2265
+ */
2266
+ threshold_amount: number;
2267
+ }
2268
+ export interface Subscription {
2269
+ /**
2270
+ * Previous, current, and next billing periods for the subscription.
2271
+ */
2272
+ billing_periods: Subscription.BillingPeriods;
2273
+ collection_schedule: 'ADVANCE' | 'ARREARS';
2274
+ proration: Subscription.Proration;
2275
+ /**
2276
+ * Determines how the subscription's quantity is controlled. Defaults to
2277
+ * QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
2278
+ * directly on the subscription. `initial_quantity` must be provided with this
2279
+ * option. Compatible with recurring commits/credits that use POOLED allocation.
2280
+ */
2281
+ quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY';
2282
+ /**
2283
+ * List of quantity schedule items for the subscription. Only includes the current
2284
+ * quantity and future quantity changes.
2285
+ */
2286
+ quantity_schedule: Array<Subscription.QuantitySchedule>;
2287
+ starting_at: string;
2288
+ subscription_rate: Subscription.SubscriptionRate;
2289
+ id?: string;
2290
+ /**
2291
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2292
+ */
2293
+ custom_fields?: {
2294
+ [key: string]: string;
2295
+ };
2296
+ description?: string;
2297
+ ending_before?: string;
2298
+ fiat_credit_type_id?: string;
2299
+ name?: string;
2300
+ }
2301
+ export declare namespace Subscription {
2302
+ /**
2303
+ * Previous, current, and next billing periods for the subscription.
2304
+ */
2305
+ interface BillingPeriods {
2306
+ current?: BillingPeriods.Current;
2307
+ next?: BillingPeriods.Next;
2308
+ previous?: BillingPeriods.Previous;
2309
+ }
2310
+ namespace BillingPeriods {
2311
+ interface Current {
2312
+ ending_before: string;
2313
+ starting_at: string;
2314
+ }
2315
+ interface Next {
2316
+ ending_before: string;
2317
+ starting_at: string;
2318
+ }
2319
+ interface Previous {
2320
+ ending_before: string;
2321
+ starting_at: string;
2322
+ }
2323
+ }
2324
+ interface Proration {
2325
+ invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
2326
+ is_prorated: boolean;
2327
+ }
2328
+ interface QuantitySchedule {
2329
+ quantity: number;
2330
+ starting_at: string;
2331
+ ending_before?: string;
2332
+ }
2333
+ interface SubscriptionRate {
2334
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2335
+ product: SubscriptionRate.Product;
2336
+ }
2337
+ namespace SubscriptionRate {
2338
+ interface Product {
2339
+ id: string;
2340
+ name: string;
2341
+ }
2342
+ }
2343
+ }
1354
2344
  export interface Tier {
1355
2345
  price: number;
1356
2346
  size?: number;
1357
2347
  }
2348
+ export interface UpdateBaseThresholdCommit {
2349
+ description?: string;
2350
+ /**
2351
+ * Specify the name of the line item for the threshold charge. If left blank, it
2352
+ * will default to the commit product name.
2353
+ */
2354
+ name?: string;
2355
+ /**
2356
+ * The commit product that will be used to generate the line item for commit
2357
+ * payment.
2358
+ */
2359
+ product_id?: string;
2360
+ }
2361
+ export type CommitsBodyCursorPage = BodyCursorPage<Commit>;
2362
+ export type CreditsBodyCursorPage = BodyCursorPage<Credit>;
1358
2363
  //# sourceMappingURL=shared.d.ts.map