@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,6 +1,23 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import * as Shared from "./shared.js";
3
+ import * as Shared from './shared';
4
+ import { BodyCursorPage } from '../core/pagination';
5
+
6
+ export interface BaseThresholdCommit {
7
+ /**
8
+ * The commit product that will be used to generate the line item for commit
9
+ * payment.
10
+ */
11
+ product_id: string;
12
+
13
+ description?: string;
14
+
15
+ /**
16
+ * Specify the name of the line item for the threshold charge. If left blank, it
17
+ * will default to the commit product name.
18
+ */
19
+ name?: string;
20
+ }
4
21
 
5
22
  export interface BaseUsageFilter {
6
23
  group_key: string;
@@ -13,6 +30,15 @@ export interface BaseUsageFilter {
13
30
  export interface Commit {
14
31
  id: string;
15
32
 
33
+ /**
34
+ * Timestamp of when the commit was created.
35
+ *
36
+ * - Recurring commits: latter of commit service period date and parent commit
37
+ * start date
38
+ * - Rollover commits: when the new contract started
39
+ */
40
+ created_at: string;
41
+
16
42
  product: Commit.Product;
17
43
 
18
44
  type: 'PREPAID' | 'POSTPAID';
@@ -54,6 +80,9 @@ export interface Commit {
54
80
 
55
81
  contract?: Commit.Contract;
56
82
 
83
+ /**
84
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
85
+ */
57
86
  custom_fields?: { [key: string]: string };
58
87
 
59
88
  description?: string;
@@ -61,7 +90,7 @@ export interface Commit {
61
90
  /**
62
91
  * Optional configuration for commit hierarchy access control
63
92
  */
64
- hierarchy_configuration?: Commit.HierarchyConfiguration;
93
+ hierarchy_configuration?: CommitHierarchyConfiguration;
65
94
 
66
95
  /**
67
96
  * The contract that this commit will be billed on.
@@ -123,7 +152,7 @@ export interface Commit {
123
152
  * or credit. A customer's usage needs to meet the condition of at least one of the
124
153
  * specifiers to contribute to a commit's or credit's drawdown.
125
154
  */
126
- specifiers?: Array<Commit.Specifier>;
155
+ specifiers?: Array<CommitSpecifier>;
127
156
 
128
157
  /**
129
158
  * Prevents the creation of duplicates. If a request to create a commit or credit
@@ -145,32 +174,6 @@ export namespace Commit {
145
174
  id: string;
146
175
  }
147
176
 
148
- /**
149
- * Optional configuration for commit hierarchy access control
150
- */
151
- export interface HierarchyConfiguration {
152
- child_access:
153
- | HierarchyConfiguration.CommitHierarchyChildAccessAll
154
- | HierarchyConfiguration.CommitHierarchyChildAccessNone
155
- | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
156
- }
157
-
158
- export namespace HierarchyConfiguration {
159
- export interface CommitHierarchyChildAccessAll {
160
- type: 'ALL';
161
- }
162
-
163
- export interface CommitHierarchyChildAccessNone {
164
- type: 'NONE';
165
- }
166
-
167
- export interface CommitHierarchyChildAccessContractIDs {
168
- contract_ids: Array<string>;
169
-
170
- type: 'CONTRACT_IDS';
171
- }
172
- }
173
-
174
177
  /**
175
178
  * The contract that this commit will be billed on.
176
179
  */
@@ -341,43 +344,275 @@ export namespace Commit {
341
344
 
342
345
  contract_id: string;
343
346
  }
347
+ }
348
+
349
+ export interface CommitHierarchyConfiguration {
350
+ child_access:
351
+ | CommitHierarchyConfiguration.CommitHierarchyChildAccessAll
352
+ | CommitHierarchyConfiguration.CommitHierarchyChildAccessNone
353
+ | CommitHierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
354
+ }
355
+
356
+ export namespace CommitHierarchyConfiguration {
357
+ export interface CommitHierarchyChildAccessAll {
358
+ type: 'ALL';
359
+ }
360
+
361
+ export interface CommitHierarchyChildAccessNone {
362
+ type: 'NONE';
363
+ }
344
364
 
345
- export interface Specifier {
346
- presentation_group_values?: { [key: string]: string };
365
+ export interface CommitHierarchyChildAccessContractIDs {
366
+ contract_ids: Array<string>;
347
367
 
348
- pricing_group_values?: { [key: string]: string };
368
+ type: 'CONTRACT_IDS';
369
+ }
370
+ }
371
+
372
+ /**
373
+ * A distinct rate on the rate card. You can choose to use this rate rather than
374
+ * list rate when consuming a credit or commit.
375
+ */
376
+ export interface CommitRate {
377
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
378
+
379
+ /**
380
+ * Commit rate price. For FLAT rate_type, this must be >=0.
381
+ */
382
+ price?: number;
383
+
384
+ /**
385
+ * Only set for TIERED rate_type.
386
+ */
387
+ tiers?: Array<Tier>;
388
+ }
389
+
390
+ export interface CommitSpecifier {
391
+ presentation_group_values?: { [key: string]: string };
392
+
393
+ pricing_group_values?: { [key: string]: string };
394
+
395
+ /**
396
+ * If provided, the specifier will only apply to the product with the specified ID.
397
+ */
398
+ product_id?: string;
399
+
400
+ /**
401
+ * If provided, the specifier will only apply to products with all the specified
402
+ * tags.
403
+ */
404
+ product_tags?: Array<string>;
405
+ }
406
+
407
+ export interface CommitSpecifierInput {
408
+ presentation_group_values?: { [key: string]: string };
409
+
410
+ pricing_group_values?: { [key: string]: string };
411
+
412
+ /**
413
+ * If provided, the specifier will only apply to the product with the specified ID.
414
+ */
415
+ product_id?: string;
416
+
417
+ /**
418
+ * If provided, the specifier will only apply to products with all the specified
419
+ * tags.
420
+ */
421
+ product_tags?: Array<string>;
422
+ }
423
+
424
+ export interface Contract {
425
+ id: string;
426
+
427
+ amendments: Array<Contract.Amendment>;
428
+
429
+ current: ContractWithoutAmendments;
430
+
431
+ customer_id: string;
432
+
433
+ initial: ContractWithoutAmendments;
434
+
435
+ /**
436
+ * RFC 3339 timestamp indicating when the contract was archived. If not returned,
437
+ * the contract is not archived.
438
+ */
439
+ archived_at?: string;
440
+
441
+ /**
442
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
443
+ */
444
+ custom_fields?: { [key: string]: string };
445
+
446
+ /**
447
+ * The billing provider configuration associated with a contract.
448
+ */
449
+ customer_billing_provider_configuration?: Contract.CustomerBillingProviderConfiguration;
450
+
451
+ prepaid_balance_threshold_configuration?: PrepaidBalanceThresholdConfiguration;
452
+
453
+ /**
454
+ * Priority of the contract.
455
+ */
456
+ priority?: number;
457
+
458
+ /**
459
+ * Determines which scheduled and commit charges to consolidate onto the Contract's
460
+ * usage invoice. The charge's `timestamp` must match the usage invoice's
461
+ * `ending_before` date for consolidation to occur. This field cannot be modified
462
+ * after a Contract has been created. If this field is omitted, charges will appear
463
+ * on a separate invoice from usage charges.
464
+ */
465
+ scheduled_charges_on_usage_invoices?: 'ALL';
466
+
467
+ spend_threshold_configuration?: SpendThresholdConfiguration;
468
+
469
+ /**
470
+ * List of subscriptions on the contract.
471
+ */
472
+ subscriptions?: Array<Subscription>;
473
+
474
+ /**
475
+ * Prevents the creation of duplicates. If a request to create a record is made
476
+ * with a previously used uniqueness key, a new record will not be created and the
477
+ * request will fail with a 409 error.
478
+ */
479
+ uniqueness_key?: string;
480
+ }
481
+
482
+ export namespace Contract {
483
+ export interface Amendment {
484
+ id: string;
485
+
486
+ commits: Array<Shared.Commit>;
487
+
488
+ created_at: string;
489
+
490
+ created_by: string;
491
+
492
+ overrides: Array<Shared.Override>;
493
+
494
+ scheduled_charges: Array<Shared.ScheduledCharge>;
495
+
496
+ starting_at: string;
497
+
498
+ credits?: Array<Shared.Credit>;
349
499
 
350
500
  /**
351
- * If provided, the specifier will only apply to the product with the specified ID.
501
+ * This field's availability is dependent on your client's configuration.
352
502
  */
353
- product_id?: string;
503
+ discounts?: Array<Shared.Discount>;
354
504
 
355
505
  /**
356
- * If provided, the specifier will only apply to products with all the specified
357
- * tags.
506
+ * This field's availability is dependent on your client's configuration.
358
507
  */
359
- product_tags?: Array<string>;
508
+ netsuite_sales_order_id?: string;
509
+
510
+ /**
511
+ * This field's availability is dependent on your client's configuration.
512
+ */
513
+ professional_services?: Array<Shared.ProService>;
514
+
515
+ /**
516
+ * This field's availability is dependent on your client's configuration.
517
+ */
518
+ reseller_royalties?: Array<Amendment.ResellerRoyalty>;
519
+
520
+ /**
521
+ * This field's availability is dependent on your client's configuration.
522
+ */
523
+ salesforce_opportunity_id?: string;
524
+ }
525
+
526
+ export namespace Amendment {
527
+ export interface ResellerRoyalty {
528
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
529
+
530
+ aws_account_number?: string;
531
+
532
+ aws_offer_id?: string;
533
+
534
+ aws_payer_reference_id?: string;
535
+
536
+ ending_before?: string | null;
537
+
538
+ fraction?: number;
539
+
540
+ gcp_account_id?: string;
541
+
542
+ gcp_offer_id?: string;
543
+
544
+ netsuite_reseller_id?: string;
545
+
546
+ reseller_contract_value?: number;
547
+
548
+ starting_at?: string;
549
+ }
550
+ }
551
+
552
+ /**
553
+ * The billing provider configuration associated with a contract.
554
+ */
555
+ export interface CustomerBillingProviderConfiguration {
556
+ archived_at: string | null;
557
+
558
+ billing_provider:
559
+ | 'aws_marketplace'
560
+ | 'stripe'
561
+ | 'netsuite'
562
+ | 'custom'
563
+ | 'azure_marketplace'
564
+ | 'quickbooks_online'
565
+ | 'workday'
566
+ | 'gcp_marketplace';
567
+
568
+ delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
569
+
570
+ id?: string;
571
+
572
+ /**
573
+ * Configuration for the billing provider. The structure of this object is specific
574
+ * to the billing provider.
575
+ */
576
+ configuration?: { [key: string]: unknown };
360
577
  }
361
578
  }
362
579
 
363
- export interface ContractWithoutAmendments {
364
- commits: Array<Commit>;
580
+ export interface ContractV2 {
581
+ id: string;
582
+
583
+ commits: Array<ContractV2.Commit>;
365
584
 
366
585
  created_at: string;
367
586
 
368
587
  created_by: string;
369
588
 
370
- overrides: Array<Override>;
589
+ customer_id: string;
590
+
591
+ overrides: Array<ContractV2.Override>;
371
592
 
372
593
  scheduled_charges: Array<ScheduledCharge>;
373
594
 
374
595
  starting_at: string;
375
596
 
376
- transitions: Array<ContractWithoutAmendments.Transition>;
597
+ transitions: Array<ContractV2.Transition>;
377
598
 
378
- usage_statement_schedule: ContractWithoutAmendments.UsageStatementSchedule;
599
+ usage_filter: Array<ContractV2.UsageFilter>;
379
600
 
380
- credits?: Array<Credit>;
601
+ usage_statement_schedule: ContractV2.UsageStatementSchedule;
602
+
603
+ archived_at?: string;
604
+
605
+ credits?: Array<ContractV2.Credit>;
606
+
607
+ /**
608
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
609
+ */
610
+ custom_fields?: { [key: string]: string };
611
+
612
+ /**
613
+ * This field's availability is dependent on your client's configuration.
614
+ */
615
+ customer_billing_provider_configuration?: ContractV2.CustomerBillingProviderConfiguration;
381
616
 
382
617
  /**
383
618
  * This field's availability is dependent on your client's configuration.
@@ -386,13 +621,27 @@ export interface ContractWithoutAmendments {
386
621
 
387
622
  ending_before?: string;
388
623
 
624
+ /**
625
+ * Indicates whether there are more items than the limit for this endpoint. Use the
626
+ * respective list endpoints to get the full lists.
627
+ */
628
+ has_more?: ContractV2.HasMore;
629
+
389
630
  /**
390
631
  * Either a **parent** configuration with a list of children or a **child**
391
632
  * configuration with a single parent.
392
633
  */
393
634
  hierarchy_configuration?:
394
- | ContractWithoutAmendments.ParentHierarchyConfiguration
395
- | ContractWithoutAmendments.ChildHierarchyConfiguration;
635
+ | ContractV2.ParentHierarchyConfiguration
636
+ | ContractV2.ChildHierarchyConfigurationV2;
637
+
638
+ /**
639
+ * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
640
+ * prices automatically. EXPLICIT prioritization requires specifying priorities for
641
+ * each multiplier; the one with the lowest priority value will be prioritized
642
+ * first.
643
+ */
644
+ multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';
396
645
 
397
646
  name?: string;
398
647
 
@@ -403,7 +652,12 @@ export interface ContractWithoutAmendments {
403
652
  */
404
653
  netsuite_sales_order_id?: string;
405
654
 
406
- prepaid_balance_threshold_configuration?: ContractWithoutAmendments.PrepaidBalanceThresholdConfiguration;
655
+ prepaid_balance_threshold_configuration?: PrepaidBalanceThresholdConfigurationV2;
656
+
657
+ /**
658
+ * Priority of the contract.
659
+ */
660
+ priority?: number;
407
661
 
408
662
  /**
409
663
  * This field's availability is dependent on your client's configuration.
@@ -412,14 +666,14 @@ export interface ContractWithoutAmendments {
412
666
 
413
667
  rate_card_id?: string;
414
668
 
415
- recurring_commits?: Array<ContractWithoutAmendments.RecurringCommit>;
669
+ recurring_commits?: Array<ContractV2.RecurringCommit>;
416
670
 
417
- recurring_credits?: Array<ContractWithoutAmendments.RecurringCredit>;
671
+ recurring_credits?: Array<ContractV2.RecurringCredit>;
418
672
 
419
673
  /**
420
674
  * This field's availability is dependent on your client's configuration.
421
675
  */
422
- reseller_royalties?: Array<ContractWithoutAmendments.ResellerRoyalty>;
676
+ reseller_royalties?: Array<ContractV2.ResellerRoyalty>;
423
677
 
424
678
  /**
425
679
  * This field's availability is dependent on your client's configuration.
@@ -435,216 +689,1147 @@ export interface ContractWithoutAmendments {
435
689
  */
436
690
  scheduled_charges_on_usage_invoices?: 'ALL';
437
691
 
438
- spend_threshold_configuration?: ContractWithoutAmendments.SpendThresholdConfiguration;
692
+ spend_threshold_configuration?: SpendThresholdConfigurationV2;
439
693
 
440
694
  /**
441
- * This field's availability is dependent on your client's configuration.
695
+ * List of subscriptions on the contract.
442
696
  */
697
+ subscriptions?: Array<Subscription>;
698
+
443
699
  total_contract_value?: number;
444
700
 
445
- usage_filter?: ContractWithoutAmendments.UsageFilter;
701
+ /**
702
+ * Optional uniqueness key to prevent duplicate contract creations.
703
+ */
704
+ uniqueness_key?: string;
446
705
  }
447
706
 
448
- export namespace ContractWithoutAmendments {
449
- export interface Transition {
450
- from_contract_id: string;
451
-
452
- to_contract_id: string;
453
-
454
- type: 'SUPERSEDE' | 'RENEWAL';
455
- }
707
+ export namespace ContractV2 {
708
+ export interface Commit {
709
+ id: string;
456
710
 
457
- export interface UsageStatementSchedule {
458
711
  /**
459
- * Contract usage statements follow a selected cadence based on this date.
712
+ * Timestamp of when the commit was created.
713
+ *
714
+ * - Recurring commits: latter of commit service period date and parent commit
715
+ * start date
716
+ * - Rollover commits: when the new contract started
460
717
  */
461
- billing_anchor_date: string;
718
+ created_at: string;
462
719
 
463
- frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
464
- }
720
+ product: Commit.Product;
721
+
722
+ type: 'PREPAID' | 'POSTPAID';
465
723
 
466
- export interface ParentHierarchyConfiguration {
467
724
  /**
468
- * List of contracts that belong to this parent.
725
+ * The schedule that the customer will gain access to the credits purposed with
726
+ * this commit.
469
727
  */
470
- children: Array<ParentHierarchyConfiguration.Child>;
471
- }
728
+ access_schedule?: Shared.ScheduleDuration;
472
729
 
473
- export namespace ParentHierarchyConfiguration {
474
- export interface Child {
475
- contract_id: string;
730
+ applicable_contract_ids?: Array<string>;
476
731
 
477
- customer_id: string;
478
- }
479
- }
732
+ applicable_product_ids?: Array<string>;
733
+
734
+ applicable_product_tags?: Array<string>;
735
+
736
+ archived_at?: string;
480
737
 
481
- export interface ChildHierarchyConfiguration {
482
738
  /**
483
- * The single parent contract/customer for this child.
739
+ * The current balance of the credit or commit. This balance reflects the amount of
740
+ * credit or commit that the customer has access to use at this moment - thus,
741
+ * expired and upcoming credit or commit segments contribute 0 to the balance. The
742
+ * balance will match the sum of all ledger entries with the exception of the case
743
+ * where the sum of negative manual ledger entries exceeds the positive amount
744
+ * remaining on the credit or commit - in that case, the balance will be 0. All
745
+ * manual ledger entries associated with active credit or commit segments are
746
+ * included in the balance, including future-dated manual ledger entries.
484
747
  */
485
- parent: ChildHierarchyConfiguration.Parent;
486
- }
748
+ balance?: number;
749
+
750
+ contract?: Commit.Contract;
487
751
 
488
- export namespace ChildHierarchyConfiguration {
489
752
  /**
490
- * The single parent contract/customer for this child.
753
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
491
754
  */
492
- export interface Parent {
493
- contract_id: string;
755
+ custom_fields?: { [key: string]: string };
494
756
 
495
- customer_id: string;
496
- }
497
- }
757
+ description?: string;
498
758
 
499
- export interface PrepaidBalanceThresholdConfiguration {
500
- commit: PrepaidBalanceThresholdConfiguration.Commit;
759
+ /**
760
+ * Optional configuration for commit hierarchy access control
761
+ */
762
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
501
763
 
502
764
  /**
503
- * When set to false, the contract will not be evaluated against the
504
- * threshold_amount. Toggling to true will result an immediate evaluation,
505
- * regardless of prior state.
765
+ * The contract that this commit will be billed on.
506
766
  */
507
- is_enabled: boolean;
767
+ invoice_contract?: Commit.InvoiceContract;
508
768
 
509
- payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
769
+ /**
770
+ * The schedule that the customer will be invoiced for this commit.
771
+ */
772
+ invoice_schedule?: Shared.SchedulePointInTime;
510
773
 
511
774
  /**
512
- * Specify the amount the balance should be recharged to.
775
+ * A list of ordered events that impact the balance of a commit. For example, an
776
+ * invoice deduction or a rollover.
513
777
  */
514
- recharge_to_amount: number;
778
+ ledger?: Array<
779
+ | Commit.PrepaidCommitSegmentStartLedgerEntry
780
+ | Commit.PrepaidCommitAutomatedInvoiceDeductionLedgerEntry
781
+ | Commit.PrepaidCommitRolloverLedgerEntry
782
+ | Commit.PrepaidCommitExpirationLedgerEntry
783
+ | Commit.PrepaidCommitCanceledLedgerEntry
784
+ | Commit.PrepaidCommitCreditedLedgerEntry
785
+ | Commit.PrepaidCommitSeatBasedAdjustmentLedgerEntry
786
+ | Commit.PostpaidCommitInitialBalanceLedgerEntry
787
+ | Commit.PostpaidCommitAutomatedInvoiceDeductionLedgerEntry
788
+ | Commit.PostpaidCommitRolloverLedgerEntry
789
+ | Commit.PostpaidCommitTrueupLedgerEntry
790
+ | Commit.PrepaidCommitManualLedgerEntry
791
+ | Commit.PostpaidCommitManualLedgerEntry
792
+ | Commit.PostpaidCommitExpirationLedgerEntry
793
+ >;
794
+
795
+ name?: string;
515
796
 
516
797
  /**
517
- * Specify the threshold amount for the contract. Each time the contract's prepaid
518
- * balance lowers to this amount, a threshold charge will be initiated.
798
+ * This field's availability is dependent on your client's configuration.
519
799
  */
520
- threshold_amount: number;
800
+ netsuite_sales_order_id?: string;
521
801
 
522
802
  /**
523
- * If provided, the threshold, recharge-to amount, and the resulting threshold
524
- * commit amount will be in terms of this credit type instead of the fiat currency.
803
+ * If multiple credits or commits are applicable, the one with the lower priority
804
+ * will apply first.
525
805
  */
526
- custom_credit_type_id?: string;
527
- }
806
+ priority?: number;
528
807
 
529
- export namespace PrepaidBalanceThresholdConfiguration {
530
- export interface Commit {
531
- /**
532
- * The commit product that will be used to generate the line item for commit
533
- * payment.
534
- */
535
- product_id: string;
808
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
536
809
 
537
- /**
538
- * Which products the threshold commit applies to. If applicable_product_ids,
539
- * applicable_product_tags or specifiers are not provided, the commit applies to
540
- * all products.
541
- */
542
- applicable_product_ids?: Array<string>;
810
+ rolled_over_from?: Commit.RolledOverFrom;
543
811
 
544
- /**
545
- * Which tags the threshold commit applies to. If applicable_product_ids,
546
- * applicable_product_tags or specifiers are not provided, the commit applies to
547
- * all products.
548
- */
549
- applicable_product_tags?: Array<string>;
812
+ rollover_fraction?: number;
550
813
 
551
- description?: string;
814
+ /**
815
+ * This field's availability is dependent on your client's configuration.
816
+ */
817
+ salesforce_opportunity_id?: string;
818
+
819
+ /**
820
+ * List of filters that determine what kind of customer usage draws down a commit
821
+ * or credit. A customer's usage needs to meet the condition of at least one of the
822
+ * specifiers to contribute to a commit's or credit's drawdown.
823
+ */
824
+ specifiers?: Array<Shared.CommitSpecifier>;
825
+ }
826
+
827
+ export namespace Commit {
828
+ export interface Product {
829
+ id: string;
830
+
831
+ name: string;
832
+ }
833
+
834
+ export interface Contract {
835
+ id: string;
836
+ }
837
+
838
+ /**
839
+ * The contract that this commit will be billed on.
840
+ */
841
+ export interface InvoiceContract {
842
+ id: string;
843
+ }
844
+
845
+ export interface PrepaidCommitSegmentStartLedgerEntry {
846
+ amount: number;
847
+
848
+ segment_id: string;
849
+
850
+ timestamp: string;
851
+
852
+ type: 'PREPAID_COMMIT_SEGMENT_START';
853
+ }
854
+
855
+ export interface PrepaidCommitAutomatedInvoiceDeductionLedgerEntry {
856
+ amount: number;
857
+
858
+ invoice_id: string;
859
+
860
+ segment_id: string;
861
+
862
+ timestamp: string;
863
+
864
+ type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
865
+
866
+ contract_id?: string;
867
+ }
868
+
869
+ export interface PrepaidCommitRolloverLedgerEntry {
870
+ amount: number;
871
+
872
+ new_contract_id: string;
873
+
874
+ segment_id: string;
875
+
876
+ timestamp: string;
877
+
878
+ type: 'PREPAID_COMMIT_ROLLOVER';
879
+ }
880
+
881
+ export interface PrepaidCommitExpirationLedgerEntry {
882
+ amount: number;
883
+
884
+ segment_id: string;
885
+
886
+ timestamp: string;
887
+
888
+ type: 'PREPAID_COMMIT_EXPIRATION';
889
+ }
890
+
891
+ export interface PrepaidCommitCanceledLedgerEntry {
892
+ amount: number;
893
+
894
+ invoice_id: string;
895
+
896
+ segment_id: string;
897
+
898
+ timestamp: string;
899
+
900
+ type: 'PREPAID_COMMIT_CANCELED';
901
+
902
+ contract_id?: string;
903
+ }
904
+
905
+ export interface PrepaidCommitCreditedLedgerEntry {
906
+ amount: number;
907
+
908
+ invoice_id: string;
909
+
910
+ segment_id: string;
911
+
912
+ timestamp: string;
913
+
914
+ type: 'PREPAID_COMMIT_CREDITED';
915
+
916
+ contract_id?: string;
917
+ }
918
+
919
+ export interface PrepaidCommitSeatBasedAdjustmentLedgerEntry {
920
+ amount: number;
921
+
922
+ segment_id: string;
923
+
924
+ timestamp: string;
925
+
926
+ type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT';
927
+ }
928
+
929
+ export interface PostpaidCommitInitialBalanceLedgerEntry {
930
+ amount: number;
931
+
932
+ timestamp: string;
933
+
934
+ type: 'POSTPAID_COMMIT_INITIAL_BALANCE';
935
+ }
936
+
937
+ export interface PostpaidCommitAutomatedInvoiceDeductionLedgerEntry {
938
+ amount: number;
939
+
940
+ invoice_id: string;
941
+
942
+ segment_id: string;
943
+
944
+ timestamp: string;
945
+
946
+ type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
947
+
948
+ contract_id?: string;
949
+ }
950
+
951
+ export interface PostpaidCommitRolloverLedgerEntry {
952
+ amount: number;
953
+
954
+ new_contract_id: string;
955
+
956
+ segment_id: string;
957
+
958
+ timestamp: string;
959
+
960
+ type: 'POSTPAID_COMMIT_ROLLOVER';
961
+ }
962
+
963
+ export interface PostpaidCommitTrueupLedgerEntry {
964
+ amount: number;
965
+
966
+ invoice_id: string;
967
+
968
+ timestamp: string;
969
+
970
+ type: 'POSTPAID_COMMIT_TRUEUP';
971
+
972
+ contract_id?: string;
973
+ }
974
+
975
+ export interface PrepaidCommitManualLedgerEntry {
976
+ amount: number;
977
+
978
+ reason: string;
979
+
980
+ timestamp: string;
981
+
982
+ type: 'PREPAID_COMMIT_MANUAL';
983
+ }
984
+
985
+ export interface PostpaidCommitManualLedgerEntry {
986
+ amount: number;
987
+
988
+ reason: string;
989
+
990
+ timestamp: string;
991
+
992
+ type: 'POSTPAID_COMMIT_MANUAL';
993
+ }
994
+
995
+ export interface PostpaidCommitExpirationLedgerEntry {
996
+ amount: number;
997
+
998
+ timestamp: string;
999
+
1000
+ type: 'POSTPAID_COMMIT_EXPIRATION';
1001
+ }
1002
+
1003
+ export interface RolledOverFrom {
1004
+ commit_id: string;
1005
+
1006
+ contract_id: string;
1007
+ }
1008
+ }
1009
+
1010
+ export interface Override {
1011
+ id: string;
1012
+
1013
+ starting_at: string;
1014
+
1015
+ applicable_product_tags?: Array<string>;
1016
+
1017
+ ending_before?: string;
1018
+
1019
+ entitled?: boolean;
1020
+
1021
+ is_commit_specific?: boolean;
1022
+
1023
+ multiplier?: number;
1024
+
1025
+ override_specifiers?: Array<Override.OverrideSpecifier>;
1026
+
1027
+ override_tiers?: Array<Shared.OverrideTier>;
1028
+
1029
+ overwrite_rate?: Override.OverwriteRate;
1030
+
1031
+ priority?: number;
1032
+
1033
+ product?: Override.Product;
1034
+
1035
+ target?: 'COMMIT_RATE' | 'LIST_RATE';
1036
+
1037
+ type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
1038
+ }
1039
+
1040
+ export namespace Override {
1041
+ export interface OverrideSpecifier {
1042
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1043
+
1044
+ commit_ids?: Array<string>;
1045
+
1046
+ presentation_group_values?: { [key: string]: string | null };
1047
+
1048
+ pricing_group_values?: { [key: string]: string };
1049
+
1050
+ product_id?: string;
1051
+
1052
+ product_tags?: Array<string>;
1053
+
1054
+ recurring_commit_ids?: Array<string>;
1055
+
1056
+ recurring_credit_ids?: Array<string>;
1057
+ }
1058
+
1059
+ export interface OverwriteRate {
1060
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
1061
+
1062
+ credit_type?: Shared.CreditTypeData;
1063
+
1064
+ /**
1065
+ * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1066
+ * processors.
1067
+ */
1068
+ custom_rate?: { [key: string]: unknown };
1069
+
1070
+ /**
1071
+ * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
1072
+ * set to true.
1073
+ */
1074
+ is_prorated?: boolean;
1075
+
1076
+ /**
1077
+ * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
1078
+ * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
1079
+ */
1080
+ price?: number;
1081
+
1082
+ /**
1083
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
1084
+ */
1085
+ quantity?: number;
1086
+
1087
+ /**
1088
+ * Only set for TIERED rate_type.
1089
+ */
1090
+ tiers?: Array<Shared.Tier>;
1091
+ }
1092
+
1093
+ export interface Product {
1094
+ id: string;
1095
+
1096
+ name: string;
1097
+ }
1098
+ }
1099
+
1100
+ export interface Transition {
1101
+ from_contract_id: string;
1102
+
1103
+ to_contract_id: string;
1104
+
1105
+ type: 'SUPERSEDE' | 'RENEWAL';
1106
+ }
1107
+
1108
+ export interface UsageFilter {
1109
+ group_key: string;
1110
+
1111
+ group_values: Array<string>;
1112
+
1113
+ /**
1114
+ * This will match contract starting_at value if usage filter is active from the
1115
+ * beginning of the contract.
1116
+ */
1117
+ starting_at: string;
1118
+
1119
+ /**
1120
+ * This will match contract ending_before value if usage filter is active until the
1121
+ * end of the contract. It will be undefined if the contract is open-ended.
1122
+ */
1123
+ ending_before?: string;
1124
+ }
1125
+
1126
+ export interface UsageStatementSchedule {
1127
+ /**
1128
+ * Contract usage statements follow a selected cadence based on this date.
1129
+ */
1130
+ billing_anchor_date: string;
1131
+
1132
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1133
+ }
1134
+
1135
+ export interface Credit {
1136
+ id: string;
1137
+
1138
+ product: Credit.Product;
1139
+
1140
+ type: 'CREDIT';
1141
+
1142
+ /**
1143
+ * The schedule that the customer will gain access to the credits.
1144
+ */
1145
+ access_schedule?: Shared.ScheduleDuration;
1146
+
1147
+ applicable_contract_ids?: Array<string>;
1148
+
1149
+ applicable_product_ids?: Array<string>;
1150
+
1151
+ applicable_product_tags?: Array<string>;
1152
+
1153
+ /**
1154
+ * The current balance of the credit or commit. This balance reflects the amount of
1155
+ * credit or commit that the customer has access to use at this moment - thus,
1156
+ * expired and upcoming credit or commit segments contribute 0 to the balance. The
1157
+ * balance will match the sum of all ledger entries with the exception of the case
1158
+ * where the sum of negative manual ledger entries exceeds the positive amount
1159
+ * remaining on the credit or commit - in that case, the balance will be 0. All
1160
+ * manual ledger entries associated with active credit or commit segments are
1161
+ * included in the balance, including future-dated manual ledger entries.
1162
+ */
1163
+ balance?: number;
1164
+
1165
+ contract?: Credit.Contract;
1166
+
1167
+ /**
1168
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1169
+ */
1170
+ custom_fields?: { [key: string]: string };
1171
+
1172
+ description?: string;
1173
+
1174
+ /**
1175
+ * Optional configuration for credit hierarchy access control
1176
+ */
1177
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1178
+
1179
+ /**
1180
+ * A list of ordered events that impact the balance of a credit. For example, an
1181
+ * invoice deduction or an expiration.
1182
+ */
1183
+ ledger?: Array<
1184
+ | Credit.CreditSegmentStartLedgerEntry
1185
+ | Credit.CreditAutomatedInvoiceDeductionLedgerEntry
1186
+ | Credit.CreditExpirationLedgerEntry
1187
+ | Credit.CreditCanceledLedgerEntry
1188
+ | Credit.CreditCreditedLedgerEntry
1189
+ | Credit.CreditManualLedgerEntry
1190
+ | Credit.CreditSeatBasedAdjustmentLedgerEntry
1191
+ >;
1192
+
1193
+ name?: string;
1194
+
1195
+ /**
1196
+ * This field's availability is dependent on your client's configuration.
1197
+ */
1198
+ netsuite_sales_order_id?: string;
1199
+
1200
+ /**
1201
+ * If multiple credits or commits are applicable, the one with the lower priority
1202
+ * will apply first.
1203
+ */
1204
+ priority?: number;
1205
+
1206
+ /**
1207
+ * This field's availability is dependent on your client's configuration.
1208
+ */
1209
+ salesforce_opportunity_id?: string;
1210
+
1211
+ /**
1212
+ * List of filters that determine what kind of customer usage draws down a commit
1213
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1214
+ * specifiers to contribute to a commit's or credit's drawdown.
1215
+ */
1216
+ specifiers?: Array<Shared.CommitSpecifier>;
1217
+ }
1218
+
1219
+ export namespace Credit {
1220
+ export interface Product {
1221
+ id: string;
1222
+
1223
+ name: string;
1224
+ }
1225
+
1226
+ export interface Contract {
1227
+ id: string;
1228
+ }
1229
+
1230
+ export interface CreditSegmentStartLedgerEntry {
1231
+ amount: number;
1232
+
1233
+ segment_id: string;
1234
+
1235
+ timestamp: string;
1236
+
1237
+ type: 'CREDIT_SEGMENT_START';
1238
+ }
1239
+
1240
+ export interface CreditAutomatedInvoiceDeductionLedgerEntry {
1241
+ amount: number;
1242
+
1243
+ invoice_id: string;
1244
+
1245
+ segment_id: string;
1246
+
1247
+ timestamp: string;
1248
+
1249
+ type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION';
1250
+
1251
+ contract_id?: string;
1252
+ }
1253
+
1254
+ export interface CreditExpirationLedgerEntry {
1255
+ amount: number;
1256
+
1257
+ segment_id: string;
1258
+
1259
+ timestamp: string;
1260
+
1261
+ type: 'CREDIT_EXPIRATION';
1262
+ }
1263
+
1264
+ export interface CreditCanceledLedgerEntry {
1265
+ amount: number;
1266
+
1267
+ invoice_id: string;
1268
+
1269
+ segment_id: string;
1270
+
1271
+ timestamp: string;
1272
+
1273
+ type: 'CREDIT_CANCELED';
1274
+
1275
+ contract_id?: string;
1276
+ }
1277
+
1278
+ export interface CreditCreditedLedgerEntry {
1279
+ amount: number;
1280
+
1281
+ invoice_id: string;
1282
+
1283
+ segment_id: string;
1284
+
1285
+ timestamp: string;
1286
+
1287
+ type: 'CREDIT_CREDITED';
1288
+
1289
+ contract_id?: string;
1290
+ }
1291
+
1292
+ export interface CreditManualLedgerEntry {
1293
+ amount: number;
1294
+
1295
+ reason: string;
1296
+
1297
+ timestamp: string;
1298
+
1299
+ type: 'CREDIT_MANUAL';
1300
+ }
1301
+
1302
+ export interface CreditSeatBasedAdjustmentLedgerEntry {
1303
+ amount: number;
1304
+
1305
+ segment_id: string;
1306
+
1307
+ timestamp: string;
1308
+
1309
+ type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
1310
+ }
1311
+ }
1312
+
1313
+ /**
1314
+ * This field's availability is dependent on your client's configuration.
1315
+ */
1316
+ export interface CustomerBillingProviderConfiguration {
1317
+ /**
1318
+ * ID of Customer's billing provider configuration.
1319
+ */
1320
+ id: string;
1321
+
1322
+ billing_provider:
1323
+ | 'aws_marketplace'
1324
+ | 'stripe'
1325
+ | 'netsuite'
1326
+ | 'custom'
1327
+ | 'azure_marketplace'
1328
+ | 'quickbooks_online'
1329
+ | 'workday'
1330
+ | 'gcp_marketplace';
1331
+
1332
+ delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
1333
+ }
1334
+
1335
+ /**
1336
+ * Indicates whether there are more items than the limit for this endpoint. Use the
1337
+ * respective list endpoints to get the full lists.
1338
+ */
1339
+ export interface HasMore {
1340
+ /**
1341
+ * Whether there are more commits on this contract than the limit for this
1342
+ * endpoint. Use the /contracts/customerCommits/list endpoint to get the full list
1343
+ * of commits.
1344
+ */
1345
+ commits: boolean;
1346
+
1347
+ /**
1348
+ * Whether there are more credits on this contract than the limit for this
1349
+ * endpoint. Use the /contracts/customerCredits/list endpoint to get the full list
1350
+ * of credits.
1351
+ */
1352
+ credits: boolean;
1353
+ }
1354
+
1355
+ export interface ParentHierarchyConfiguration {
1356
+ /**
1357
+ * List of contracts that belong to this parent.
1358
+ */
1359
+ children: Array<ParentHierarchyConfiguration.Child>;
1360
+
1361
+ parent_behavior?: ParentHierarchyConfiguration.ParentBehavior;
1362
+ }
1363
+
1364
+ export namespace ParentHierarchyConfiguration {
1365
+ export interface Child {
1366
+ contract_id: string;
1367
+
1368
+ customer_id: string;
1369
+ }
1370
+
1371
+ export interface ParentBehavior {
1372
+ /**
1373
+ * Indicates the desired behavior of consolidated invoices generated by the parent
1374
+ * in a customer hierarchy **CONCATENATE**: Statements on the invoices of child
1375
+ * customers will be appended to the consolidated invoice **NONE**: Do not generate
1376
+ * consolidated invoices
1377
+ */
1378
+ invoice_consolidation_type?: 'CONCATENATE' | 'NONE';
1379
+ }
1380
+ }
1381
+
1382
+ export interface ChildHierarchyConfigurationV2 {
1383
+ /**
1384
+ * The single parent contract/customer for this child.
1385
+ */
1386
+ parent: ChildHierarchyConfigurationV2.Parent;
1387
+
1388
+ /**
1389
+ * Indicates whether the child or parent should pay for the child's invoice charges
1390
+ */
1391
+ payer?: 'SELF' | 'PARENT';
1392
+
1393
+ /**
1394
+ * Indicates the behavior of the child's invoice statements on the parent's
1395
+ * invoices **CONSOLIDATE**: Child's invoice statements will be added to parent's
1396
+ * consolidated invoices **SEPARATE**: Child's invoice statements will appear not
1397
+ * appear on parent's consolidated invoices
1398
+ */
1399
+ usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE';
1400
+ }
1401
+
1402
+ export namespace ChildHierarchyConfigurationV2 {
1403
+ /**
1404
+ * The single parent contract/customer for this child.
1405
+ */
1406
+ export interface Parent {
1407
+ contract_id: string;
1408
+
1409
+ customer_id: string;
1410
+ }
1411
+ }
1412
+
1413
+ export interface RecurringCommit {
1414
+ id: string;
1415
+
1416
+ /**
1417
+ * The amount of commit to grant.
1418
+ */
1419
+ access_amount: RecurringCommit.AccessAmount;
1420
+
1421
+ /**
1422
+ * The amount of time the created commits will be valid for
1423
+ */
1424
+ commit_duration: RecurringCommit.CommitDuration;
1425
+
1426
+ /**
1427
+ * Will be passed down to the individual commits
1428
+ */
1429
+ priority: number;
1430
+
1431
+ product: RecurringCommit.Product;
1432
+
1433
+ /**
1434
+ * Whether the created commits will use the commit rate or list rate
1435
+ */
1436
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
1437
+
1438
+ /**
1439
+ * Determines the start time for the first commit
1440
+ */
1441
+ starting_at: string;
1442
+
1443
+ /**
1444
+ * Will be passed down to the individual commits
1445
+ */
1446
+ applicable_product_ids?: Array<string>;
1447
+
1448
+ /**
1449
+ * Will be passed down to the individual commits
1450
+ */
1451
+ applicable_product_tags?: Array<string>;
1452
+
1453
+ contract?: RecurringCommit.Contract;
1454
+
1455
+ /**
1456
+ * Will be passed down to the individual commits
1457
+ */
1458
+ description?: string;
1459
+
1460
+ /**
1461
+ * Determines when the contract will stop creating recurring commits. Optional
1462
+ */
1463
+ ending_before?: string;
1464
+
1465
+ /**
1466
+ * Optional configuration for recurring credit hierarchy access control
1467
+ */
1468
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1469
+
1470
+ /**
1471
+ * The amount the customer should be billed for the commit. Not required.
1472
+ */
1473
+ invoice_amount?: RecurringCommit.InvoiceAmount;
1474
+
1475
+ /**
1476
+ * Displayed on invoices. Will be passed through to the individual commits
1477
+ */
1478
+ name?: string;
1479
+
1480
+ /**
1481
+ * Will be passed down to the individual commits
1482
+ */
1483
+ netsuite_sales_order_id?: string;
1484
+
1485
+ /**
1486
+ * Determines whether the first and last commit will be prorated. If not provided,
1487
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1488
+ */
1489
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1490
+
1491
+ /**
1492
+ * The frequency at which the recurring commits will be created. If not provided: -
1493
+ * The commits will be created on the usage invoice frequency. If provided: - The
1494
+ * period defined in the duration will correspond to this frequency. - Commits will
1495
+ * be created aligned with the recurring commit's starting_at rather than the usage
1496
+ * invoice dates.
1497
+ */
1498
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1499
+
1500
+ /**
1501
+ * Will be passed down to the individual commits. This controls how much of an
1502
+ * individual unexpired commit will roll over upon contract transition. Must be
1503
+ * between 0 and 1.
1504
+ */
1505
+ rollover_fraction?: number;
1506
+
1507
+ /**
1508
+ * List of filters that determine what kind of customer usage draws down a commit
1509
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1510
+ * specifiers to contribute to a commit's or credit's drawdown.
1511
+ */
1512
+ specifiers?: Array<Shared.CommitSpecifier>;
1513
+
1514
+ /**
1515
+ * Attach a subscription to the recurring commit/credit.
1516
+ */
1517
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
1518
+ }
1519
+
1520
+ export namespace RecurringCommit {
1521
+ /**
1522
+ * The amount of commit to grant.
1523
+ */
1524
+ export interface AccessAmount {
1525
+ credit_type_id: string;
1526
+
1527
+ unit_price: number;
1528
+
1529
+ quantity?: number;
1530
+ }
1531
+
1532
+ /**
1533
+ * The amount of time the created commits will be valid for
1534
+ */
1535
+ export interface CommitDuration {
1536
+ value: number;
1537
+
1538
+ unit?: 'PERIODS';
1539
+ }
1540
+
1541
+ export interface Product {
1542
+ id: string;
1543
+
1544
+ name: string;
1545
+ }
1546
+
1547
+ export interface Contract {
1548
+ id: string;
1549
+ }
1550
+
1551
+ /**
1552
+ * The amount the customer should be billed for the commit. Not required.
1553
+ */
1554
+ export interface InvoiceAmount {
1555
+ credit_type_id: string;
1556
+
1557
+ quantity: number;
1558
+
1559
+ unit_price: number;
1560
+ }
1561
+ }
1562
+
1563
+ export interface RecurringCredit {
1564
+ id: string;
1565
+
1566
+ /**
1567
+ * The amount of commit to grant.
1568
+ */
1569
+ access_amount: RecurringCredit.AccessAmount;
1570
+
1571
+ /**
1572
+ * The amount of time the created commits will be valid for
1573
+ */
1574
+ commit_duration: RecurringCredit.CommitDuration;
1575
+
1576
+ /**
1577
+ * Will be passed down to the individual commits
1578
+ */
1579
+ priority: number;
1580
+
1581
+ product: RecurringCredit.Product;
1582
+
1583
+ /**
1584
+ * Whether the created commits will use the commit rate or list rate
1585
+ */
1586
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
1587
+
1588
+ /**
1589
+ * Determines the start time for the first commit
1590
+ */
1591
+ starting_at: string;
1592
+
1593
+ /**
1594
+ * Will be passed down to the individual commits
1595
+ */
1596
+ applicable_product_ids?: Array<string>;
1597
+
1598
+ /**
1599
+ * Will be passed down to the individual commits
1600
+ */
1601
+ applicable_product_tags?: Array<string>;
1602
+
1603
+ contract?: RecurringCredit.Contract;
1604
+
1605
+ /**
1606
+ * Will be passed down to the individual commits
1607
+ */
1608
+ description?: string;
1609
+
1610
+ /**
1611
+ * Determines when the contract will stop creating recurring commits. Optional
1612
+ */
1613
+ ending_before?: string;
1614
+
1615
+ /**
1616
+ * Optional configuration for recurring credit hierarchy access control
1617
+ */
1618
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1619
+
1620
+ /**
1621
+ * Displayed on invoices. Will be passed through to the individual commits
1622
+ */
1623
+ name?: string;
1624
+
1625
+ /**
1626
+ * Will be passed down to the individual commits
1627
+ */
1628
+ netsuite_sales_order_id?: string;
1629
+
1630
+ /**
1631
+ * Determines whether the first and last commit will be prorated. If not provided,
1632
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1633
+ */
1634
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1635
+
1636
+ /**
1637
+ * The frequency at which the recurring commits will be created. If not provided: -
1638
+ * The commits will be created on the usage invoice frequency. If provided: - The
1639
+ * period defined in the duration will correspond to this frequency. - Commits will
1640
+ * be created aligned with the recurring commit's starting_at rather than the usage
1641
+ * invoice dates.
1642
+ */
1643
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1644
+
1645
+ /**
1646
+ * Will be passed down to the individual commits. This controls how much of an
1647
+ * individual unexpired commit will roll over upon contract transition. Must be
1648
+ * between 0 and 1.
1649
+ */
1650
+ rollover_fraction?: number;
1651
+
1652
+ /**
1653
+ * List of filters that determine what kind of customer usage draws down a commit
1654
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1655
+ * specifiers to contribute to a commit's or credit's drawdown.
1656
+ */
1657
+ specifiers?: Array<Shared.CommitSpecifier>;
1658
+
1659
+ /**
1660
+ * Attach a subscription to the recurring commit/credit.
1661
+ */
1662
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
1663
+ }
1664
+
1665
+ export namespace RecurringCredit {
1666
+ /**
1667
+ * The amount of commit to grant.
1668
+ */
1669
+ export interface AccessAmount {
1670
+ credit_type_id: string;
1671
+
1672
+ unit_price: number;
1673
+
1674
+ quantity?: number;
1675
+ }
1676
+
1677
+ /**
1678
+ * The amount of time the created commits will be valid for
1679
+ */
1680
+ export interface CommitDuration {
1681
+ value: number;
1682
+
1683
+ unit?: 'PERIODS';
1684
+ }
1685
+
1686
+ export interface Product {
1687
+ id: string;
1688
+
1689
+ name: string;
1690
+ }
1691
+
1692
+ export interface Contract {
1693
+ id: string;
1694
+ }
1695
+ }
1696
+
1697
+ export interface ResellerRoyalty {
1698
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
1699
+
1700
+ segments: Array<ResellerRoyalty.Segment>;
1701
+ }
1702
+
1703
+ export namespace ResellerRoyalty {
1704
+ export interface Segment {
1705
+ fraction: number;
1706
+
1707
+ netsuite_reseller_id: string;
1708
+
1709
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
1710
+
1711
+ starting_at: string;
1712
+
1713
+ applicable_product_ids?: Array<string>;
1714
+
1715
+ applicable_product_tags?: Array<string>;
1716
+
1717
+ aws_account_number?: string;
1718
+
1719
+ aws_offer_id?: string;
1720
+
1721
+ aws_payer_reference_id?: string;
1722
+
1723
+ ending_before?: string;
1724
+
1725
+ gcp_account_id?: string;
1726
+
1727
+ gcp_offer_id?: string;
1728
+
1729
+ reseller_contract_value?: number;
1730
+ }
1731
+ }
1732
+ }
1733
+
1734
+ export interface ContractWithoutAmendments {
1735
+ commits: Array<Commit>;
1736
+
1737
+ created_at: string;
1738
+
1739
+ created_by: string;
1740
+
1741
+ overrides: Array<Override>;
1742
+
1743
+ scheduled_charges: Array<ScheduledCharge>;
1744
+
1745
+ starting_at: string;
1746
+
1747
+ transitions: Array<ContractWithoutAmendments.Transition>;
1748
+
1749
+ usage_statement_schedule: ContractWithoutAmendments.UsageStatementSchedule;
1750
+
1751
+ credits?: Array<Credit>;
1752
+
1753
+ /**
1754
+ * This field's availability is dependent on your client's
1755
+ */
1756
+ discounts?: Array<Discount>;
1757
+
1758
+ ending_before?: string;
552
1759
 
553
- /**
554
- * Specify the name of the line item for the threshold charge. If left blank, it
555
- * will default to the commit product name.
556
- */
557
- name?: string;
1760
+ /**
1761
+ * Either a **parent** configuration with a list of children or a **child**
1762
+ * configuration with a single parent.
1763
+ */
1764
+ hierarchy_configuration?: HierarchyConfiguration;
558
1765
 
559
- /**
560
- * List of filters that determine what kind of customer usage draws down a commit
561
- * or credit. A customer's usage needs to meet the condition of at least one of the
562
- * specifiers to contribute to a commit's or credit's drawdown. This field cannot
563
- * be used together with `applicable_product_ids` or `applicable_product_tags`.
564
- */
565
- specifiers?: Array<Commit.Specifier>;
566
- }
1766
+ name?: string;
567
1767
 
568
- export namespace Commit {
569
- export interface Specifier {
570
- presentation_group_values?: { [key: string]: string };
1768
+ net_payment_terms_days?: number;
571
1769
 
572
- pricing_group_values?: { [key: string]: string };
1770
+ /**
1771
+ * This field's availability is dependent on your client's configuration.
1772
+ */
1773
+ netsuite_sales_order_id?: string;
573
1774
 
574
- /**
575
- * If provided, the specifier will only apply to the product with the specified ID.
576
- */
577
- product_id?: string;
1775
+ prepaid_balance_threshold_configuration?: PrepaidBalanceThresholdConfiguration;
578
1776
 
579
- /**
580
- * If provided, the specifier will only apply to products with all the specified
581
- * tags.
582
- */
583
- product_tags?: Array<string>;
584
- }
585
- }
1777
+ /**
1778
+ * This field's availability is dependent on your client's configuration.
1779
+ */
1780
+ professional_services?: Array<ProService>;
586
1781
 
587
- export interface PaymentGateConfig {
588
- /**
589
- * Gate access to the commit balance based on successful collection of payment.
590
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
591
- * facilitate payment using your own payment integration. Select NONE if you do not
592
- * wish to payment gate the commit balance.
593
- */
594
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1782
+ rate_card_id?: string;
595
1783
 
596
- /**
597
- * Only applicable if using PRECALCULATED as your tax type.
598
- */
599
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1784
+ recurring_commits?: Array<ContractWithoutAmendments.RecurringCommit>;
600
1785
 
601
- /**
602
- * Only applicable if using STRIPE as your payment gate type.
603
- */
604
- stripe_config?: PaymentGateConfig.StripeConfig;
1786
+ recurring_credits?: Array<ContractWithoutAmendments.RecurringCredit>;
605
1787
 
606
- /**
607
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
608
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
609
- * will default to NONE.
610
- */
611
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
612
- }
1788
+ /**
1789
+ * This field's availability is dependent on your client's configuration.
1790
+ */
1791
+ reseller_royalties?: Array<ContractWithoutAmendments.ResellerRoyalty>;
613
1792
 
614
- export namespace PaymentGateConfig {
615
- /**
616
- * Only applicable if using PRECALCULATED as your tax type.
617
- */
618
- export interface PrecalculatedTaxConfig {
619
- /**
620
- * Amount of tax to be applied. This should be in the same currency and
621
- * denomination as the commit's invoice schedule
622
- */
623
- tax_amount: number;
624
-
625
- /**
626
- * Name of the tax to be applied. This may be used in an invoice line item
627
- * description.
628
- */
629
- tax_name?: string;
630
- }
1793
+ /**
1794
+ * This field's availability is dependent on your client's configuration.
1795
+ */
1796
+ salesforce_opportunity_id?: string;
631
1797
 
632
- /**
633
- * Only applicable if using STRIPE as your payment gate type.
634
- */
635
- export interface StripeConfig {
636
- /**
637
- * If left blank, will default to INVOICE
638
- */
639
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
640
-
641
- /**
642
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
643
- * your payment type.
644
- */
645
- invoice_metadata?: { [key: string]: string };
646
- }
647
- }
1798
+ /**
1799
+ * Determines which scheduled and commit charges to consolidate onto the Contract's
1800
+ * usage invoice. The charge's `timestamp` must match the usage invoice's
1801
+ * `ending_before` date for consolidation to occur. This field cannot be modified
1802
+ * after a Contract has been created. If this field is omitted, charges will appear
1803
+ * on a separate invoice from usage charges.
1804
+ */
1805
+ scheduled_charges_on_usage_invoices?: 'ALL';
1806
+
1807
+ spend_threshold_configuration?: SpendThresholdConfiguration;
1808
+
1809
+ /**
1810
+ * This field's availability is dependent on your client's configuration.
1811
+ */
1812
+ total_contract_value?: number;
1813
+
1814
+ usage_filter?: ContractWithoutAmendments.UsageFilter;
1815
+ }
1816
+
1817
+ export namespace ContractWithoutAmendments {
1818
+ export interface Transition {
1819
+ from_contract_id: string;
1820
+
1821
+ to_contract_id: string;
1822
+
1823
+ type: 'SUPERSEDE' | 'RENEWAL';
1824
+ }
1825
+
1826
+ export interface UsageStatementSchedule {
1827
+ /**
1828
+ * Contract usage statements follow a selected cadence based on this date.
1829
+ */
1830
+ billing_anchor_date: string;
1831
+
1832
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
648
1833
  }
649
1834
 
650
1835
  export interface RecurringCommit {
@@ -702,7 +1887,7 @@ export namespace ContractWithoutAmendments {
702
1887
  /**
703
1888
  * Optional configuration for recurring commit/credit hierarchy access control
704
1889
  */
705
- hierarchy_configuration?: RecurringCommit.HierarchyConfiguration;
1890
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
706
1891
 
707
1892
  /**
708
1893
  * The amount the customer should be billed for the commit. Not required.
@@ -746,12 +1931,12 @@ export namespace ContractWithoutAmendments {
746
1931
  * or credit. A customer's usage needs to meet the condition of at least one of the
747
1932
  * specifiers to contribute to a commit's or credit's drawdown.
748
1933
  */
749
- specifiers?: Array<RecurringCommit.Specifier>;
1934
+ specifiers?: Array<Shared.CommitSpecifier>;
750
1935
 
751
1936
  /**
752
1937
  * Attach a subscription to the recurring commit/credit.
753
1938
  */
754
- subscription_config?: RecurringCommit.SubscriptionConfig;
1939
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
755
1940
  }
756
1941
 
757
1942
  export namespace RecurringCommit {
@@ -785,32 +1970,6 @@ export namespace ContractWithoutAmendments {
785
1970
  id: string;
786
1971
  }
787
1972
 
788
- /**
789
- * Optional configuration for recurring commit/credit hierarchy access control
790
- */
791
- export interface HierarchyConfiguration {
792
- child_access:
793
- | HierarchyConfiguration.CommitHierarchyChildAccessAll
794
- | HierarchyConfiguration.CommitHierarchyChildAccessNone
795
- | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
796
- }
797
-
798
- export namespace HierarchyConfiguration {
799
- export interface CommitHierarchyChildAccessAll {
800
- type: 'ALL';
801
- }
802
-
803
- export interface CommitHierarchyChildAccessNone {
804
- type: 'NONE';
805
- }
806
-
807
- export interface CommitHierarchyChildAccessContractIDs {
808
- contract_ids: Array<string>;
809
-
810
- type: 'CONTRACT_IDS';
811
- }
812
- }
813
-
814
1973
  /**
815
1974
  * The amount the customer should be billed for the commit. Not required.
816
1975
  */
@@ -821,43 +1980,6 @@ export namespace ContractWithoutAmendments {
821
1980
 
822
1981
  unit_price: number;
823
1982
  }
824
-
825
- export interface Specifier {
826
- presentation_group_values?: { [key: string]: string };
827
-
828
- pricing_group_values?: { [key: string]: string };
829
-
830
- /**
831
- * If provided, the specifier will only apply to the product with the specified ID.
832
- */
833
- product_id?: string;
834
-
835
- /**
836
- * If provided, the specifier will only apply to products with all the specified
837
- * tags.
838
- */
839
- product_tags?: Array<string>;
840
- }
841
-
842
- /**
843
- * Attach a subscription to the recurring commit/credit.
844
- */
845
- export interface SubscriptionConfig {
846
- allocation: 'INDIVIDUAL' | 'POOLED';
847
-
848
- apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
849
-
850
- subscription_id: string;
851
- }
852
-
853
- export namespace SubscriptionConfig {
854
- export interface ApplySeatIncreaseConfig {
855
- /**
856
- * Indicates whether a mid-period seat increase should be prorated.
857
- */
858
- is_prorated: boolean;
859
- }
860
- }
861
1983
  }
862
1984
 
863
1985
  export interface RecurringCredit {
@@ -915,7 +2037,7 @@ export namespace ContractWithoutAmendments {
915
2037
  /**
916
2038
  * Optional configuration for recurring commit/credit hierarchy access control
917
2039
  */
918
- hierarchy_configuration?: RecurringCredit.HierarchyConfiguration;
2040
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
919
2041
 
920
2042
  /**
921
2043
  * Displayed on invoices. Will be passed through to the individual commits
@@ -954,12 +2076,12 @@ export namespace ContractWithoutAmendments {
954
2076
  * or credit. A customer's usage needs to meet the condition of at least one of the
955
2077
  * specifiers to contribute to a commit's or credit's drawdown.
956
2078
  */
957
- specifiers?: Array<RecurringCredit.Specifier>;
2079
+ specifiers?: Array<Shared.CommitSpecifier>;
958
2080
 
959
2081
  /**
960
2082
  * Attach a subscription to the recurring commit/credit.
961
2083
  */
962
- subscription_config?: RecurringCredit.SubscriptionConfig;
2084
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
963
2085
  }
964
2086
 
965
2087
  export namespace RecurringCredit {
@@ -992,69 +2114,6 @@ export namespace ContractWithoutAmendments {
992
2114
  export interface Contract {
993
2115
  id: string;
994
2116
  }
995
-
996
- /**
997
- * Optional configuration for recurring commit/credit hierarchy access control
998
- */
999
- export interface HierarchyConfiguration {
1000
- child_access:
1001
- | HierarchyConfiguration.CommitHierarchyChildAccessAll
1002
- | HierarchyConfiguration.CommitHierarchyChildAccessNone
1003
- | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1004
- }
1005
-
1006
- export namespace HierarchyConfiguration {
1007
- export interface CommitHierarchyChildAccessAll {
1008
- type: 'ALL';
1009
- }
1010
-
1011
- export interface CommitHierarchyChildAccessNone {
1012
- type: 'NONE';
1013
- }
1014
-
1015
- export interface CommitHierarchyChildAccessContractIDs {
1016
- contract_ids: Array<string>;
1017
-
1018
- type: 'CONTRACT_IDS';
1019
- }
1020
- }
1021
-
1022
- export interface Specifier {
1023
- presentation_group_values?: { [key: string]: string };
1024
-
1025
- pricing_group_values?: { [key: string]: string };
1026
-
1027
- /**
1028
- * If provided, the specifier will only apply to the product with the specified ID.
1029
- */
1030
- product_id?: string;
1031
-
1032
- /**
1033
- * If provided, the specifier will only apply to products with all the specified
1034
- * tags.
1035
- */
1036
- product_tags?: Array<string>;
1037
- }
1038
-
1039
- /**
1040
- * Attach a subscription to the recurring commit/credit.
1041
- */
1042
- export interface SubscriptionConfig {
1043
- allocation: 'INDIVIDUAL' | 'POOLED';
1044
-
1045
- apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
1046
-
1047
- subscription_id: string;
1048
- }
1049
-
1050
- export namespace SubscriptionConfig {
1051
- export interface ApplySeatIncreaseConfig {
1052
- /**
1053
- * Indicates whether a mid-period seat increase should be prorated.
1054
- */
1055
- is_prorated: boolean;
1056
- }
1057
- }
1058
2117
  }
1059
2118
 
1060
2119
  export interface ResellerRoyalty {
@@ -1085,105 +2144,6 @@ export namespace ContractWithoutAmendments {
1085
2144
  reseller_contract_value?: number;
1086
2145
  }
1087
2146
 
1088
- export interface SpendThresholdConfiguration {
1089
- commit: SpendThresholdConfiguration.Commit;
1090
-
1091
- /**
1092
- * When set to false, the contract will not be evaluated against the
1093
- * threshold_amount. Toggling to true will result an immediate evaluation,
1094
- * regardless of prior state.
1095
- */
1096
- is_enabled: boolean;
1097
-
1098
- payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
1099
-
1100
- /**
1101
- * Specify the threshold amount for the contract. Each time the contract's usage
1102
- * hits this amount, a threshold charge will be initiated.
1103
- */
1104
- threshold_amount: number;
1105
- }
1106
-
1107
- export namespace SpendThresholdConfiguration {
1108
- export interface Commit {
1109
- /**
1110
- * The commit product that will be used to generate the line item for commit
1111
- * payment.
1112
- */
1113
- product_id: string;
1114
-
1115
- description?: string;
1116
-
1117
- /**
1118
- * Specify the name of the line item for the threshold charge. If left blank, it
1119
- * will default to the commit product name.
1120
- */
1121
- name?: string;
1122
- }
1123
-
1124
- export interface PaymentGateConfig {
1125
- /**
1126
- * Gate access to the commit balance based on successful collection of payment.
1127
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1128
- * facilitate payment using your own payment integration. Select NONE if you do not
1129
- * wish to payment gate the commit balance.
1130
- */
1131
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1132
-
1133
- /**
1134
- * Only applicable if using PRECALCULATED as your tax type.
1135
- */
1136
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1137
-
1138
- /**
1139
- * Only applicable if using STRIPE as your payment gate type.
1140
- */
1141
- stripe_config?: PaymentGateConfig.StripeConfig;
1142
-
1143
- /**
1144
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1145
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1146
- * will default to NONE.
1147
- */
1148
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1149
- }
1150
-
1151
- export namespace PaymentGateConfig {
1152
- /**
1153
- * Only applicable if using PRECALCULATED as your tax type.
1154
- */
1155
- export interface PrecalculatedTaxConfig {
1156
- /**
1157
- * Amount of tax to be applied. This should be in the same currency and
1158
- * denomination as the commit's invoice schedule
1159
- */
1160
- tax_amount: number;
1161
-
1162
- /**
1163
- * Name of the tax to be applied. This may be used in an invoice line item
1164
- * description.
1165
- */
1166
- tax_name?: string;
1167
- }
1168
-
1169
- /**
1170
- * Only applicable if using STRIPE as your payment gate type.
1171
- */
1172
- export interface StripeConfig {
1173
- /**
1174
- * If left blank, will default to INVOICE
1175
- */
1176
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1177
-
1178
- /**
1179
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1180
- * your payment type.
1181
- */
1182
- invoice_metadata?: { [key: string]: string };
1183
- }
1184
- }
1185
- }
1186
-
1187
2147
  export interface UsageFilter {
1188
2148
  current: Shared.BaseUsageFilter | null;
1189
2149
 
@@ -1235,6 +2195,9 @@ export interface Credit {
1235
2195
 
1236
2196
  contract?: Credit.Contract;
1237
2197
 
2198
+ /**
2199
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2200
+ */
1238
2201
  custom_fields?: { [key: string]: string };
1239
2202
 
1240
2203
  description?: string;
@@ -1242,7 +2205,7 @@ export interface Credit {
1242
2205
  /**
1243
2206
  * Optional configuration for credit hierarchy access control
1244
2207
  */
1245
- hierarchy_configuration?: Credit.HierarchyConfiguration;
2208
+ hierarchy_configuration?: CommitHierarchyConfiguration;
1246
2209
 
1247
2210
  /**
1248
2211
  * A list of ordered events that impact the balance of a credit. For example, an
@@ -1283,7 +2246,7 @@ export interface Credit {
1283
2246
  * or credit. A customer's usage needs to meet the condition of at least one of the
1284
2247
  * specifiers to contribute to a commit's or credit's drawdown.
1285
2248
  */
1286
- specifiers?: Array<Credit.Specifier>;
2249
+ specifiers?: Array<CommitSpecifier>;
1287
2250
 
1288
2251
  /**
1289
2252
  * Prevents the creation of duplicates. If a request to create a commit or credit
@@ -1305,32 +2268,6 @@ export namespace Credit {
1305
2268
  id: string;
1306
2269
  }
1307
2270
 
1308
- /**
1309
- * Optional configuration for credit hierarchy access control
1310
- */
1311
- export interface HierarchyConfiguration {
1312
- child_access:
1313
- | HierarchyConfiguration.CommitHierarchyChildAccessAll
1314
- | HierarchyConfiguration.CommitHierarchyChildAccessNone
1315
- | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1316
- }
1317
-
1318
- export namespace HierarchyConfiguration {
1319
- export interface CommitHierarchyChildAccessAll {
1320
- type: 'ALL';
1321
- }
1322
-
1323
- export interface CommitHierarchyChildAccessNone {
1324
- type: 'NONE';
1325
- }
1326
-
1327
- export interface CommitHierarchyChildAccessContractIDs {
1328
- contract_ids: Array<string>;
1329
-
1330
- type: 'CONTRACT_IDS';
1331
- }
1332
- }
1333
-
1334
2271
  export interface CreditSegmentStartLedgerEntry {
1335
2272
  amount: number;
1336
2273
 
@@ -1412,23 +2349,6 @@ export namespace Credit {
1412
2349
 
1413
2350
  type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
1414
2351
  }
1415
-
1416
- export interface Specifier {
1417
- presentation_group_values?: { [key: string]: string };
1418
-
1419
- pricing_group_values?: { [key: string]: string };
1420
-
1421
- /**
1422
- * If provided, the specifier will only apply to the product with the specified ID.
1423
- */
1424
- product_id?: string;
1425
-
1426
- /**
1427
- * If provided, the specifier will only apply to products with all the specified
1428
- * tags.
1429
- */
1430
- product_tags?: Array<string>;
1431
- }
1432
2352
  }
1433
2353
 
1434
2354
  export interface CreditTypeData {
@@ -1444,6 +2364,9 @@ export interface Discount {
1444
2364
 
1445
2365
  schedule: SchedulePointInTime;
1446
2366
 
2367
+ /**
2368
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2369
+ */
1447
2370
  custom_fields?: { [key: string]: string };
1448
2371
 
1449
2372
  name?: string;
@@ -1481,6 +2404,74 @@ export interface EventTypeFilter {
1481
2404
  not_in_values?: Array<string>;
1482
2405
  }
1483
2406
 
2407
+ /**
2408
+ * Either a **parent** configuration with a list of children or a **child**
2409
+ * configuration with a single parent.
2410
+ */
2411
+ export type HierarchyConfiguration =
2412
+ | HierarchyConfiguration.ParentHierarchyConfiguration
2413
+ | HierarchyConfiguration.ChildHierarchyConfiguration;
2414
+
2415
+ export namespace HierarchyConfiguration {
2416
+ export interface ParentHierarchyConfiguration {
2417
+ /**
2418
+ * List of contracts that belong to this parent.
2419
+ */
2420
+ children: Array<ParentHierarchyConfiguration.Child>;
2421
+
2422
+ parent_behavior?: ParentHierarchyConfiguration.ParentBehavior;
2423
+ }
2424
+
2425
+ export namespace ParentHierarchyConfiguration {
2426
+ export interface Child {
2427
+ contract_id: string;
2428
+
2429
+ customer_id: string;
2430
+ }
2431
+
2432
+ export interface ParentBehavior {
2433
+ /**
2434
+ * Indicates the desired behavior of consolidated invoices generated by the parent
2435
+ * in a customer hierarchy **CONCATENATE**: Statements on the invoices of child
2436
+ * customers will be appended to the consolidated invoice **NONE**: Do not generate
2437
+ * consolidated invoices
2438
+ */
2439
+ invoice_consolidation_type?: 'CONCATENATE' | 'NONE';
2440
+ }
2441
+ }
2442
+
2443
+ export interface ChildHierarchyConfiguration {
2444
+ /**
2445
+ * The single parent contract/customer for this child.
2446
+ */
2447
+ parent: ChildHierarchyConfiguration.Parent;
2448
+
2449
+ /**
2450
+ * Indicates whether the parent should pay for the child's invoice charges
2451
+ */
2452
+ payer?: 'SELF' | 'PARENT';
2453
+
2454
+ /**
2455
+ * Indicates the behavior of the child's invoice statements on the parent's
2456
+ * invoices **CONSOLIDATE**: Child's invoice statements will be added to parent's
2457
+ * consolidated invoices **SEPARATE**: Child's invoice statements will appear not
2458
+ * appear on parent's consolidated invoices
2459
+ */
2460
+ usage_statement_behavior?: 'CONSOLIDATE' | 'SEPARATE';
2461
+ }
2462
+
2463
+ export namespace ChildHierarchyConfiguration {
2464
+ /**
2465
+ * The single parent contract/customer for this child.
2466
+ */
2467
+ export interface Parent {
2468
+ contract_id: string;
2469
+
2470
+ customer_id: string;
2471
+ }
2472
+ }
2473
+ }
2474
+
1484
2475
  export interface ID {
1485
2476
  id: string;
1486
2477
  }
@@ -1510,9 +2501,9 @@ export interface Override {
1510
2501
 
1511
2502
  override_specifiers?: Array<Override.OverrideSpecifier>;
1512
2503
 
1513
- override_tiers?: Array<Override.OverrideTier>;
2504
+ override_tiers?: Array<OverrideTier>;
1514
2505
 
1515
- overwrite_rate?: Override.OverwriteRate;
2506
+ overwrite_rate?: OverwriteRate;
1516
2507
 
1517
2508
  /**
1518
2509
  * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
@@ -1566,50 +2557,288 @@ export namespace Override {
1566
2557
  recurring_credit_ids?: Array<string>;
1567
2558
  }
1568
2559
 
1569
- export interface OverrideTier {
1570
- multiplier: number;
2560
+ export interface Product {
2561
+ id: string;
2562
+
2563
+ name: string;
2564
+ }
2565
+ }
2566
+
2567
+ export interface OverrideTier {
2568
+ multiplier: number;
2569
+
2570
+ size?: number;
2571
+ }
2572
+
2573
+ export interface OverwriteRate {
2574
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
2575
+
2576
+ credit_type?: CreditTypeData;
2577
+
2578
+ /**
2579
+ * Only set for CUSTOM rate_type. This field is interpreted by custom rate
2580
+ * processors.
2581
+ */
2582
+ custom_rate?: { [key: string]: unknown };
2583
+
2584
+ /**
2585
+ * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
2586
+ * set to true.
2587
+ */
2588
+ is_prorated?: boolean;
2589
+
2590
+ /**
2591
+ * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
2592
+ * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
2593
+ */
2594
+ price?: number;
2595
+
2596
+ /**
2597
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
2598
+ */
2599
+ quantity?: number;
2600
+
2601
+ /**
2602
+ * Only set for TIERED rate_type.
2603
+ */
2604
+ tiers?: Array<Tier>;
2605
+ }
2606
+
2607
+ export interface PaymentGateConfig {
2608
+ /**
2609
+ * Gate access to the commit balance based on successful collection of payment.
2610
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
2611
+ * facilitate payment using your own payment integration. Select NONE if you do not
2612
+ * wish to payment gate the commit balance.
2613
+ */
2614
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
2615
+
2616
+ /**
2617
+ * Only applicable if using PRECALCULATED as your tax type.
2618
+ */
2619
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
2620
+
2621
+ /**
2622
+ * Only applicable if using STRIPE as your payment gate type.
2623
+ */
2624
+ stripe_config?: PaymentGateConfig.StripeConfig;
2625
+
2626
+ /**
2627
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
2628
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
2629
+ * will default to NONE.
2630
+ */
2631
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'AVALARA' | 'PRECALCULATED';
2632
+ }
2633
+
2634
+ export namespace PaymentGateConfig {
2635
+ /**
2636
+ * Only applicable if using PRECALCULATED as your tax type.
2637
+ */
2638
+ export interface PrecalculatedTaxConfig {
2639
+ /**
2640
+ * Amount of tax to be applied. This should be in the same currency and
2641
+ * denomination as the commit's invoice schedule
2642
+ */
2643
+ tax_amount: number;
2644
+
2645
+ /**
2646
+ * Name of the tax to be applied. This may be used in an invoice line item
2647
+ * description.
2648
+ */
2649
+ tax_name?: string;
2650
+ }
2651
+
2652
+ /**
2653
+ * Only applicable if using STRIPE as your payment gate type.
2654
+ */
2655
+ export interface StripeConfig {
2656
+ /**
2657
+ * If left blank, will default to INVOICE
2658
+ */
2659
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1571
2660
 
1572
- size?: number;
2661
+ /**
2662
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
2663
+ * your payment type.
2664
+ */
2665
+ invoice_metadata?: { [key: string]: string };
1573
2666
  }
2667
+ }
2668
+
2669
+ export interface PaymentGateConfigV2 {
2670
+ /**
2671
+ * Gate access to the commit balance based on successful collection of payment.
2672
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
2673
+ * facilitate payment using your own payment integration. Select NONE if you do not
2674
+ * wish to payment gate the commit balance.
2675
+ */
2676
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
2677
+
2678
+ /**
2679
+ * Only applicable if using PRECALCULATED as your tax type.
2680
+ */
2681
+ precalculated_tax_config?: PaymentGateConfigV2.PrecalculatedTaxConfig;
2682
+
2683
+ /**
2684
+ * Only applicable if using STRIPE as your payment gateway type.
2685
+ */
2686
+ stripe_config?: PaymentGateConfigV2.StripeConfig;
2687
+
2688
+ /**
2689
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
2690
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
2691
+ * will default to NONE.
2692
+ */
2693
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'AVALARA' | 'PRECALCULATED';
2694
+ }
1574
2695
 
1575
- export interface OverwriteRate {
1576
- rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
2696
+ export namespace PaymentGateConfigV2 {
2697
+ /**
2698
+ * Only applicable if using PRECALCULATED as your tax type.
2699
+ */
2700
+ export interface PrecalculatedTaxConfig {
2701
+ /**
2702
+ * Amount of tax to be applied. This should be in the same currency and
2703
+ * denomination as the commit's invoice schedule
2704
+ */
2705
+ tax_amount: number;
1577
2706
 
1578
- credit_type?: Shared.CreditTypeData;
2707
+ /**
2708
+ * Name of the tax to be applied. This may be used in an invoice line item
2709
+ * description.
2710
+ */
2711
+ tax_name?: string;
2712
+ }
1579
2713
 
2714
+ /**
2715
+ * Only applicable if using STRIPE as your payment gateway type.
2716
+ */
2717
+ export interface StripeConfig {
1580
2718
  /**
1581
- * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1582
- * processors.
2719
+ * If left blank, will default to INVOICE
1583
2720
  */
1584
- custom_rate?: { [key: string]: unknown };
2721
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1585
2722
 
1586
2723
  /**
1587
- * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
1588
- * set to true.
2724
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
2725
+ * your payment type.
1589
2726
  */
1590
- is_prorated?: boolean;
2727
+ invoice_metadata?: { [key: string]: string };
2728
+ }
2729
+ }
2730
+
2731
+ export interface PrepaidBalanceThresholdConfiguration {
2732
+ commit: PrepaidBalanceThresholdConfiguration.Commit;
2733
+
2734
+ /**
2735
+ * When set to false, the contract will not be evaluated against the
2736
+ * threshold_amount. Toggling to true will result an immediate evaluation,
2737
+ * regardless of prior state.
2738
+ */
2739
+ is_enabled: boolean;
2740
+
2741
+ payment_gate_config: PaymentGateConfig;
2742
+
2743
+ /**
2744
+ * Specify the amount the balance should be recharged to.
2745
+ */
2746
+ recharge_to_amount: number;
2747
+
2748
+ /**
2749
+ * Specify the threshold amount for the contract. Each time the contract's prepaid
2750
+ * balance lowers to this amount, a threshold charge will be initiated.
2751
+ */
2752
+ threshold_amount: number;
2753
+
2754
+ /**
2755
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
2756
+ * commit amount will be in terms of this credit type instead of the fiat currency.
2757
+ */
2758
+ custom_credit_type_id?: string;
2759
+ }
1591
2760
 
2761
+ export namespace PrepaidBalanceThresholdConfiguration {
2762
+ export interface Commit extends Shared.BaseThresholdCommit {
1592
2763
  /**
1593
- * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
1594
- * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
2764
+ * Which products the threshold commit applies to. If applicable_product_ids,
2765
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2766
+ * all products.
1595
2767
  */
1596
- price?: number;
2768
+ applicable_product_ids?: Array<string>;
1597
2769
 
1598
2770
  /**
1599
- * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
2771
+ * Which tags the threshold commit applies to. If applicable_product_ids,
2772
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2773
+ * all products.
1600
2774
  */
1601
- quantity?: number;
2775
+ applicable_product_tags?: Array<string>;
1602
2776
 
1603
2777
  /**
1604
- * Only set for TIERED rate_type.
2778
+ * List of filters that determine what kind of customer usage draws down a commit
2779
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2780
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2781
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1605
2782
  */
1606
- tiers?: Array<Shared.Tier>;
2783
+ specifiers?: Array<Shared.CommitSpecifierInput>;
1607
2784
  }
2785
+ }
1608
2786
 
1609
- export interface Product {
1610
- id: string;
2787
+ export interface PrepaidBalanceThresholdConfigurationV2 {
2788
+ commit: PrepaidBalanceThresholdConfigurationV2.Commit;
1611
2789
 
1612
- name: string;
2790
+ /**
2791
+ * When set to false, the contract will not be evaluated against the
2792
+ * threshold_amount. Toggling to true will result an immediate evaluation,
2793
+ * regardless of prior state.
2794
+ */
2795
+ is_enabled: boolean;
2796
+
2797
+ payment_gate_config: PaymentGateConfigV2;
2798
+
2799
+ /**
2800
+ * Specify the amount the balance should be recharged to.
2801
+ */
2802
+ recharge_to_amount: number;
2803
+
2804
+ /**
2805
+ * Specify the threshold amount for the contract. Each time the contract's balance
2806
+ * lowers to this amount, a threshold charge will be initiated.
2807
+ */
2808
+ threshold_amount: number;
2809
+
2810
+ /**
2811
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
2812
+ * commit amount will be in terms of this credit type instead of the fiat currency.
2813
+ */
2814
+ custom_credit_type_id?: string;
2815
+ }
2816
+
2817
+ export namespace PrepaidBalanceThresholdConfigurationV2 {
2818
+ export interface Commit extends Shared.UpdateBaseThresholdCommit {
2819
+ /**
2820
+ * Which products the threshold commit applies to. If applicable_product_ids,
2821
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2822
+ * all products.
2823
+ */
2824
+ applicable_product_ids?: Array<string>;
2825
+
2826
+ /**
2827
+ * Which tags the threshold commit applies to. If applicable_product_ids,
2828
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2829
+ * all products.
2830
+ */
2831
+ applicable_product_tags?: Array<string>;
2832
+
2833
+ /**
2834
+ * List of filters that determine what kind of customer usage draws down a commit
2835
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2836
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2837
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2838
+ * Instead, to target usage by product or product tag, pass those values in the
2839
+ * body of `specifiers`.
2840
+ */
2841
+ specifiers?: Array<Shared.CommitSpecifierInput>;
1613
2842
  }
1614
2843
  }
1615
2844
 
@@ -1666,6 +2895,9 @@ export interface ProService {
1666
2895
  */
1667
2896
  unit_price: number;
1668
2897
 
2898
+ /**
2899
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2900
+ */
1669
2901
  custom_fields?: { [key: string]: string };
1670
2902
 
1671
2903
  description?: string;
@@ -1723,6 +2955,23 @@ export interface Rate {
1723
2955
  use_list_prices?: boolean;
1724
2956
  }
1725
2957
 
2958
+ export interface RecurringCommitSubscriptionConfig {
2959
+ allocation: 'INDIVIDUAL' | 'POOLED';
2960
+
2961
+ apply_seat_increase_config: RecurringCommitSubscriptionConfig.ApplySeatIncreaseConfig;
2962
+
2963
+ subscription_id: string;
2964
+ }
2965
+
2966
+ export namespace RecurringCommitSubscriptionConfig {
2967
+ export interface ApplySeatIncreaseConfig {
2968
+ /**
2969
+ * Indicates whether a mid-period seat increase should be prorated.
2970
+ */
2971
+ is_prorated: boolean;
2972
+ }
2973
+ }
2974
+
1726
2975
  export interface ScheduledCharge {
1727
2976
  id: string;
1728
2977
 
@@ -1732,6 +2981,9 @@ export interface ScheduledCharge {
1732
2981
 
1733
2982
  archived_at?: string;
1734
2983
 
2984
+ /**
2985
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2986
+ */
1735
2987
  custom_fields?: { [key: string]: string };
1736
2988
 
1737
2989
  /**
@@ -1799,8 +3051,171 @@ export namespace SchedulePointInTime {
1799
3051
  }
1800
3052
  }
1801
3053
 
3054
+ export interface SpendThresholdConfiguration {
3055
+ commit: BaseThresholdCommit;
3056
+
3057
+ /**
3058
+ * When set to false, the contract will not be evaluated against the
3059
+ * threshold_amount. Toggling to true will result an immediate evaluation,
3060
+ * regardless of prior state.
3061
+ */
3062
+ is_enabled: boolean;
3063
+
3064
+ payment_gate_config: PaymentGateConfig;
3065
+
3066
+ /**
3067
+ * Specify the threshold amount for the contract. Each time the contract's usage
3068
+ * hits this amount, a threshold charge will be initiated.
3069
+ */
3070
+ threshold_amount: number;
3071
+ }
3072
+
3073
+ export interface SpendThresholdConfigurationV2 {
3074
+ commit: UpdateBaseThresholdCommit;
3075
+
3076
+ /**
3077
+ * When set to false, the contract will not be evaluated against the
3078
+ * threshold_amount. Toggling to true will result an immediate evaluation,
3079
+ * regardless of prior state.
3080
+ */
3081
+ is_enabled: boolean;
3082
+
3083
+ payment_gate_config: PaymentGateConfigV2;
3084
+
3085
+ /**
3086
+ * Specify the threshold amount for the contract. Each time the contract's usage
3087
+ * hits this amount, a threshold charge will be initiated.
3088
+ */
3089
+ threshold_amount: number;
3090
+ }
3091
+
3092
+ export interface Subscription {
3093
+ /**
3094
+ * Previous, current, and next billing periods for the subscription.
3095
+ */
3096
+ billing_periods: Subscription.BillingPeriods;
3097
+
3098
+ collection_schedule: 'ADVANCE' | 'ARREARS';
3099
+
3100
+ proration: Subscription.Proration;
3101
+
3102
+ /**
3103
+ * Determines how the subscription's quantity is controlled. Defaults to
3104
+ * QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
3105
+ * directly on the subscription. `initial_quantity` must be provided with this
3106
+ * option. Compatible with recurring commits/credits that use POOLED allocation.
3107
+ */
3108
+ quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY';
3109
+
3110
+ /**
3111
+ * List of quantity schedule items for the subscription. Only includes the current
3112
+ * quantity and future quantity changes.
3113
+ */
3114
+ quantity_schedule: Array<Subscription.QuantitySchedule>;
3115
+
3116
+ starting_at: string;
3117
+
3118
+ subscription_rate: Subscription.SubscriptionRate;
3119
+
3120
+ id?: string;
3121
+
3122
+ /**
3123
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
3124
+ */
3125
+ custom_fields?: { [key: string]: string };
3126
+
3127
+ description?: string;
3128
+
3129
+ ending_before?: string;
3130
+
3131
+ fiat_credit_type_id?: string;
3132
+
3133
+ name?: string;
3134
+ }
3135
+
3136
+ export namespace Subscription {
3137
+ /**
3138
+ * Previous, current, and next billing periods for the subscription.
3139
+ */
3140
+ export interface BillingPeriods {
3141
+ current?: BillingPeriods.Current;
3142
+
3143
+ next?: BillingPeriods.Next;
3144
+
3145
+ previous?: BillingPeriods.Previous;
3146
+ }
3147
+
3148
+ export namespace BillingPeriods {
3149
+ export interface Current {
3150
+ ending_before: string;
3151
+
3152
+ starting_at: string;
3153
+ }
3154
+
3155
+ export interface Next {
3156
+ ending_before: string;
3157
+
3158
+ starting_at: string;
3159
+ }
3160
+
3161
+ export interface Previous {
3162
+ ending_before: string;
3163
+
3164
+ starting_at: string;
3165
+ }
3166
+ }
3167
+
3168
+ export interface Proration {
3169
+ invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
3170
+
3171
+ is_prorated: boolean;
3172
+ }
3173
+
3174
+ export interface QuantitySchedule {
3175
+ quantity: number;
3176
+
3177
+ starting_at: string;
3178
+
3179
+ ending_before?: string;
3180
+ }
3181
+
3182
+ export interface SubscriptionRate {
3183
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
3184
+
3185
+ product: SubscriptionRate.Product;
3186
+ }
3187
+
3188
+ export namespace SubscriptionRate {
3189
+ export interface Product {
3190
+ id: string;
3191
+
3192
+ name: string;
3193
+ }
3194
+ }
3195
+ }
3196
+
1802
3197
  export interface Tier {
1803
3198
  price: number;
1804
3199
 
1805
3200
  size?: number;
1806
3201
  }
3202
+
3203
+ export interface UpdateBaseThresholdCommit {
3204
+ description?: string;
3205
+
3206
+ /**
3207
+ * Specify the name of the line item for the threshold charge. If left blank, it
3208
+ * will default to the commit product name.
3209
+ */
3210
+ name?: string;
3211
+
3212
+ /**
3213
+ * The commit product that will be used to generate the line item for commit
3214
+ * payment.
3215
+ */
3216
+ product_id?: string;
3217
+ }
3218
+
3219
+ export type CommitsBodyCursorPage = BodyCursorPage<Commit>;
3220
+
3221
+ export type CreditsBodyCursorPage = BodyCursorPage<Credit>;