@metronome/sdk 0.2.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (808) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/README.md +123 -51
  3. package/api-promise.d.mts +2 -0
  4. package/api-promise.d.mts.map +1 -0
  5. package/api-promise.d.ts +2 -0
  6. package/api-promise.d.ts.map +1 -0
  7. package/api-promise.js +6 -0
  8. package/api-promise.js.map +1 -0
  9. package/api-promise.mjs +2 -0
  10. package/api-promise.mjs.map +1 -0
  11. package/bin/cli +53 -0
  12. package/bin/migration-config.json +6 -0
  13. package/client.d.mts +232 -0
  14. package/client.d.mts.map +1 -0
  15. package/client.d.ts +232 -0
  16. package/client.d.ts.map +1 -0
  17. package/client.js +464 -0
  18. package/client.js.map +1 -0
  19. package/client.mjs +460 -0
  20. package/client.mjs.map +1 -0
  21. package/core/api-promise.d.mts +46 -0
  22. package/core/api-promise.d.mts.map +1 -0
  23. package/core/api-promise.d.ts +46 -0
  24. package/core/api-promise.d.ts.map +1 -0
  25. package/core/api-promise.js +74 -0
  26. package/core/api-promise.js.map +1 -0
  27. package/core/api-promise.mjs +70 -0
  28. package/core/api-promise.mjs.map +1 -0
  29. package/core/error.d.mts +46 -0
  30. package/core/error.d.mts.map +1 -0
  31. package/core/error.d.ts +46 -0
  32. package/core/error.d.ts.map +1 -0
  33. package/core/error.js +113 -0
  34. package/core/error.js.map +1 -0
  35. package/core/error.mjs +97 -0
  36. package/core/error.mjs.map +1 -0
  37. package/core/pagination.d.mts +137 -0
  38. package/core/pagination.d.mts.map +1 -0
  39. package/core/pagination.d.ts +137 -0
  40. package/core/pagination.d.ts.map +1 -0
  41. package/core/pagination.js +158 -0
  42. package/core/pagination.js.map +1 -0
  43. package/core/pagination.mjs +150 -0
  44. package/core/pagination.mjs.map +1 -0
  45. package/core/resource.d.mts +6 -0
  46. package/core/resource.d.mts.map +1 -0
  47. package/core/resource.d.ts +6 -0
  48. package/core/resource.d.ts.map +1 -0
  49. package/core/resource.js +11 -0
  50. package/core/resource.js.map +1 -0
  51. package/core/resource.mjs +7 -0
  52. package/core/resource.mjs.map +1 -0
  53. package/core/uploads.d.mts +3 -0
  54. package/core/uploads.d.mts.map +1 -0
  55. package/core/uploads.d.ts +3 -0
  56. package/core/uploads.d.ts.map +1 -0
  57. package/core/uploads.js +6 -0
  58. package/core/uploads.js.map +1 -0
  59. package/core/uploads.mjs +2 -0
  60. package/core/uploads.mjs.map +1 -0
  61. package/error.d.mts +2 -0
  62. package/error.d.mts.map +1 -0
  63. package/error.d.ts +1 -46
  64. package/error.d.ts.map +1 -1
  65. package/error.js +3 -110
  66. package/error.js.map +1 -1
  67. package/error.mjs +1 -96
  68. package/error.mjs.map +1 -1
  69. package/index.d.mts +7 -144
  70. package/index.d.mts.map +1 -0
  71. package/index.d.ts +6 -143
  72. package/index.d.ts.map +1 -1
  73. package/index.js +14 -120
  74. package/index.js.map +1 -1
  75. package/index.mjs +6 -93
  76. package/index.mjs.map +1 -1
  77. package/internal/builtin-types.d.mts +73 -0
  78. package/internal/builtin-types.d.mts.map +1 -0
  79. package/internal/builtin-types.d.ts +73 -0
  80. package/internal/builtin-types.d.ts.map +1 -0
  81. package/internal/builtin-types.js +4 -0
  82. package/internal/builtin-types.js.map +1 -0
  83. package/internal/builtin-types.mjs +3 -0
  84. package/internal/builtin-types.mjs.map +1 -0
  85. package/internal/detect-platform.d.mts +15 -0
  86. package/internal/detect-platform.d.mts.map +1 -0
  87. package/internal/detect-platform.d.ts +15 -0
  88. package/internal/detect-platform.d.ts.map +1 -0
  89. package/internal/detect-platform.js +162 -0
  90. package/internal/detect-platform.js.map +1 -0
  91. package/internal/detect-platform.mjs +157 -0
  92. package/internal/detect-platform.mjs.map +1 -0
  93. package/internal/errors.d.mts +3 -0
  94. package/internal/errors.d.mts.map +1 -0
  95. package/internal/errors.d.ts +3 -0
  96. package/internal/errors.d.ts.map +1 -0
  97. package/internal/errors.js +41 -0
  98. package/internal/errors.js.map +1 -0
  99. package/internal/errors.mjs +36 -0
  100. package/internal/errors.mjs.map +1 -0
  101. package/internal/headers.d.mts +26 -0
  102. package/internal/headers.d.mts.map +1 -0
  103. package/internal/headers.d.ts +26 -0
  104. package/internal/headers.d.ts.map +1 -0
  105. package/internal/headers.js +120 -0
  106. package/internal/headers.js.map +1 -0
  107. package/internal/headers.mjs +112 -0
  108. package/internal/headers.mjs.map +1 -0
  109. package/internal/parse.d.mts +12 -0
  110. package/internal/parse.d.mts.map +1 -0
  111. package/internal/parse.d.ts +12 -0
  112. package/internal/parse.d.ts.map +1 -0
  113. package/internal/parse.js +35 -0
  114. package/internal/parse.js.map +1 -0
  115. package/internal/parse.mjs +32 -0
  116. package/internal/parse.mjs.map +1 -0
  117. package/internal/qs/formats.d.mts +7 -0
  118. package/internal/qs/formats.d.mts.map +1 -0
  119. package/internal/qs/formats.d.ts +1 -0
  120. package/internal/qs/formats.d.ts.map +1 -1
  121. package/internal/qs/formats.js +4 -2
  122. package/internal/qs/formats.js.map +1 -1
  123. package/internal/qs/formats.mjs +2 -1
  124. package/internal/qs/formats.mjs.map +1 -1
  125. package/internal/qs/index.d.mts +10 -0
  126. package/internal/qs/index.d.mts.map +1 -0
  127. package/internal/qs/index.d.ts.map +1 -1
  128. package/internal/qs/stringify.d.mts +3 -0
  129. package/internal/qs/stringify.d.mts.map +1 -0
  130. package/internal/qs/stringify.d.ts.map +1 -1
  131. package/internal/qs/stringify.js +16 -19
  132. package/internal/qs/stringify.js.map +1 -1
  133. package/internal/qs/stringify.mjs +17 -19
  134. package/internal/qs/stringify.mjs.map +1 -1
  135. package/internal/qs/types.d.mts +57 -0
  136. package/internal/qs/types.d.mts.map +1 -0
  137. package/internal/qs/utils.d.mts +15 -0
  138. package/internal/qs/utils.d.mts.map +1 -0
  139. package/internal/qs/utils.d.ts +1 -0
  140. package/internal/qs/utils.d.ts.map +1 -1
  141. package/internal/qs/utils.js +22 -21
  142. package/internal/qs/utils.js.map +1 -1
  143. package/internal/qs/utils.mjs +12 -12
  144. package/internal/qs/utils.mjs.map +1 -1
  145. package/internal/request-options.d.mts +75 -0
  146. package/internal/request-options.d.mts.map +1 -0
  147. package/internal/request-options.d.ts +75 -0
  148. package/internal/request-options.d.ts.map +1 -0
  149. package/internal/request-options.js +14 -0
  150. package/internal/request-options.js.map +1 -0
  151. package/internal/request-options.mjs +10 -0
  152. package/internal/request-options.mjs.map +1 -0
  153. package/internal/shim-types.d.mts +17 -0
  154. package/internal/shim-types.d.mts.map +1 -0
  155. package/internal/shim-types.d.ts +17 -0
  156. package/internal/shim-types.d.ts.map +1 -0
  157. package/internal/shim-types.js +4 -0
  158. package/internal/shim-types.js.map +1 -0
  159. package/internal/shim-types.mjs +3 -0
  160. package/internal/shim-types.mjs.map +1 -0
  161. package/internal/shims.d.mts +20 -0
  162. package/internal/shims.d.mts.map +1 -0
  163. package/internal/shims.d.ts +20 -0
  164. package/internal/shims.d.ts.map +1 -0
  165. package/internal/shims.js +92 -0
  166. package/internal/shims.js.map +1 -0
  167. package/internal/shims.mjs +85 -0
  168. package/internal/shims.mjs.map +1 -0
  169. package/internal/to-file.d.mts +45 -0
  170. package/internal/to-file.d.mts.map +1 -0
  171. package/internal/to-file.d.ts +45 -0
  172. package/internal/to-file.d.ts.map +1 -0
  173. package/internal/to-file.js +91 -0
  174. package/internal/to-file.js.map +1 -0
  175. package/internal/to-file.mjs +88 -0
  176. package/internal/to-file.mjs.map +1 -0
  177. package/internal/tslib.js +81 -0
  178. package/internal/tslib.mjs +17 -0
  179. package/internal/types.d.mts +69 -0
  180. package/internal/types.d.mts.map +1 -0
  181. package/internal/types.d.ts +69 -0
  182. package/internal/types.d.ts.map +1 -0
  183. package/internal/types.js +4 -0
  184. package/internal/types.js.map +1 -0
  185. package/internal/types.mjs +3 -0
  186. package/internal/types.mjs.map +1 -0
  187. package/internal/uploads.d.mts +42 -0
  188. package/internal/uploads.d.mts.map +1 -0
  189. package/internal/uploads.d.ts +42 -0
  190. package/internal/uploads.d.ts.map +1 -0
  191. package/internal/uploads.js +141 -0
  192. package/internal/uploads.js.map +1 -0
  193. package/internal/uploads.mjs +131 -0
  194. package/internal/uploads.mjs.map +1 -0
  195. package/internal/utils/base64.d.mts +3 -0
  196. package/internal/utils/base64.d.mts.map +1 -0
  197. package/internal/utils/base64.d.ts +3 -0
  198. package/internal/utils/base64.d.ts.map +1 -0
  199. package/internal/utils/base64.js +38 -0
  200. package/internal/utils/base64.js.map +1 -0
  201. package/internal/utils/base64.mjs +33 -0
  202. package/internal/utils/base64.mjs.map +1 -0
  203. package/internal/utils/bytes.d.mts +4 -0
  204. package/internal/utils/bytes.d.mts.map +1 -0
  205. package/internal/utils/bytes.d.ts +4 -0
  206. package/internal/utils/bytes.d.ts.map +1 -0
  207. package/internal/utils/bytes.js +31 -0
  208. package/internal/utils/bytes.js.map +1 -0
  209. package/internal/utils/bytes.mjs +26 -0
  210. package/internal/utils/bytes.mjs.map +1 -0
  211. package/internal/utils/env.d.mts +9 -0
  212. package/internal/utils/env.d.mts.map +1 -0
  213. package/internal/utils/env.d.ts +9 -0
  214. package/internal/utils/env.d.ts.map +1 -0
  215. package/internal/utils/env.js +22 -0
  216. package/internal/utils/env.js.map +1 -0
  217. package/internal/utils/env.mjs +18 -0
  218. package/internal/utils/env.mjs.map +1 -0
  219. package/internal/utils/log.d.mts +37 -0
  220. package/internal/utils/log.d.mts.map +1 -0
  221. package/internal/utils/log.d.ts +37 -0
  222. package/internal/utils/log.d.ts.map +1 -0
  223. package/internal/utils/log.js +85 -0
  224. package/internal/utils/log.js.map +1 -0
  225. package/internal/utils/log.mjs +79 -0
  226. package/internal/utils/log.mjs.map +1 -0
  227. package/internal/utils/path.d.mts +15 -0
  228. package/internal/utils/path.d.mts.map +1 -0
  229. package/internal/utils/path.d.ts +15 -0
  230. package/internal/utils/path.d.ts.map +1 -0
  231. package/internal/utils/path.js +79 -0
  232. package/internal/utils/path.js.map +1 -0
  233. package/internal/utils/path.mjs +74 -0
  234. package/internal/utils/path.mjs.map +1 -0
  235. package/internal/utils/sleep.d.mts +2 -0
  236. package/internal/utils/sleep.d.mts.map +1 -0
  237. package/internal/utils/sleep.d.ts +2 -0
  238. package/internal/utils/sleep.d.ts.map +1 -0
  239. package/internal/utils/sleep.js +7 -0
  240. package/internal/utils/sleep.js.map +1 -0
  241. package/internal/utils/sleep.mjs +3 -0
  242. package/internal/utils/sleep.mjs.map +1 -0
  243. package/internal/utils/uuid.d.mts +5 -0
  244. package/internal/utils/uuid.d.mts.map +1 -0
  245. package/internal/utils/uuid.d.ts +5 -0
  246. package/internal/utils/uuid.d.ts.map +1 -0
  247. package/internal/utils/uuid.js +19 -0
  248. package/internal/utils/uuid.js.map +1 -0
  249. package/internal/utils/uuid.mjs +15 -0
  250. package/internal/utils/uuid.mjs.map +1 -0
  251. package/internal/utils/values.d.mts +18 -0
  252. package/internal/utils/values.d.mts.map +1 -0
  253. package/internal/utils/values.d.ts +18 -0
  254. package/internal/utils/values.d.ts.map +1 -0
  255. package/internal/utils/values.js +112 -0
  256. package/internal/utils/values.js.map +1 -0
  257. package/internal/utils/values.mjs +94 -0
  258. package/internal/utils/values.mjs.map +1 -0
  259. package/internal/utils.d.mts +7 -0
  260. package/internal/utils.d.mts.map +1 -0
  261. package/internal/utils.d.ts +7 -0
  262. package/internal/utils.d.ts.map +1 -0
  263. package/internal/utils.js +11 -0
  264. package/internal/utils.js.map +1 -0
  265. package/internal/utils.mjs +8 -0
  266. package/internal/utils.mjs.map +1 -0
  267. package/package.json +116 -64
  268. package/pagination.d.mts +2 -0
  269. package/pagination.d.mts.map +1 -0
  270. package/pagination.d.ts +1 -36
  271. package/pagination.d.ts.map +1 -1
  272. package/pagination.js +3 -40
  273. package/pagination.js.map +1 -1
  274. package/pagination.mjs +1 -38
  275. package/pagination.mjs.map +1 -1
  276. package/resource.d.mts +2 -0
  277. package/resource.d.mts.map +1 -0
  278. package/resource.d.ts +1 -5
  279. package/resource.d.ts.map +1 -1
  280. package/resource.js +3 -8
  281. package/resource.js.map +1 -1
  282. package/resource.mjs +1 -6
  283. package/resource.mjs.map +1 -1
  284. package/resources/index.d.mts +5 -0
  285. package/resources/index.d.mts.map +1 -0
  286. package/resources/index.d.ts.map +1 -1
  287. package/resources/index.js +2 -15
  288. package/resources/index.js.map +1 -1
  289. package/resources/shared.d.mts +2239 -0
  290. package/resources/shared.d.mts.map +1 -0
  291. package/resources/shared.d.ts +1409 -523
  292. package/resources/shared.d.ts.map +1 -1
  293. package/resources/v1/alerts.d.mts +203 -0
  294. package/resources/v1/alerts.d.mts.map +1 -0
  295. package/resources/v1/alerts.d.ts +78 -7
  296. package/resources/v1/alerts.d.ts.map +1 -1
  297. package/resources/v1/alerts.js +73 -3
  298. package/resources/v1/alerts.js.map +1 -1
  299. package/resources/v1/alerts.mjs +73 -3
  300. package/resources/v1/alerts.mjs.map +1 -1
  301. package/resources/v1/audit-logs.d.mts +108 -0
  302. package/resources/v1/audit-logs.d.mts.map +1 -0
  303. package/resources/v1/audit-logs.d.ts +45 -12
  304. package/resources/v1/audit-logs.d.ts.map +1 -1
  305. package/resources/v1/audit-logs.js +53 -12
  306. package/resources/v1/audit-logs.js.map +1 -1
  307. package/resources/v1/audit-logs.mjs +52 -10
  308. package/resources/v1/audit-logs.mjs.map +1 -1
  309. package/resources/v1/billable-metrics.d.mts +293 -0
  310. package/resources/v1/billable-metrics.d.mts.map +1 -0
  311. package/resources/v1/billable-metrics.d.ts +70 -15
  312. package/resources/v1/billable-metrics.d.ts.map +1 -1
  313. package/resources/v1/billable-metrics.js +70 -16
  314. package/resources/v1/billable-metrics.js.map +1 -1
  315. package/resources/v1/billable-metrics.mjs +69 -14
  316. package/resources/v1/billable-metrics.mjs.map +1 -1
  317. package/resources/v1/contracts/contracts.d.mts +2984 -0
  318. package/resources/v1/contracts/contracts.d.mts.map +1 -0
  319. package/resources/v1/contracts/contracts.d.ts +450 -1285
  320. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  321. package/resources/v1/contracts/contracts.js +268 -50
  322. package/resources/v1/contracts/contracts.js.map +1 -1
  323. package/resources/v1/contracts/contracts.mjs +266 -26
  324. package/resources/v1/contracts/contracts.mjs.map +1 -1
  325. package/resources/v1/contracts/index.d.mts +5 -0
  326. package/resources/v1/contracts/index.d.mts.map +1 -0
  327. package/resources/v1/contracts/index.d.ts +3 -3
  328. package/resources/v1/contracts/index.d.ts.map +1 -1
  329. package/resources/v1/contracts/index.js +1 -3
  330. package/resources/v1/contracts/index.js.map +1 -1
  331. package/resources/v1/contracts/index.mjs +2 -2
  332. package/resources/v1/contracts/index.mjs.map +1 -1
  333. package/resources/v1/contracts/named-schedules.d.mts +82 -0
  334. package/resources/v1/contracts/named-schedules.d.mts.map +1 -0
  335. package/resources/v1/contracts/named-schedules.d.ts +5 -4
  336. package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
  337. package/resources/v1/contracts/named-schedules.js +3 -2
  338. package/resources/v1/contracts/named-schedules.js.map +1 -1
  339. package/resources/v1/contracts/named-schedules.mjs +3 -2
  340. package/resources/v1/contracts/named-schedules.mjs.map +1 -1
  341. package/resources/v1/contracts/products.d.mts +502 -0
  342. package/resources/v1/contracts/products.d.mts.map +1 -0
  343. package/resources/v1/contracts/products.d.ts +47 -17
  344. package/resources/v1/contracts/products.d.ts.map +1 -1
  345. package/resources/v1/contracts/products.js +41 -17
  346. package/resources/v1/contracts/products.js.map +1 -1
  347. package/resources/v1/contracts/products.mjs +40 -15
  348. package/resources/v1/contracts/products.mjs.map +1 -1
  349. package/resources/v1/contracts/rate-cards/index.d.mts +5 -0
  350. package/resources/v1/contracts/rate-cards/index.d.mts.map +1 -0
  351. package/resources/v1/contracts/rate-cards/index.d.ts +2 -2
  352. package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
  353. package/resources/v1/contracts/rate-cards/index.js +1 -3
  354. package/resources/v1/contracts/rate-cards/index.js.map +1 -1
  355. package/resources/v1/contracts/rate-cards/index.mjs +2 -2
  356. package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
  357. package/resources/v1/contracts/rate-cards/named-schedules.d.mts +94 -0
  358. package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -0
  359. package/resources/v1/contracts/rate-cards/named-schedules.d.ts +5 -4
  360. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
  361. package/resources/v1/contracts/rate-cards/named-schedules.js +3 -2
  362. package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
  363. package/resources/v1/contracts/rate-cards/named-schedules.mjs +3 -2
  364. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
  365. package/resources/v1/contracts/rate-cards/product-orders.d.mts +85 -0
  366. package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -0
  367. package/resources/v1/contracts/rate-cards/product-orders.d.ts +12 -6
  368. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
  369. package/resources/v1/contracts/rate-cards/product-orders.js +8 -3
  370. package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
  371. package/resources/v1/contracts/rate-cards/product-orders.mjs +8 -3
  372. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
  373. package/resources/v1/contracts/rate-cards/rate-cards.d.mts +452 -0
  374. package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -0
  375. package/resources/v1/contracts/rate-cards/rate-cards.d.ts +134 -41
  376. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
  377. package/resources/v1/contracts/rate-cards/rate-cards.js +127 -47
  378. package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
  379. package/resources/v1/contracts/rate-cards/rate-cards.mjs +123 -20
  380. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
  381. package/resources/v1/contracts/rate-cards/rates.d.mts +382 -0
  382. package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -0
  383. package/resources/v1/contracts/rate-cards/rates.d.ts +25 -82
  384. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  385. package/resources/v1/contracts/rate-cards/rates.js +13 -9
  386. package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
  387. package/resources/v1/contracts/rate-cards/rates.mjs +12 -7
  388. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  389. package/resources/v1/contracts/rate-cards.d.mts +2 -0
  390. package/resources/v1/contracts/rate-cards.d.mts.map +1 -0
  391. package/resources/v1/contracts/rate-cards.d.ts.map +1 -1
  392. package/resources/v1/contracts/rate-cards.js +2 -15
  393. package/resources/v1/contracts/rate-cards.js.map +1 -1
  394. package/resources/v1/contracts.d.mts +2 -0
  395. package/resources/v1/contracts.d.mts.map +1 -0
  396. package/resources/v1/contracts.d.ts.map +1 -1
  397. package/resources/v1/contracts.js +2 -15
  398. package/resources/v1/contracts.js.map +1 -1
  399. package/resources/v1/credit-grants.d.mts +505 -0
  400. package/resources/v1/credit-grants.d.mts.map +1 -0
  401. package/resources/v1/credit-grants.d.ts +73 -74
  402. package/resources/v1/credit-grants.d.ts.map +1 -1
  403. package/resources/v1/credit-grants.js +52 -18
  404. package/resources/v1/credit-grants.js.map +1 -1
  405. package/resources/v1/credit-grants.mjs +51 -16
  406. package/resources/v1/credit-grants.mjs.map +1 -1
  407. package/resources/v1/custom-fields.d.mts +151 -0
  408. package/resources/v1/custom-fields.d.mts.map +1 -0
  409. package/resources/v1/custom-fields.d.ts +69 -38
  410. package/resources/v1/custom-fields.d.ts.map +1 -1
  411. package/resources/v1/custom-fields.js +66 -22
  412. package/resources/v1/custom-fields.js.map +1 -1
  413. package/resources/v1/custom-fields.mjs +66 -22
  414. package/resources/v1/custom-fields.mjs.map +1 -1
  415. package/resources/v1/customers/alerts.d.mts +288 -0
  416. package/resources/v1/customers/alerts.d.mts.map +1 -0
  417. package/resources/v1/customers/alerts.d.ts +128 -23
  418. package/resources/v1/customers/alerts.d.ts.map +1 -1
  419. package/resources/v1/customers/alerts.js +112 -10
  420. package/resources/v1/customers/alerts.js.map +1 -1
  421. package/resources/v1/customers/alerts.mjs +112 -10
  422. package/resources/v1/customers/alerts.mjs.map +1 -1
  423. package/resources/v1/customers/billing-config.d.mts +125 -0
  424. package/resources/v1/customers/billing-config.d.mts.map +1 -0
  425. package/resources/v1/customers/billing-config.d.ts +8 -7
  426. package/resources/v1/customers/billing-config.d.ts.map +1 -1
  427. package/resources/v1/customers/billing-config.js +8 -6
  428. package/resources/v1/customers/billing-config.js.map +1 -1
  429. package/resources/v1/customers/billing-config.mjs +8 -6
  430. package/resources/v1/customers/billing-config.mjs.map +1 -1
  431. package/resources/v1/customers/commits.d.mts +456 -0
  432. package/resources/v1/customers/commits.d.mts.map +1 -0
  433. package/resources/v1/customers/commits.d.ts +145 -47
  434. package/resources/v1/customers/commits.d.ts.map +1 -1
  435. package/resources/v1/customers/commits.js +132 -12
  436. package/resources/v1/customers/commits.js.map +1 -1
  437. package/resources/v1/customers/commits.mjs +132 -12
  438. package/resources/v1/customers/commits.mjs.map +1 -1
  439. package/resources/v1/customers/credits.d.mts +310 -0
  440. package/resources/v1/customers/credits.d.mts.map +1 -0
  441. package/resources/v1/customers/credits.d.ts +124 -46
  442. package/resources/v1/customers/credits.d.ts.map +1 -1
  443. package/resources/v1/customers/credits.js +116 -11
  444. package/resources/v1/customers/credits.js.map +1 -1
  445. package/resources/v1/customers/credits.mjs +116 -11
  446. package/resources/v1/customers/credits.mjs.map +1 -1
  447. package/resources/v1/customers/customers.d.mts +818 -0
  448. package/resources/v1/customers/customers.d.mts.map +1 -0
  449. package/resources/v1/customers/customers.d.ts +304 -41
  450. package/resources/v1/customers/customers.d.ts.map +1 -1
  451. package/resources/v1/customers/customers.js +214 -73
  452. package/resources/v1/customers/customers.js.map +1 -1
  453. package/resources/v1/customers/customers.mjs +207 -41
  454. package/resources/v1/customers/customers.mjs.map +1 -1
  455. package/resources/v1/customers/index.d.mts +9 -0
  456. package/resources/v1/customers/index.d.mts.map +1 -0
  457. package/resources/v1/customers/index.d.ts +6 -6
  458. package/resources/v1/customers/index.d.ts.map +1 -1
  459. package/resources/v1/customers/index.js +1 -8
  460. package/resources/v1/customers/index.js.map +1 -1
  461. package/resources/v1/customers/index.mjs +3 -3
  462. package/resources/v1/customers/index.mjs.map +1 -1
  463. package/resources/v1/customers/invoices.d.mts +710 -0
  464. package/resources/v1/customers/invoices.d.mts.map +1 -0
  465. package/resources/v1/customers/invoices.d.ts +196 -19
  466. package/resources/v1/customers/invoices.d.ts.map +1 -1
  467. package/resources/v1/customers/invoices.js +131 -22
  468. package/resources/v1/customers/invoices.js.map +1 -1
  469. package/resources/v1/customers/invoices.mjs +130 -19
  470. package/resources/v1/customers/invoices.mjs.map +1 -1
  471. package/resources/v1/customers/named-schedules.d.mts +82 -0
  472. package/resources/v1/customers/named-schedules.d.mts.map +1 -0
  473. package/resources/v1/customers/named-schedules.d.ts +5 -4
  474. package/resources/v1/customers/named-schedules.d.ts.map +1 -1
  475. package/resources/v1/customers/named-schedules.js +3 -2
  476. package/resources/v1/customers/named-schedules.js.map +1 -1
  477. package/resources/v1/customers/named-schedules.mjs +3 -2
  478. package/resources/v1/customers/named-schedules.mjs.map +1 -1
  479. package/resources/v1/customers/plans.d.mts +281 -0
  480. package/resources/v1/customers/plans.d.mts.map +1 -0
  481. package/resources/v1/customers/plans.d.ts +14 -12
  482. package/resources/v1/customers/plans.d.ts.map +1 -1
  483. package/resources/v1/customers/plans.js +8 -15
  484. package/resources/v1/customers/plans.js.map +1 -1
  485. package/resources/v1/customers/plans.mjs +7 -12
  486. package/resources/v1/customers/plans.mjs.map +1 -1
  487. package/resources/v1/customers.d.mts +2 -0
  488. package/resources/v1/customers.d.mts.map +1 -0
  489. package/resources/v1/customers.d.ts.map +1 -1
  490. package/resources/v1/customers.js +2 -15
  491. package/resources/v1/customers.js.map +1 -1
  492. package/resources/v1/dashboards.d.mts +133 -0
  493. package/resources/v1/dashboards.d.mts.map +1 -0
  494. package/resources/v1/dashboards.d.ts +33 -6
  495. package/resources/v1/dashboards.d.ts.map +1 -1
  496. package/resources/v1/dashboards.js +30 -4
  497. package/resources/v1/dashboards.js.map +1 -1
  498. package/resources/v1/dashboards.mjs +30 -4
  499. package/resources/v1/dashboards.mjs.map +1 -1
  500. package/resources/v1/index.d.mts +15 -0
  501. package/resources/v1/index.d.mts.map +1 -0
  502. package/resources/v1/index.d.ts +9 -9
  503. package/resources/v1/index.d.ts.map +1 -1
  504. package/resources/v1/index.js +1 -12
  505. package/resources/v1/index.js.map +1 -1
  506. package/resources/v1/index.mjs +7 -7
  507. package/resources/v1/index.mjs.map +1 -1
  508. package/resources/v1/invoices.d.mts +83 -0
  509. package/resources/v1/invoices.d.mts.map +1 -0
  510. package/resources/v1/invoices.d.ts +28 -6
  511. package/resources/v1/invoices.d.ts.map +1 -1
  512. package/resources/v1/invoices.js +24 -3
  513. package/resources/v1/invoices.js.map +1 -1
  514. package/resources/v1/invoices.mjs +24 -3
  515. package/resources/v1/invoices.mjs.map +1 -1
  516. package/resources/v1/plans.d.mts +240 -0
  517. package/resources/v1/plans.d.mts.map +1 -0
  518. package/resources/v1/plans.d.ts +24 -15
  519. package/resources/v1/plans.d.ts.map +1 -1
  520. package/resources/v1/plans.js +19 -26
  521. package/resources/v1/plans.js.map +1 -1
  522. package/resources/v1/plans.mjs +18 -22
  523. package/resources/v1/plans.mjs.map +1 -1
  524. package/resources/v1/pricing-units.d.mts +34 -0
  525. package/resources/v1/pricing-units.d.mts.map +1 -0
  526. package/resources/v1/pricing-units.d.ts +12 -9
  527. package/resources/v1/pricing-units.d.ts.map +1 -1
  528. package/resources/v1/pricing-units.js +20 -12
  529. package/resources/v1/pricing-units.js.map +1 -1
  530. package/resources/v1/pricing-units.mjs +19 -10
  531. package/resources/v1/pricing-units.mjs.map +1 -1
  532. package/resources/v1/services.d.mts +33 -0
  533. package/resources/v1/services.d.mts.map +1 -0
  534. package/resources/v1/services.d.ts +10 -7
  535. package/resources/v1/services.d.ts.map +1 -1
  536. package/resources/v1/services.js +7 -5
  537. package/resources/v1/services.js.map +1 -1
  538. package/resources/v1/services.mjs +7 -5
  539. package/resources/v1/services.mjs.map +1 -1
  540. package/resources/v1/usage.d.mts +488 -0
  541. package/resources/v1/usage.d.mts.map +1 -0
  542. package/resources/v1/usage.d.ts +220 -57
  543. package/resources/v1/usage.d.ts.map +1 -1
  544. package/resources/v1/usage.js +212 -26
  545. package/resources/v1/usage.js.map +1 -1
  546. package/resources/v1/usage.mjs +211 -24
  547. package/resources/v1/usage.mjs.map +1 -1
  548. package/resources/v1/v1.d.mts +58 -0
  549. package/resources/v1/v1.d.mts.map +1 -0
  550. package/resources/v1/v1.d.ts +15 -15
  551. package/resources/v1/v1.d.ts.map +1 -1
  552. package/resources/v1/v1.js +15 -48
  553. package/resources/v1/v1.js.map +1 -1
  554. package/resources/v1/v1.mjs +8 -19
  555. package/resources/v1/v1.mjs.map +1 -1
  556. package/resources/v1.d.mts +2 -0
  557. package/resources/v1.d.mts.map +1 -0
  558. package/resources/v1.d.ts.map +1 -1
  559. package/resources/v1.js +2 -15
  560. package/resources/v1.js.map +1 -1
  561. package/resources/v2/contracts.d.mts +2794 -0
  562. package/resources/v2/contracts.d.mts.map +1 -0
  563. package/resources/v2/contracts.d.ts +381 -3862
  564. package/resources/v2/contracts.d.ts.map +1 -1
  565. package/resources/v2/contracts.js +102 -12
  566. package/resources/v2/contracts.js.map +1 -1
  567. package/resources/v2/contracts.mjs +102 -12
  568. package/resources/v2/contracts.mjs.map +1 -1
  569. package/resources/v2/index.d.mts +3 -0
  570. package/resources/v2/index.d.mts.map +1 -0
  571. package/resources/v2/index.d.ts.map +1 -1
  572. package/resources/v2/v2.d.mts +10 -0
  573. package/resources/v2/v2.d.mts.map +1 -0
  574. package/resources/v2/v2.d.ts +1 -1
  575. package/resources/v2/v2.d.ts.map +1 -1
  576. package/resources/v2/v2.js +3 -25
  577. package/resources/v2/v2.js.map +1 -1
  578. package/resources/v2/v2.mjs +1 -1
  579. package/resources/v2.d.mts +2 -0
  580. package/resources/v2.d.mts.map +1 -0
  581. package/resources/v2.d.ts.map +1 -1
  582. package/resources/v2.js +2 -15
  583. package/resources/v2.js.map +1 -1
  584. package/resources/webhooks.d.mts +22 -0
  585. package/resources/webhooks.d.mts.map +1 -0
  586. package/resources/webhooks.d.ts +1 -1
  587. package/resources/webhooks.d.ts.map +1 -1
  588. package/resources/webhooks.js +3 -3
  589. package/resources/webhooks.js.map +1 -1
  590. package/resources/webhooks.mjs +1 -1
  591. package/resources/webhooks.mjs.map +1 -1
  592. package/resources.d.mts +2 -0
  593. package/resources.d.mts.map +1 -0
  594. package/resources.d.ts.map +1 -1
  595. package/resources.js +2 -15
  596. package/resources.js.map +1 -1
  597. package/src/api-promise.ts +2 -0
  598. package/src/client.ts +809 -0
  599. package/src/core/README.md +3 -0
  600. package/src/core/api-promise.ts +92 -0
  601. package/src/core/error.ts +130 -0
  602. package/src/core/pagination.ts +319 -0
  603. package/src/core/resource.ts +11 -0
  604. package/src/core/uploads.ts +2 -0
  605. package/src/error.ts +2 -130
  606. package/src/index.ts +6 -220
  607. package/src/internal/README.md +3 -0
  608. package/src/internal/builtin-types.ts +93 -0
  609. package/src/internal/detect-platform.ts +196 -0
  610. package/src/internal/errors.ts +33 -0
  611. package/src/internal/headers.ts +144 -0
  612. package/src/internal/parse.ts +50 -0
  613. package/src/internal/qs/formats.ts +3 -2
  614. package/src/internal/qs/index.ts +3 -3
  615. package/src/internal/qs/stringify.ts +18 -21
  616. package/src/internal/qs/utils.ts +16 -16
  617. package/src/internal/request-options.ts +91 -0
  618. package/src/internal/shim-types.ts +26 -0
  619. package/src/internal/shims.ts +107 -0
  620. package/src/internal/to-file.ts +154 -0
  621. package/src/internal/types.ts +95 -0
  622. package/src/internal/uploads.ts +187 -0
  623. package/src/internal/utils/base64.ts +40 -0
  624. package/src/internal/utils/bytes.ts +32 -0
  625. package/src/internal/utils/env.ts +18 -0
  626. package/src/internal/utils/log.ts +126 -0
  627. package/src/internal/utils/path.ts +88 -0
  628. package/src/internal/utils/sleep.ts +3 -0
  629. package/src/internal/utils/uuid.ts +17 -0
  630. package/src/internal/utils/values.ts +105 -0
  631. package/src/internal/utils.ts +8 -0
  632. package/src/pagination.ts +2 -82
  633. package/src/resource.ts +2 -11
  634. package/src/resources/index.ts +4 -4
  635. package/src/resources/shared.ts +1786 -520
  636. package/src/resources/v1/alerts.ts +79 -8
  637. package/src/resources/v1/audit-logs.ts +48 -26
  638. package/src/resources/v1/billable-metrics.ts +79 -34
  639. package/src/resources/v1/contracts/contracts.ts +518 -1622
  640. package/src/resources/v1/contracts/index.ts +7 -6
  641. package/src/resources/v1/contracts/named-schedules.ts +8 -6
  642. package/src/resources/v1/contracts/products.ts +52 -38
  643. package/src/resources/v1/contracts/rate-cards/index.ts +6 -6
  644. package/src/resources/v1/contracts/rate-cards/named-schedules.ts +8 -6
  645. package/src/resources/v1/contracts/rate-cards/product-orders.ts +13 -10
  646. package/src/resources/v1/contracts/rate-cards/rate-cards.ts +145 -72
  647. package/src/resources/v1/contracts/rate-cards/rates.ts +28 -98
  648. package/src/resources/v1/contracts/rate-cards.ts +1 -1
  649. package/src/resources/v1/contracts.ts +1 -1
  650. package/src/resources/v1/credit-grants.ts +100 -112
  651. package/src/resources/v1/custom-fields.ts +106 -74
  652. package/src/resources/v1/customers/alerts.ts +147 -28
  653. package/src/resources/v1/customers/billing-config.ts +27 -13
  654. package/src/resources/v1/customers/commits.ts +153 -54
  655. package/src/resources/v1/customers/credits.ts +131 -53
  656. package/src/resources/v1/customers/customers.ts +390 -101
  657. package/src/resources/v1/customers/index.ts +19 -18
  658. package/src/resources/v1/customers/invoices.ts +206 -37
  659. package/src/resources/v1/customers/named-schedules.ts +8 -6
  660. package/src/resources/v1/customers/plans.ts +24 -22
  661. package/src/resources/v1/customers.ts +1 -1
  662. package/src/resources/v1/dashboards.ts +34 -7
  663. package/src/resources/v1/index.ts +32 -25
  664. package/src/resources/v1/invoices.ts +28 -9
  665. package/src/resources/v1/plans.ts +42 -43
  666. package/src/resources/v1/pricing-units.ts +15 -23
  667. package/src/resources/v1/services.ts +10 -7
  668. package/src/resources/v1/usage.ts +244 -72
  669. package/src/resources/v1/v1.ts +52 -49
  670. package/src/resources/v1.ts +1 -1
  671. package/src/resources/v2/contracts.ts +431 -4967
  672. package/src/resources/v2/index.ts +2 -2
  673. package/src/resources/v2/v2.ts +3 -3
  674. package/src/resources/v2.ts +1 -1
  675. package/src/resources/webhooks.ts +2 -2
  676. package/src/resources.ts +1 -1
  677. package/src/tsconfig.json +2 -2
  678. package/src/uploads.ts +2 -255
  679. package/src/version.ts +1 -1
  680. package/uploads.d.mts +2 -0
  681. package/uploads.d.mts.map +1 -0
  682. package/uploads.d.ts +1 -74
  683. package/uploads.d.ts.map +1 -1
  684. package/uploads.js +3 -168
  685. package/uploads.js.map +1 -1
  686. package/uploads.mjs +1 -157
  687. package/uploads.mjs.map +1 -1
  688. package/version.d.mts +2 -0
  689. package/version.d.mts.map +1 -0
  690. package/version.d.ts +1 -1
  691. package/version.js +1 -1
  692. package/version.mjs +1 -1
  693. package/_shims/MultipartBody.d.ts +0 -9
  694. package/_shims/MultipartBody.d.ts.map +0 -1
  695. package/_shims/MultipartBody.js +0 -16
  696. package/_shims/MultipartBody.js.map +0 -1
  697. package/_shims/MultipartBody.mjs +0 -12
  698. package/_shims/MultipartBody.mjs.map +0 -1
  699. package/_shims/README.md +0 -46
  700. package/_shims/auto/runtime-bun.d.ts +0 -5
  701. package/_shims/auto/runtime-bun.d.ts.map +0 -1
  702. package/_shims/auto/runtime-bun.js +0 -21
  703. package/_shims/auto/runtime-bun.js.map +0 -1
  704. package/_shims/auto/runtime-bun.mjs +0 -2
  705. package/_shims/auto/runtime-bun.mjs.map +0 -1
  706. package/_shims/auto/runtime-node.d.ts +0 -5
  707. package/_shims/auto/runtime-node.d.ts.map +0 -1
  708. package/_shims/auto/runtime-node.js +0 -21
  709. package/_shims/auto/runtime-node.js.map +0 -1
  710. package/_shims/auto/runtime-node.mjs +0 -2
  711. package/_shims/auto/runtime-node.mjs.map +0 -1
  712. package/_shims/auto/runtime.d.ts +0 -5
  713. package/_shims/auto/runtime.d.ts.map +0 -1
  714. package/_shims/auto/runtime.js +0 -21
  715. package/_shims/auto/runtime.js.map +0 -1
  716. package/_shims/auto/runtime.mjs +0 -2
  717. package/_shims/auto/runtime.mjs.map +0 -1
  718. package/_shims/auto/types-node.d.ts +0 -5
  719. package/_shims/auto/types-node.d.ts.map +0 -1
  720. package/_shims/auto/types-node.js +0 -21
  721. package/_shims/auto/types-node.js.map +0 -1
  722. package/_shims/auto/types-node.mjs +0 -2
  723. package/_shims/auto/types-node.mjs.map +0 -1
  724. package/_shims/auto/types.d.ts +0 -101
  725. package/_shims/auto/types.js +0 -3
  726. package/_shims/auto/types.mjs +0 -3
  727. package/_shims/bun-runtime.d.ts +0 -6
  728. package/_shims/bun-runtime.d.ts.map +0 -1
  729. package/_shims/bun-runtime.js +0 -14
  730. package/_shims/bun-runtime.js.map +0 -1
  731. package/_shims/bun-runtime.mjs +0 -10
  732. package/_shims/bun-runtime.mjs.map +0 -1
  733. package/_shims/index.d.ts +0 -83
  734. package/_shims/index.js +0 -17
  735. package/_shims/index.mjs +0 -11
  736. package/_shims/manual-types.d.ts +0 -12
  737. package/_shims/manual-types.js +0 -3
  738. package/_shims/manual-types.mjs +0 -3
  739. package/_shims/node-runtime.d.ts +0 -3
  740. package/_shims/node-runtime.d.ts.map +0 -1
  741. package/_shims/node-runtime.js +0 -89
  742. package/_shims/node-runtime.js.map +0 -1
  743. package/_shims/node-runtime.mjs +0 -56
  744. package/_shims/node-runtime.mjs.map +0 -1
  745. package/_shims/node-types.d.ts +0 -42
  746. package/_shims/node-types.js +0 -3
  747. package/_shims/node-types.mjs +0 -3
  748. package/_shims/registry.d.ts +0 -37
  749. package/_shims/registry.d.ts.map +0 -1
  750. package/_shims/registry.js +0 -41
  751. package/_shims/registry.js.map +0 -1
  752. package/_shims/registry.mjs +0 -37
  753. package/_shims/registry.mjs.map +0 -1
  754. package/_shims/web-runtime.d.ts +0 -5
  755. package/_shims/web-runtime.d.ts.map +0 -1
  756. package/_shims/web-runtime.js +0 -78
  757. package/_shims/web-runtime.js.map +0 -1
  758. package/_shims/web-runtime.mjs +0 -71
  759. package/_shims/web-runtime.mjs.map +0 -1
  760. package/_shims/web-types.d.ts +0 -83
  761. package/_shims/web-types.js +0 -3
  762. package/_shims/web-types.mjs +0 -3
  763. package/core.d.ts +0 -255
  764. package/core.d.ts.map +0 -1
  765. package/core.js +0 -924
  766. package/core.js.map +0 -1
  767. package/core.mjs +0 -892
  768. package/core.mjs.map +0 -1
  769. package/shims/node.d.ts +0 -30
  770. package/shims/node.d.ts.map +0 -1
  771. package/shims/node.js +0 -31
  772. package/shims/node.js.map +0 -1
  773. package/shims/node.mjs +0 -5
  774. package/shims/node.mjs.map +0 -1
  775. package/shims/web.d.ts +0 -26
  776. package/shims/web.d.ts.map +0 -1
  777. package/shims/web.js +0 -31
  778. package/shims/web.js.map +0 -1
  779. package/shims/web.mjs +0 -5
  780. package/shims/web.mjs.map +0 -1
  781. package/src/_shims/MultipartBody.ts +0 -9
  782. package/src/_shims/README.md +0 -46
  783. package/src/_shims/auto/runtime-bun.ts +0 -4
  784. package/src/_shims/auto/runtime-node.ts +0 -4
  785. package/src/_shims/auto/runtime.ts +0 -4
  786. package/src/_shims/auto/types-node.ts +0 -4
  787. package/src/_shims/auto/types.d.ts +0 -101
  788. package/src/_shims/auto/types.js +0 -3
  789. package/src/_shims/auto/types.mjs +0 -3
  790. package/src/_shims/bun-runtime.ts +0 -14
  791. package/src/_shims/index.d.ts +0 -83
  792. package/src/_shims/index.js +0 -17
  793. package/src/_shims/index.mjs +0 -11
  794. package/src/_shims/manual-types.d.ts +0 -12
  795. package/src/_shims/manual-types.js +0 -3
  796. package/src/_shims/manual-types.mjs +0 -3
  797. package/src/_shims/node-runtime.ts +0 -81
  798. package/src/_shims/node-types.d.ts +0 -42
  799. package/src/_shims/node-types.js +0 -3
  800. package/src/_shims/node-types.mjs +0 -3
  801. package/src/_shims/registry.ts +0 -67
  802. package/src/_shims/web-runtime.ts +0 -103
  803. package/src/_shims/web-types.d.ts +0 -83
  804. package/src/_shims/web-types.js +0 -3
  805. package/src/_shims/web-types.mjs +0 -3
  806. package/src/core.ts +0 -1236
  807. package/src/shims/node.ts +0 -50
  808. package/src/shims/web.ts +0 -50
@@ -0,0 +1,2239 @@
1
+ import * as Shared from "./shared.mjs";
2
+ import { BodyCursorPage } from "../core/pagination.mjs";
3
+ export interface BaseThresholdCommit {
4
+ /**
5
+ * The commit product that will be used to generate the line item for commit
6
+ * payment.
7
+ */
8
+ product_id: string;
9
+ description?: string;
10
+ /**
11
+ * Specify the name of the line item for the threshold charge. If left blank, it
12
+ * will default to the commit product name.
13
+ */
14
+ name?: string;
15
+ }
16
+ export interface BaseUsageFilter {
17
+ group_key: string;
18
+ group_values: Array<string>;
19
+ starting_at?: string;
20
+ }
21
+ export interface Commit {
22
+ id: string;
23
+ /**
24
+ * Timestamp of when the commit was created.
25
+ *
26
+ * - Recurring commits: latter of commit service period date and parent commit
27
+ * start date
28
+ * - Rollover commits: when the new contract started
29
+ */
30
+ created_at: string;
31
+ product: Commit.Product;
32
+ type: 'PREPAID' | 'POSTPAID';
33
+ /**
34
+ * The schedule that the customer will gain access to the credits purposed with
35
+ * this commit.
36
+ */
37
+ access_schedule?: ScheduleDuration;
38
+ /**
39
+ * (DEPRECATED) Use access_schedule + invoice_schedule instead.
40
+ */
41
+ amount?: number;
42
+ applicable_contract_ids?: Array<string>;
43
+ applicable_product_ids?: Array<string>;
44
+ applicable_product_tags?: Array<string>;
45
+ /**
46
+ * RFC 3339 timestamp indicating when the commit was archived. If not provided, the
47
+ * commit is not archived.
48
+ */
49
+ archived_at?: string;
50
+ /**
51
+ * The current balance of the credit or commit. This balance reflects the amount of
52
+ * credit or commit that the customer has access to use at this moment - thus,
53
+ * expired and upcoming credit or commit segments contribute 0 to the balance. The
54
+ * balance will match the sum of all ledger entries with the exception of the case
55
+ * where the sum of negative manual ledger entries exceeds the positive amount
56
+ * remaining on the credit or commit - in that case, the balance will be 0. All
57
+ * manual ledger entries associated with active credit or commit segments are
58
+ * included in the balance, including future-dated manual ledger entries.
59
+ */
60
+ balance?: number;
61
+ contract?: Commit.Contract;
62
+ /**
63
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
64
+ */
65
+ custom_fields?: {
66
+ [key: string]: string;
67
+ };
68
+ description?: string;
69
+ /**
70
+ * Optional configuration for commit hierarchy access control
71
+ */
72
+ hierarchy_configuration?: CommitHierarchyConfiguration;
73
+ /**
74
+ * The contract that this commit will be billed on.
75
+ */
76
+ invoice_contract?: Commit.InvoiceContract;
77
+ /**
78
+ * The schedule that the customer will be invoiced for this commit.
79
+ */
80
+ invoice_schedule?: SchedulePointInTime;
81
+ /**
82
+ * A list of ordered events that impact the balance of a commit. For example, an
83
+ * invoice deduction or a rollover.
84
+ */
85
+ ledger?: Array<Commit.PrepaidCommitSegmentStartLedgerEntry | Commit.PrepaidCommitAutomatedInvoiceDeductionLedgerEntry | Commit.PrepaidCommitRolloverLedgerEntry | Commit.PrepaidCommitExpirationLedgerEntry | Commit.PrepaidCommitCanceledLedgerEntry | Commit.PrepaidCommitCreditedLedgerEntry | Commit.PrepaidCommitSeatBasedAdjustmentLedgerEntry | Commit.PostpaidCommitInitialBalanceLedgerEntry | Commit.PostpaidCommitAutomatedInvoiceDeductionLedgerEntry | Commit.PostpaidCommitRolloverLedgerEntry | Commit.PostpaidCommitTrueupLedgerEntry | Commit.PrepaidCommitManualLedgerEntry | Commit.PostpaidCommitManualLedgerEntry | Commit.PostpaidCommitExpirationLedgerEntry>;
86
+ name?: string;
87
+ /**
88
+ * This field's availability is dependent on your client's configuration.
89
+ */
90
+ netsuite_sales_order_id?: string;
91
+ /**
92
+ * If multiple credits or commits are applicable, the one with the lower priority
93
+ * will apply first.
94
+ */
95
+ priority?: number;
96
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
97
+ rolled_over_from?: Commit.RolledOverFrom;
98
+ rollover_fraction?: number;
99
+ /**
100
+ * This field's availability is dependent on your client's configuration.
101
+ */
102
+ salesforce_opportunity_id?: string;
103
+ /**
104
+ * List of filters that determine what kind of customer usage draws down a commit
105
+ * or credit. A customer's usage needs to meet the condition of at least one of the
106
+ * specifiers to contribute to a commit's or credit's drawdown.
107
+ */
108
+ specifiers?: Array<CommitSpecifier>;
109
+ /**
110
+ * Prevents the creation of duplicates. If a request to create a commit or credit
111
+ * is made with a uniqueness key that was previously used to create a commit or
112
+ * credit, a new record will not be created and the request will fail with a 409
113
+ * error.
114
+ */
115
+ uniqueness_key?: string;
116
+ }
117
+ export declare namespace Commit {
118
+ interface Product {
119
+ id: string;
120
+ name: string;
121
+ }
122
+ interface Contract {
123
+ id: string;
124
+ }
125
+ /**
126
+ * The contract that this commit will be billed on.
127
+ */
128
+ interface InvoiceContract {
129
+ id: string;
130
+ }
131
+ interface PrepaidCommitSegmentStartLedgerEntry {
132
+ amount: number;
133
+ segment_id: string;
134
+ timestamp: string;
135
+ type: 'PREPAID_COMMIT_SEGMENT_START';
136
+ }
137
+ interface PrepaidCommitAutomatedInvoiceDeductionLedgerEntry {
138
+ amount: number;
139
+ invoice_id: string;
140
+ segment_id: string;
141
+ timestamp: string;
142
+ type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
143
+ contract_id?: string;
144
+ }
145
+ interface PrepaidCommitRolloverLedgerEntry {
146
+ amount: number;
147
+ new_contract_id: string;
148
+ segment_id: string;
149
+ timestamp: string;
150
+ type: 'PREPAID_COMMIT_ROLLOVER';
151
+ }
152
+ interface PrepaidCommitExpirationLedgerEntry {
153
+ amount: number;
154
+ segment_id: string;
155
+ timestamp: string;
156
+ type: 'PREPAID_COMMIT_EXPIRATION';
157
+ }
158
+ interface PrepaidCommitCanceledLedgerEntry {
159
+ amount: number;
160
+ invoice_id: string;
161
+ segment_id: string;
162
+ timestamp: string;
163
+ type: 'PREPAID_COMMIT_CANCELED';
164
+ contract_id?: string;
165
+ }
166
+ interface PrepaidCommitCreditedLedgerEntry {
167
+ amount: number;
168
+ invoice_id: string;
169
+ segment_id: string;
170
+ timestamp: string;
171
+ type: 'PREPAID_COMMIT_CREDITED';
172
+ contract_id?: string;
173
+ }
174
+ interface PrepaidCommitSeatBasedAdjustmentLedgerEntry {
175
+ amount: number;
176
+ segment_id: string;
177
+ timestamp: string;
178
+ type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT';
179
+ }
180
+ interface PostpaidCommitInitialBalanceLedgerEntry {
181
+ amount: number;
182
+ timestamp: string;
183
+ type: 'POSTPAID_COMMIT_INITIAL_BALANCE';
184
+ }
185
+ interface PostpaidCommitAutomatedInvoiceDeductionLedgerEntry {
186
+ amount: number;
187
+ invoice_id: string;
188
+ segment_id: string;
189
+ timestamp: string;
190
+ type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
191
+ contract_id?: string;
192
+ }
193
+ interface PostpaidCommitRolloverLedgerEntry {
194
+ amount: number;
195
+ new_contract_id: string;
196
+ segment_id: string;
197
+ timestamp: string;
198
+ type: 'POSTPAID_COMMIT_ROLLOVER';
199
+ }
200
+ interface PostpaidCommitTrueupLedgerEntry {
201
+ amount: number;
202
+ invoice_id: string;
203
+ timestamp: string;
204
+ type: 'POSTPAID_COMMIT_TRUEUP';
205
+ contract_id?: string;
206
+ }
207
+ interface PrepaidCommitManualLedgerEntry {
208
+ amount: number;
209
+ reason: string;
210
+ timestamp: string;
211
+ type: 'PREPAID_COMMIT_MANUAL';
212
+ }
213
+ interface PostpaidCommitManualLedgerEntry {
214
+ amount: number;
215
+ reason: string;
216
+ timestamp: string;
217
+ type: 'POSTPAID_COMMIT_MANUAL';
218
+ }
219
+ interface PostpaidCommitExpirationLedgerEntry {
220
+ amount: number;
221
+ timestamp: string;
222
+ type: 'POSTPAID_COMMIT_EXPIRATION';
223
+ }
224
+ interface RolledOverFrom {
225
+ commit_id: string;
226
+ contract_id: string;
227
+ }
228
+ }
229
+ export interface CommitHierarchyConfiguration {
230
+ child_access: CommitHierarchyConfiguration.CommitHierarchyChildAccessAll | CommitHierarchyConfiguration.CommitHierarchyChildAccessNone | CommitHierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
231
+ }
232
+ export declare namespace CommitHierarchyConfiguration {
233
+ interface CommitHierarchyChildAccessAll {
234
+ type: 'ALL';
235
+ }
236
+ interface CommitHierarchyChildAccessNone {
237
+ type: 'NONE';
238
+ }
239
+ interface CommitHierarchyChildAccessContractIDs {
240
+ contract_ids: Array<string>;
241
+ type: 'CONTRACT_IDS';
242
+ }
243
+ }
244
+ /**
245
+ * A distinct rate on the rate card. You can choose to use this rate rather than
246
+ * list rate when consuming a credit or commit.
247
+ */
248
+ export interface CommitRate {
249
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
250
+ /**
251
+ * Commit rate price. For FLAT rate_type, this must be >=0.
252
+ */
253
+ price?: number;
254
+ /**
255
+ * Only set for TIERED rate_type.
256
+ */
257
+ tiers?: Array<Tier>;
258
+ }
259
+ export interface CommitSpecifier {
260
+ presentation_group_values?: {
261
+ [key: string]: string;
262
+ };
263
+ pricing_group_values?: {
264
+ [key: string]: string;
265
+ };
266
+ /**
267
+ * If provided, the specifier will only apply to the product with the specified ID.
268
+ */
269
+ product_id?: string;
270
+ /**
271
+ * If provided, the specifier will only apply to products with all the specified
272
+ * tags.
273
+ */
274
+ product_tags?: Array<string>;
275
+ }
276
+ export interface CommitSpecifierInput {
277
+ presentation_group_values?: {
278
+ [key: string]: string;
279
+ };
280
+ pricing_group_values?: {
281
+ [key: string]: string;
282
+ };
283
+ /**
284
+ * If provided, the specifier will only apply to the product with the specified ID.
285
+ */
286
+ product_id?: string;
287
+ /**
288
+ * If provided, the specifier will only apply to products with all the specified
289
+ * tags.
290
+ */
291
+ product_tags?: Array<string>;
292
+ }
293
+ export interface Contract {
294
+ id: string;
295
+ amendments: Array<Contract.Amendment>;
296
+ current: ContractWithoutAmendments;
297
+ customer_id: string;
298
+ initial: ContractWithoutAmendments;
299
+ /**
300
+ * RFC 3339 timestamp indicating when the contract was archived. If not returned,
301
+ * the contract is not archived.
302
+ */
303
+ archived_at?: string;
304
+ /**
305
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
306
+ */
307
+ custom_fields?: {
308
+ [key: string]: string;
309
+ };
310
+ /**
311
+ * The billing provider configuration associated with a contract.
312
+ */
313
+ customer_billing_provider_configuration?: Contract.CustomerBillingProviderConfiguration;
314
+ prepaid_balance_threshold_configuration?: PrepaidBalanceThresholdConfiguration;
315
+ /**
316
+ * Priority of the contract.
317
+ */
318
+ priority?: number;
319
+ /**
320
+ * Determines which scheduled and commit charges to consolidate onto the Contract's
321
+ * usage invoice. The charge's `timestamp` must match the usage invoice's
322
+ * `ending_before` date for consolidation to occur. This field cannot be modified
323
+ * after a Contract has been created. If this field is omitted, charges will appear
324
+ * on a separate invoice from usage charges.
325
+ */
326
+ scheduled_charges_on_usage_invoices?: 'ALL';
327
+ spend_threshold_configuration?: SpendThresholdConfiguration;
328
+ /**
329
+ * List of subscriptions on the contract.
330
+ */
331
+ subscriptions?: Array<Subscription>;
332
+ /**
333
+ * Prevents the creation of duplicates. If a request to create a record is made
334
+ * with a previously used uniqueness key, a new record will not be created and the
335
+ * request will fail with a 409 error.
336
+ */
337
+ uniqueness_key?: string;
338
+ }
339
+ export declare namespace Contract {
340
+ interface Amendment {
341
+ id: string;
342
+ commits: Array<Shared.Commit>;
343
+ created_at: string;
344
+ created_by: string;
345
+ overrides: Array<Shared.Override>;
346
+ scheduled_charges: Array<Shared.ScheduledCharge>;
347
+ starting_at: string;
348
+ credits?: Array<Shared.Credit>;
349
+ /**
350
+ * This field's availability is dependent on your client's configuration.
351
+ */
352
+ discounts?: Array<Shared.Discount>;
353
+ /**
354
+ * This field's availability is dependent on your client's configuration.
355
+ */
356
+ netsuite_sales_order_id?: string;
357
+ /**
358
+ * This field's availability is dependent on your client's configuration.
359
+ */
360
+ professional_services?: Array<Shared.ProService>;
361
+ /**
362
+ * This field's availability is dependent on your client's configuration.
363
+ */
364
+ reseller_royalties?: Array<Amendment.ResellerRoyalty>;
365
+ /**
366
+ * This field's availability is dependent on your client's configuration.
367
+ */
368
+ salesforce_opportunity_id?: string;
369
+ }
370
+ namespace Amendment {
371
+ interface ResellerRoyalty {
372
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
373
+ aws_account_number?: string;
374
+ aws_offer_id?: string;
375
+ aws_payer_reference_id?: string;
376
+ ending_before?: string | null;
377
+ fraction?: number;
378
+ gcp_account_id?: string;
379
+ gcp_offer_id?: string;
380
+ netsuite_reseller_id?: string;
381
+ reseller_contract_value?: number;
382
+ starting_at?: string;
383
+ }
384
+ }
385
+ /**
386
+ * The billing provider configuration associated with a contract.
387
+ */
388
+ interface CustomerBillingProviderConfiguration {
389
+ archived_at: string | null;
390
+ billing_provider: 'aws_marketplace' | 'stripe' | 'netsuite' | 'custom' | 'azure_marketplace' | 'quickbooks_online' | 'workday' | 'gcp_marketplace';
391
+ delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
392
+ id?: string;
393
+ /**
394
+ * Configuration for the billing provider. The structure of this object is specific
395
+ * to the billing provider.
396
+ */
397
+ configuration?: {
398
+ [key: string]: unknown;
399
+ };
400
+ }
401
+ }
402
+ export interface ContractV2 {
403
+ id: string;
404
+ commits: Array<ContractV2.Commit>;
405
+ created_at: string;
406
+ created_by: string;
407
+ customer_id: string;
408
+ overrides: Array<ContractV2.Override>;
409
+ scheduled_charges: Array<ScheduledCharge>;
410
+ starting_at: string;
411
+ transitions: Array<ContractV2.Transition>;
412
+ usage_filter: Array<ContractV2.UsageFilter>;
413
+ usage_statement_schedule: ContractV2.UsageStatementSchedule;
414
+ archived_at?: string;
415
+ credits?: Array<ContractV2.Credit>;
416
+ /**
417
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
418
+ */
419
+ custom_fields?: {
420
+ [key: string]: string;
421
+ };
422
+ /**
423
+ * This field's availability is dependent on your client's configuration.
424
+ */
425
+ customer_billing_provider_configuration?: ContractV2.CustomerBillingProviderConfiguration;
426
+ /**
427
+ * This field's availability is dependent on your client's configuration.
428
+ */
429
+ discounts?: Array<Discount>;
430
+ ending_before?: string;
431
+ /**
432
+ * Indicates whether there are more items than the limit for this endpoint. Use the
433
+ * respective list endpoints to get the full lists.
434
+ */
435
+ has_more?: ContractV2.HasMore;
436
+ /**
437
+ * Either a **parent** configuration with a list of children or a **child**
438
+ * configuration with a single parent.
439
+ */
440
+ hierarchy_configuration?: HierarchyConfiguration;
441
+ /**
442
+ * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
443
+ * prices automatically. EXPLICIT prioritization requires specifying priorities for
444
+ * each multiplier; the one with the lowest priority value will be prioritized
445
+ * first.
446
+ */
447
+ multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';
448
+ name?: string;
449
+ net_payment_terms_days?: number;
450
+ /**
451
+ * This field's availability is dependent on your client's configuration.
452
+ */
453
+ netsuite_sales_order_id?: string;
454
+ prepaid_balance_threshold_configuration?: PrepaidBalanceThresholdConfigurationV2;
455
+ /**
456
+ * Priority of the contract.
457
+ */
458
+ priority?: number;
459
+ /**
460
+ * This field's availability is dependent on your client's configuration.
461
+ */
462
+ professional_services?: Array<ProService>;
463
+ rate_card_id?: string;
464
+ recurring_commits?: Array<ContractV2.RecurringCommit>;
465
+ recurring_credits?: Array<ContractV2.RecurringCredit>;
466
+ /**
467
+ * This field's availability is dependent on your client's configuration.
468
+ */
469
+ reseller_royalties?: Array<ContractV2.ResellerRoyalty>;
470
+ /**
471
+ * This field's availability is dependent on your client's configuration.
472
+ */
473
+ salesforce_opportunity_id?: string;
474
+ /**
475
+ * Determines which scheduled and commit charges to consolidate onto the Contract's
476
+ * usage invoice. The charge's `timestamp` must match the usage invoice's
477
+ * `ending_before` date for consolidation to occur. This field cannot be modified
478
+ * after a Contract has been created. If this field is omitted, charges will appear
479
+ * on a separate invoice from usage charges.
480
+ */
481
+ scheduled_charges_on_usage_invoices?: 'ALL';
482
+ spend_threshold_configuration?: SpendThresholdConfigurationV2;
483
+ /**
484
+ * List of subscriptions on the contract.
485
+ */
486
+ subscriptions?: Array<Subscription>;
487
+ total_contract_value?: number;
488
+ /**
489
+ * Optional uniqueness key to prevent duplicate contract creations.
490
+ */
491
+ uniqueness_key?: string;
492
+ }
493
+ export declare namespace ContractV2 {
494
+ interface Commit {
495
+ id: string;
496
+ /**
497
+ * Timestamp of when the commit was created.
498
+ *
499
+ * - Recurring commits: latter of commit service period date and parent commit
500
+ * start date
501
+ * - Rollover commits: when the new contract started
502
+ */
503
+ created_at: string;
504
+ product: Commit.Product;
505
+ type: 'PREPAID' | 'POSTPAID';
506
+ /**
507
+ * The schedule that the customer will gain access to the credits purposed with
508
+ * this commit.
509
+ */
510
+ access_schedule?: Shared.ScheduleDuration;
511
+ applicable_contract_ids?: Array<string>;
512
+ applicable_product_ids?: Array<string>;
513
+ applicable_product_tags?: Array<string>;
514
+ archived_at?: string;
515
+ /**
516
+ * The current balance of the credit or commit. This balance reflects the amount of
517
+ * credit or commit that the customer has access to use at this moment - thus,
518
+ * expired and upcoming credit or commit segments contribute 0 to the balance. The
519
+ * balance will match the sum of all ledger entries with the exception of the case
520
+ * where the sum of negative manual ledger entries exceeds the positive amount
521
+ * remaining on the credit or commit - in that case, the balance will be 0. All
522
+ * manual ledger entries associated with active credit or commit segments are
523
+ * included in the balance, including future-dated manual ledger entries.
524
+ */
525
+ balance?: number;
526
+ contract?: Commit.Contract;
527
+ /**
528
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
529
+ */
530
+ custom_fields?: {
531
+ [key: string]: string;
532
+ };
533
+ description?: string;
534
+ /**
535
+ * Optional configuration for commit hierarchy access control
536
+ */
537
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
538
+ /**
539
+ * The contract that this commit will be billed on.
540
+ */
541
+ invoice_contract?: Commit.InvoiceContract;
542
+ /**
543
+ * The schedule that the customer will be invoiced for this commit.
544
+ */
545
+ invoice_schedule?: Shared.SchedulePointInTime;
546
+ /**
547
+ * A list of ordered events that impact the balance of a commit. For example, an
548
+ * invoice deduction or a rollover.
549
+ */
550
+ ledger?: Array<Commit.PrepaidCommitSegmentStartLedgerEntry | Commit.PrepaidCommitAutomatedInvoiceDeductionLedgerEntry | Commit.PrepaidCommitRolloverLedgerEntry | Commit.PrepaidCommitExpirationLedgerEntry | Commit.PrepaidCommitCanceledLedgerEntry | Commit.PrepaidCommitCreditedLedgerEntry | Commit.PrepaidCommitSeatBasedAdjustmentLedgerEntry | Commit.PostpaidCommitInitialBalanceLedgerEntry | Commit.PostpaidCommitAutomatedInvoiceDeductionLedgerEntry | Commit.PostpaidCommitRolloverLedgerEntry | Commit.PostpaidCommitTrueupLedgerEntry | Commit.PrepaidCommitManualLedgerEntry | Commit.PostpaidCommitManualLedgerEntry | Commit.PostpaidCommitExpirationLedgerEntry>;
551
+ name?: string;
552
+ /**
553
+ * This field's availability is dependent on your client's configuration.
554
+ */
555
+ netsuite_sales_order_id?: string;
556
+ /**
557
+ * If multiple credits or commits are applicable, the one with the lower priority
558
+ * will apply first.
559
+ */
560
+ priority?: number;
561
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
562
+ rolled_over_from?: Commit.RolledOverFrom;
563
+ rollover_fraction?: number;
564
+ /**
565
+ * This field's availability is dependent on your client's configuration.
566
+ */
567
+ salesforce_opportunity_id?: string;
568
+ /**
569
+ * List of filters that determine what kind of customer usage draws down a commit
570
+ * or credit. A customer's usage needs to meet the condition of at least one of the
571
+ * specifiers to contribute to a commit's or credit's drawdown.
572
+ */
573
+ specifiers?: Array<Shared.CommitSpecifier>;
574
+ }
575
+ namespace Commit {
576
+ interface Product {
577
+ id: string;
578
+ name: string;
579
+ }
580
+ interface Contract {
581
+ id: string;
582
+ }
583
+ /**
584
+ * The contract that this commit will be billed on.
585
+ */
586
+ interface InvoiceContract {
587
+ id: string;
588
+ }
589
+ interface PrepaidCommitSegmentStartLedgerEntry {
590
+ amount: number;
591
+ segment_id: string;
592
+ timestamp: string;
593
+ type: 'PREPAID_COMMIT_SEGMENT_START';
594
+ }
595
+ interface PrepaidCommitAutomatedInvoiceDeductionLedgerEntry {
596
+ amount: number;
597
+ invoice_id: string;
598
+ segment_id: string;
599
+ timestamp: string;
600
+ type: 'PREPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
601
+ contract_id?: string;
602
+ }
603
+ interface PrepaidCommitRolloverLedgerEntry {
604
+ amount: number;
605
+ new_contract_id: string;
606
+ segment_id: string;
607
+ timestamp: string;
608
+ type: 'PREPAID_COMMIT_ROLLOVER';
609
+ }
610
+ interface PrepaidCommitExpirationLedgerEntry {
611
+ amount: number;
612
+ segment_id: string;
613
+ timestamp: string;
614
+ type: 'PREPAID_COMMIT_EXPIRATION';
615
+ }
616
+ interface PrepaidCommitCanceledLedgerEntry {
617
+ amount: number;
618
+ invoice_id: string;
619
+ segment_id: string;
620
+ timestamp: string;
621
+ type: 'PREPAID_COMMIT_CANCELED';
622
+ contract_id?: string;
623
+ }
624
+ interface PrepaidCommitCreditedLedgerEntry {
625
+ amount: number;
626
+ invoice_id: string;
627
+ segment_id: string;
628
+ timestamp: string;
629
+ type: 'PREPAID_COMMIT_CREDITED';
630
+ contract_id?: string;
631
+ }
632
+ interface PrepaidCommitSeatBasedAdjustmentLedgerEntry {
633
+ amount: number;
634
+ segment_id: string;
635
+ timestamp: string;
636
+ type: 'PREPAID_COMMIT_SEAT_BASED_ADJUSTMENT';
637
+ }
638
+ interface PostpaidCommitInitialBalanceLedgerEntry {
639
+ amount: number;
640
+ timestamp: string;
641
+ type: 'POSTPAID_COMMIT_INITIAL_BALANCE';
642
+ }
643
+ interface PostpaidCommitAutomatedInvoiceDeductionLedgerEntry {
644
+ amount: number;
645
+ invoice_id: string;
646
+ segment_id: string;
647
+ timestamp: string;
648
+ type: 'POSTPAID_COMMIT_AUTOMATED_INVOICE_DEDUCTION';
649
+ contract_id?: string;
650
+ }
651
+ interface PostpaidCommitRolloverLedgerEntry {
652
+ amount: number;
653
+ new_contract_id: string;
654
+ segment_id: string;
655
+ timestamp: string;
656
+ type: 'POSTPAID_COMMIT_ROLLOVER';
657
+ }
658
+ interface PostpaidCommitTrueupLedgerEntry {
659
+ amount: number;
660
+ invoice_id: string;
661
+ timestamp: string;
662
+ type: 'POSTPAID_COMMIT_TRUEUP';
663
+ contract_id?: string;
664
+ }
665
+ interface PrepaidCommitManualLedgerEntry {
666
+ amount: number;
667
+ reason: string;
668
+ timestamp: string;
669
+ type: 'PREPAID_COMMIT_MANUAL';
670
+ }
671
+ interface PostpaidCommitManualLedgerEntry {
672
+ amount: number;
673
+ reason: string;
674
+ timestamp: string;
675
+ type: 'POSTPAID_COMMIT_MANUAL';
676
+ }
677
+ interface PostpaidCommitExpirationLedgerEntry {
678
+ amount: number;
679
+ timestamp: string;
680
+ type: 'POSTPAID_COMMIT_EXPIRATION';
681
+ }
682
+ interface RolledOverFrom {
683
+ commit_id: string;
684
+ contract_id: string;
685
+ }
686
+ }
687
+ interface Override {
688
+ id: string;
689
+ starting_at: string;
690
+ applicable_product_tags?: Array<string>;
691
+ ending_before?: string;
692
+ entitled?: boolean;
693
+ is_commit_specific?: boolean;
694
+ multiplier?: number;
695
+ override_specifiers?: Array<Override.OverrideSpecifier>;
696
+ override_tiers?: Array<Shared.OverrideTier>;
697
+ overwrite_rate?: Shared.OverwriteRate;
698
+ priority?: number;
699
+ product?: Override.Product;
700
+ target?: 'COMMIT_RATE' | 'LIST_RATE';
701
+ type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
702
+ }
703
+ namespace Override {
704
+ interface OverrideSpecifier {
705
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
706
+ commit_ids?: Array<string>;
707
+ presentation_group_values?: {
708
+ [key: string]: string | null;
709
+ };
710
+ pricing_group_values?: {
711
+ [key: string]: string;
712
+ };
713
+ product_id?: string;
714
+ product_tags?: Array<string>;
715
+ recurring_commit_ids?: Array<string>;
716
+ recurring_credit_ids?: Array<string>;
717
+ }
718
+ interface Product {
719
+ id: string;
720
+ name: string;
721
+ }
722
+ }
723
+ interface Transition {
724
+ from_contract_id: string;
725
+ to_contract_id: string;
726
+ type: 'SUPERSEDE' | 'RENEWAL';
727
+ }
728
+ interface UsageFilter {
729
+ group_key: string;
730
+ group_values: Array<string>;
731
+ /**
732
+ * This will match contract starting_at value if usage filter is active from the
733
+ * beginning of the contract.
734
+ */
735
+ starting_at: string;
736
+ /**
737
+ * This will match contract ending_before value if usage filter is active until the
738
+ * end of the contract. It will be undefined if the contract is open-ended.
739
+ */
740
+ ending_before?: string;
741
+ }
742
+ interface UsageStatementSchedule {
743
+ /**
744
+ * Contract usage statements follow a selected cadence based on this date.
745
+ */
746
+ billing_anchor_date: string;
747
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
748
+ }
749
+ interface Credit {
750
+ id: string;
751
+ product: Credit.Product;
752
+ type: 'CREDIT';
753
+ /**
754
+ * The schedule that the customer will gain access to the credits.
755
+ */
756
+ access_schedule?: Shared.ScheduleDuration;
757
+ applicable_contract_ids?: Array<string>;
758
+ applicable_product_ids?: Array<string>;
759
+ applicable_product_tags?: Array<string>;
760
+ /**
761
+ * The current balance of the credit or commit. This balance reflects the amount of
762
+ * credit or commit that the customer has access to use at this moment - thus,
763
+ * expired and upcoming credit or commit segments contribute 0 to the balance. The
764
+ * balance will match the sum of all ledger entries with the exception of the case
765
+ * where the sum of negative manual ledger entries exceeds the positive amount
766
+ * remaining on the credit or commit - in that case, the balance will be 0. All
767
+ * manual ledger entries associated with active credit or commit segments are
768
+ * included in the balance, including future-dated manual ledger entries.
769
+ */
770
+ balance?: number;
771
+ contract?: Credit.Contract;
772
+ /**
773
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
774
+ */
775
+ custom_fields?: {
776
+ [key: string]: string;
777
+ };
778
+ description?: string;
779
+ /**
780
+ * Optional configuration for credit hierarchy access control
781
+ */
782
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
783
+ /**
784
+ * A list of ordered events that impact the balance of a credit. For example, an
785
+ * invoice deduction or an expiration.
786
+ */
787
+ ledger?: Array<Credit.CreditSegmentStartLedgerEntry | Credit.CreditAutomatedInvoiceDeductionLedgerEntry | Credit.CreditExpirationLedgerEntry | Credit.CreditCanceledLedgerEntry | Credit.CreditCreditedLedgerEntry | Credit.CreditManualLedgerEntry | Credit.CreditSeatBasedAdjustmentLedgerEntry>;
788
+ name?: string;
789
+ /**
790
+ * This field's availability is dependent on your client's configuration.
791
+ */
792
+ netsuite_sales_order_id?: string;
793
+ /**
794
+ * If multiple credits or commits are applicable, the one with the lower priority
795
+ * will apply first.
796
+ */
797
+ priority?: number;
798
+ /**
799
+ * This field's availability is dependent on your client's configuration.
800
+ */
801
+ salesforce_opportunity_id?: string;
802
+ /**
803
+ * List of filters that determine what kind of customer usage draws down a commit
804
+ * or credit. A customer's usage needs to meet the condition of at least one of the
805
+ * specifiers to contribute to a commit's or credit's drawdown.
806
+ */
807
+ specifiers?: Array<Shared.CommitSpecifier>;
808
+ }
809
+ namespace Credit {
810
+ interface Product {
811
+ id: string;
812
+ name: string;
813
+ }
814
+ interface Contract {
815
+ id: string;
816
+ }
817
+ interface CreditSegmentStartLedgerEntry {
818
+ amount: number;
819
+ segment_id: string;
820
+ timestamp: string;
821
+ type: 'CREDIT_SEGMENT_START';
822
+ }
823
+ interface CreditAutomatedInvoiceDeductionLedgerEntry {
824
+ amount: number;
825
+ invoice_id: string;
826
+ segment_id: string;
827
+ timestamp: string;
828
+ type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION';
829
+ contract_id?: string;
830
+ }
831
+ interface CreditExpirationLedgerEntry {
832
+ amount: number;
833
+ segment_id: string;
834
+ timestamp: string;
835
+ type: 'CREDIT_EXPIRATION';
836
+ }
837
+ interface CreditCanceledLedgerEntry {
838
+ amount: number;
839
+ invoice_id: string;
840
+ segment_id: string;
841
+ timestamp: string;
842
+ type: 'CREDIT_CANCELED';
843
+ contract_id?: string;
844
+ }
845
+ interface CreditCreditedLedgerEntry {
846
+ amount: number;
847
+ invoice_id: string;
848
+ segment_id: string;
849
+ timestamp: string;
850
+ type: 'CREDIT_CREDITED';
851
+ contract_id?: string;
852
+ }
853
+ interface CreditManualLedgerEntry {
854
+ amount: number;
855
+ reason: string;
856
+ timestamp: string;
857
+ type: 'CREDIT_MANUAL';
858
+ }
859
+ interface CreditSeatBasedAdjustmentLedgerEntry {
860
+ amount: number;
861
+ segment_id: string;
862
+ timestamp: string;
863
+ type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
864
+ }
865
+ }
866
+ /**
867
+ * This field's availability is dependent on your client's configuration.
868
+ */
869
+ interface CustomerBillingProviderConfiguration {
870
+ /**
871
+ * ID of Customer's billing provider configuration.
872
+ */
873
+ id: string;
874
+ billing_provider: 'aws_marketplace' | 'stripe' | 'netsuite' | 'custom' | 'azure_marketplace' | 'quickbooks_online' | 'workday' | 'gcp_marketplace';
875
+ delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
876
+ }
877
+ /**
878
+ * Indicates whether there are more items than the limit for this endpoint. Use the
879
+ * respective list endpoints to get the full lists.
880
+ */
881
+ interface HasMore {
882
+ /**
883
+ * Whether there are more commits on this contract than the limit for this
884
+ * endpoint. Use the /contracts/customerCommits/list endpoint to get the full list
885
+ * of commits.
886
+ */
887
+ commits: boolean;
888
+ /**
889
+ * Whether there are more credits on this contract than the limit for this
890
+ * endpoint. Use the /contracts/customerCredits/list endpoint to get the full list
891
+ * of credits.
892
+ */
893
+ credits: boolean;
894
+ }
895
+ interface RecurringCommit {
896
+ id: string;
897
+ /**
898
+ * The amount of commit to grant.
899
+ */
900
+ access_amount: RecurringCommit.AccessAmount;
901
+ /**
902
+ * The amount of time the created commits will be valid for
903
+ */
904
+ commit_duration: RecurringCommit.CommitDuration;
905
+ /**
906
+ * Will be passed down to the individual commits
907
+ */
908
+ priority: number;
909
+ product: RecurringCommit.Product;
910
+ /**
911
+ * Whether the created commits will use the commit rate or list rate
912
+ */
913
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
914
+ /**
915
+ * Determines the start time for the first commit
916
+ */
917
+ starting_at: string;
918
+ /**
919
+ * Will be passed down to the individual commits
920
+ */
921
+ applicable_product_ids?: Array<string>;
922
+ /**
923
+ * Will be passed down to the individual commits
924
+ */
925
+ applicable_product_tags?: Array<string>;
926
+ contract?: RecurringCommit.Contract;
927
+ /**
928
+ * Will be passed down to the individual commits
929
+ */
930
+ description?: string;
931
+ /**
932
+ * Determines when the contract will stop creating recurring commits. Optional
933
+ */
934
+ ending_before?: string;
935
+ /**
936
+ * Optional configuration for recurring credit hierarchy access control
937
+ */
938
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
939
+ /**
940
+ * The amount the customer should be billed for the commit. Not required.
941
+ */
942
+ invoice_amount?: RecurringCommit.InvoiceAmount;
943
+ /**
944
+ * Displayed on invoices. Will be passed through to the individual commits
945
+ */
946
+ name?: string;
947
+ /**
948
+ * Will be passed down to the individual commits
949
+ */
950
+ netsuite_sales_order_id?: string;
951
+ /**
952
+ * Determines whether the first and last commit will be prorated. If not provided,
953
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
954
+ */
955
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
956
+ /**
957
+ * The frequency at which the recurring commits will be created. If not provided: -
958
+ * The commits will be created on the usage invoice frequency. If provided: - The
959
+ * period defined in the duration will correspond to this frequency. - Commits will
960
+ * be created aligned with the recurring commit's starting_at rather than the usage
961
+ * invoice dates.
962
+ */
963
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
964
+ /**
965
+ * Will be passed down to the individual commits. This controls how much of an
966
+ * individual unexpired commit will roll over upon contract transition. Must be
967
+ * between 0 and 1.
968
+ */
969
+ rollover_fraction?: number;
970
+ /**
971
+ * List of filters that determine what kind of customer usage draws down a commit
972
+ * or credit. A customer's usage needs to meet the condition of at least one of the
973
+ * specifiers to contribute to a commit's or credit's drawdown.
974
+ */
975
+ specifiers?: Array<Shared.CommitSpecifier>;
976
+ /**
977
+ * Attach a subscription to the recurring commit/credit.
978
+ */
979
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
980
+ }
981
+ namespace RecurringCommit {
982
+ /**
983
+ * The amount of commit to grant.
984
+ */
985
+ interface AccessAmount {
986
+ credit_type_id: string;
987
+ unit_price: number;
988
+ quantity?: number;
989
+ }
990
+ /**
991
+ * The amount of time the created commits will be valid for
992
+ */
993
+ interface CommitDuration {
994
+ value: number;
995
+ unit?: 'PERIODS';
996
+ }
997
+ interface Product {
998
+ id: string;
999
+ name: string;
1000
+ }
1001
+ interface Contract {
1002
+ id: string;
1003
+ }
1004
+ /**
1005
+ * The amount the customer should be billed for the commit. Not required.
1006
+ */
1007
+ interface InvoiceAmount {
1008
+ credit_type_id: string;
1009
+ quantity: number;
1010
+ unit_price: number;
1011
+ }
1012
+ }
1013
+ interface RecurringCredit {
1014
+ id: string;
1015
+ /**
1016
+ * The amount of commit to grant.
1017
+ */
1018
+ access_amount: RecurringCredit.AccessAmount;
1019
+ /**
1020
+ * The amount of time the created commits will be valid for
1021
+ */
1022
+ commit_duration: RecurringCredit.CommitDuration;
1023
+ /**
1024
+ * Will be passed down to the individual commits
1025
+ */
1026
+ priority: number;
1027
+ product: RecurringCredit.Product;
1028
+ /**
1029
+ * Whether the created commits will use the commit rate or list rate
1030
+ */
1031
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
1032
+ /**
1033
+ * Determines the start time for the first commit
1034
+ */
1035
+ starting_at: string;
1036
+ /**
1037
+ * Will be passed down to the individual commits
1038
+ */
1039
+ applicable_product_ids?: Array<string>;
1040
+ /**
1041
+ * Will be passed down to the individual commits
1042
+ */
1043
+ applicable_product_tags?: Array<string>;
1044
+ contract?: RecurringCredit.Contract;
1045
+ /**
1046
+ * Will be passed down to the individual commits
1047
+ */
1048
+ description?: string;
1049
+ /**
1050
+ * Determines when the contract will stop creating recurring commits. Optional
1051
+ */
1052
+ ending_before?: string;
1053
+ /**
1054
+ * Optional configuration for recurring credit hierarchy access control
1055
+ */
1056
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1057
+ /**
1058
+ * Displayed on invoices. Will be passed through to the individual commits
1059
+ */
1060
+ name?: string;
1061
+ /**
1062
+ * Will be passed down to the individual commits
1063
+ */
1064
+ netsuite_sales_order_id?: string;
1065
+ /**
1066
+ * Determines whether the first and last commit will be prorated. If not provided,
1067
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1068
+ */
1069
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1070
+ /**
1071
+ * The frequency at which the recurring commits will be created. If not provided: -
1072
+ * The commits will be created on the usage invoice frequency. If provided: - The
1073
+ * period defined in the duration will correspond to this frequency. - Commits will
1074
+ * be created aligned with the recurring commit's starting_at rather than the usage
1075
+ * invoice dates.
1076
+ */
1077
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1078
+ /**
1079
+ * Will be passed down to the individual commits. This controls how much of an
1080
+ * individual unexpired commit will roll over upon contract transition. Must be
1081
+ * between 0 and 1.
1082
+ */
1083
+ rollover_fraction?: number;
1084
+ /**
1085
+ * List of filters that determine what kind of customer usage draws down a commit
1086
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1087
+ * specifiers to contribute to a commit's or credit's drawdown.
1088
+ */
1089
+ specifiers?: Array<Shared.CommitSpecifier>;
1090
+ /**
1091
+ * Attach a subscription to the recurring commit/credit.
1092
+ */
1093
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
1094
+ }
1095
+ namespace RecurringCredit {
1096
+ /**
1097
+ * The amount of commit to grant.
1098
+ */
1099
+ interface AccessAmount {
1100
+ credit_type_id: string;
1101
+ unit_price: number;
1102
+ quantity?: number;
1103
+ }
1104
+ /**
1105
+ * The amount of time the created commits will be valid for
1106
+ */
1107
+ interface CommitDuration {
1108
+ value: number;
1109
+ unit?: 'PERIODS';
1110
+ }
1111
+ interface Product {
1112
+ id: string;
1113
+ name: string;
1114
+ }
1115
+ interface Contract {
1116
+ id: string;
1117
+ }
1118
+ }
1119
+ interface ResellerRoyalty {
1120
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
1121
+ segments: Array<ResellerRoyalty.Segment>;
1122
+ }
1123
+ namespace ResellerRoyalty {
1124
+ interface Segment {
1125
+ fraction: number;
1126
+ netsuite_reseller_id: string;
1127
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
1128
+ starting_at: string;
1129
+ applicable_product_ids?: Array<string>;
1130
+ applicable_product_tags?: Array<string>;
1131
+ aws_account_number?: string;
1132
+ aws_offer_id?: string;
1133
+ aws_payer_reference_id?: string;
1134
+ ending_before?: string;
1135
+ gcp_account_id?: string;
1136
+ gcp_offer_id?: string;
1137
+ reseller_contract_value?: number;
1138
+ }
1139
+ }
1140
+ }
1141
+ export interface ContractWithoutAmendments {
1142
+ commits: Array<Commit>;
1143
+ created_at: string;
1144
+ created_by: string;
1145
+ overrides: Array<Override>;
1146
+ scheduled_charges: Array<ScheduledCharge>;
1147
+ starting_at: string;
1148
+ transitions: Array<ContractWithoutAmendments.Transition>;
1149
+ usage_statement_schedule: ContractWithoutAmendments.UsageStatementSchedule;
1150
+ credits?: Array<Credit>;
1151
+ /**
1152
+ * This field's availability is dependent on your client's configuration.
1153
+ */
1154
+ discounts?: Array<Discount>;
1155
+ ending_before?: string;
1156
+ /**
1157
+ * Either a **parent** configuration with a list of children or a **child**
1158
+ * configuration with a single parent.
1159
+ */
1160
+ hierarchy_configuration?: HierarchyConfiguration;
1161
+ name?: string;
1162
+ net_payment_terms_days?: number;
1163
+ /**
1164
+ * This field's availability is dependent on your client's configuration.
1165
+ */
1166
+ netsuite_sales_order_id?: string;
1167
+ prepaid_balance_threshold_configuration?: PrepaidBalanceThresholdConfiguration;
1168
+ /**
1169
+ * This field's availability is dependent on your client's configuration.
1170
+ */
1171
+ professional_services?: Array<ProService>;
1172
+ rate_card_id?: string;
1173
+ recurring_commits?: Array<ContractWithoutAmendments.RecurringCommit>;
1174
+ recurring_credits?: Array<ContractWithoutAmendments.RecurringCredit>;
1175
+ /**
1176
+ * This field's availability is dependent on your client's configuration.
1177
+ */
1178
+ reseller_royalties?: Array<ContractWithoutAmendments.ResellerRoyalty>;
1179
+ /**
1180
+ * This field's availability is dependent on your client's configuration.
1181
+ */
1182
+ salesforce_opportunity_id?: string;
1183
+ /**
1184
+ * Determines which scheduled and commit charges to consolidate onto the Contract's
1185
+ * usage invoice. The charge's `timestamp` must match the usage invoice's
1186
+ * `ending_before` date for consolidation to occur. This field cannot be modified
1187
+ * after a Contract has been created. If this field is omitted, charges will appear
1188
+ * on a separate invoice from usage charges.
1189
+ */
1190
+ scheduled_charges_on_usage_invoices?: 'ALL';
1191
+ spend_threshold_configuration?: SpendThresholdConfiguration;
1192
+ /**
1193
+ * This field's availability is dependent on your client's configuration.
1194
+ */
1195
+ total_contract_value?: number;
1196
+ usage_filter?: ContractWithoutAmendments.UsageFilter;
1197
+ }
1198
+ export declare namespace ContractWithoutAmendments {
1199
+ interface Transition {
1200
+ from_contract_id: string;
1201
+ to_contract_id: string;
1202
+ type: 'SUPERSEDE' | 'RENEWAL';
1203
+ }
1204
+ interface UsageStatementSchedule {
1205
+ /**
1206
+ * Contract usage statements follow a selected cadence based on this date.
1207
+ */
1208
+ billing_anchor_date: string;
1209
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1210
+ }
1211
+ interface RecurringCommit {
1212
+ id: string;
1213
+ /**
1214
+ * The amount of commit to grant.
1215
+ */
1216
+ access_amount: RecurringCommit.AccessAmount;
1217
+ /**
1218
+ * The amount of time the created commits will be valid for
1219
+ */
1220
+ commit_duration: RecurringCommit.CommitDuration;
1221
+ /**
1222
+ * Will be passed down to the individual commits
1223
+ */
1224
+ priority: number;
1225
+ product: RecurringCommit.Product;
1226
+ /**
1227
+ * Whether the created commits will use the commit rate or list rate
1228
+ */
1229
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
1230
+ /**
1231
+ * Determines the start time for the first commit
1232
+ */
1233
+ starting_at: string;
1234
+ /**
1235
+ * Will be passed down to the individual commits
1236
+ */
1237
+ applicable_product_ids?: Array<string>;
1238
+ /**
1239
+ * Will be passed down to the individual commits
1240
+ */
1241
+ applicable_product_tags?: Array<string>;
1242
+ contract?: RecurringCommit.Contract;
1243
+ /**
1244
+ * Will be passed down to the individual commits
1245
+ */
1246
+ description?: string;
1247
+ /**
1248
+ * Determines when the contract will stop creating recurring commits. Optional
1249
+ */
1250
+ ending_before?: string;
1251
+ /**
1252
+ * Optional configuration for recurring commit/credit hierarchy access control
1253
+ */
1254
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1255
+ /**
1256
+ * The amount the customer should be billed for the commit. Not required.
1257
+ */
1258
+ invoice_amount?: RecurringCommit.InvoiceAmount;
1259
+ /**
1260
+ * Displayed on invoices. Will be passed through to the individual commits
1261
+ */
1262
+ name?: string;
1263
+ /**
1264
+ * Will be passed down to the individual commits
1265
+ */
1266
+ netsuite_sales_order_id?: string;
1267
+ /**
1268
+ * Determines whether the first and last commit will be prorated. If not provided,
1269
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1270
+ */
1271
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1272
+ /**
1273
+ * The frequency at which the recurring commits will be created. If not provided: -
1274
+ * The commits will be created on the usage invoice frequency. If provided: - The
1275
+ * period defined in the duration will correspond to this frequency. - Commits will
1276
+ * be created aligned with the recurring commit's starting_at rather than the usage
1277
+ * invoice dates.
1278
+ */
1279
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1280
+ /**
1281
+ * Will be passed down to the individual commits. This controls how much of an
1282
+ * individual unexpired commit will roll over upon contract transition. Must be
1283
+ * between 0 and 1.
1284
+ */
1285
+ rollover_fraction?: number;
1286
+ /**
1287
+ * List of filters that determine what kind of customer usage draws down a commit
1288
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1289
+ * specifiers to contribute to a commit's or credit's drawdown.
1290
+ */
1291
+ specifiers?: Array<Shared.CommitSpecifier>;
1292
+ /**
1293
+ * Attach a subscription to the recurring commit/credit.
1294
+ */
1295
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
1296
+ }
1297
+ namespace RecurringCommit {
1298
+ /**
1299
+ * The amount of commit to grant.
1300
+ */
1301
+ interface AccessAmount {
1302
+ credit_type_id: string;
1303
+ unit_price: number;
1304
+ quantity?: number;
1305
+ }
1306
+ /**
1307
+ * The amount of time the created commits will be valid for
1308
+ */
1309
+ interface CommitDuration {
1310
+ value: number;
1311
+ unit?: 'PERIODS';
1312
+ }
1313
+ interface Product {
1314
+ id: string;
1315
+ name: string;
1316
+ }
1317
+ interface Contract {
1318
+ id: string;
1319
+ }
1320
+ /**
1321
+ * The amount the customer should be billed for the commit. Not required.
1322
+ */
1323
+ interface InvoiceAmount {
1324
+ credit_type_id: string;
1325
+ quantity: number;
1326
+ unit_price: number;
1327
+ }
1328
+ }
1329
+ interface RecurringCredit {
1330
+ id: string;
1331
+ /**
1332
+ * The amount of commit to grant.
1333
+ */
1334
+ access_amount: RecurringCredit.AccessAmount;
1335
+ /**
1336
+ * The amount of time the created commits will be valid for
1337
+ */
1338
+ commit_duration: RecurringCredit.CommitDuration;
1339
+ /**
1340
+ * Will be passed down to the individual commits
1341
+ */
1342
+ priority: number;
1343
+ product: RecurringCredit.Product;
1344
+ /**
1345
+ * Whether the created commits will use the commit rate or list rate
1346
+ */
1347
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
1348
+ /**
1349
+ * Determines the start time for the first commit
1350
+ */
1351
+ starting_at: string;
1352
+ /**
1353
+ * Will be passed down to the individual commits
1354
+ */
1355
+ applicable_product_ids?: Array<string>;
1356
+ /**
1357
+ * Will be passed down to the individual commits
1358
+ */
1359
+ applicable_product_tags?: Array<string>;
1360
+ contract?: RecurringCredit.Contract;
1361
+ /**
1362
+ * Will be passed down to the individual commits
1363
+ */
1364
+ description?: string;
1365
+ /**
1366
+ * Determines when the contract will stop creating recurring commits. Optional
1367
+ */
1368
+ ending_before?: string;
1369
+ /**
1370
+ * Optional configuration for recurring commit/credit hierarchy access control
1371
+ */
1372
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1373
+ /**
1374
+ * Displayed on invoices. Will be passed through to the individual commits
1375
+ */
1376
+ name?: string;
1377
+ /**
1378
+ * Will be passed down to the individual commits
1379
+ */
1380
+ netsuite_sales_order_id?: string;
1381
+ /**
1382
+ * Determines whether the first and last commit will be prorated. If not provided,
1383
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1384
+ */
1385
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1386
+ /**
1387
+ * The frequency at which the recurring commits will be created. If not provided: -
1388
+ * The commits will be created on the usage invoice frequency. If provided: - The
1389
+ * period defined in the duration will correspond to this frequency. - Commits will
1390
+ * be created aligned with the recurring commit's starting_at rather than the usage
1391
+ * invoice dates.
1392
+ */
1393
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1394
+ /**
1395
+ * Will be passed down to the individual commits. This controls how much of an
1396
+ * individual unexpired commit will roll over upon contract transition. Must be
1397
+ * between 0 and 1.
1398
+ */
1399
+ rollover_fraction?: number;
1400
+ /**
1401
+ * List of filters that determine what kind of customer usage draws down a commit
1402
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1403
+ * specifiers to contribute to a commit's or credit's drawdown.
1404
+ */
1405
+ specifiers?: Array<Shared.CommitSpecifier>;
1406
+ /**
1407
+ * Attach a subscription to the recurring commit/credit.
1408
+ */
1409
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
1410
+ }
1411
+ namespace RecurringCredit {
1412
+ /**
1413
+ * The amount of commit to grant.
1414
+ */
1415
+ interface AccessAmount {
1416
+ credit_type_id: string;
1417
+ unit_price: number;
1418
+ quantity?: number;
1419
+ }
1420
+ /**
1421
+ * The amount of time the created commits will be valid for
1422
+ */
1423
+ interface CommitDuration {
1424
+ value: number;
1425
+ unit?: 'PERIODS';
1426
+ }
1427
+ interface Product {
1428
+ id: string;
1429
+ name: string;
1430
+ }
1431
+ interface Contract {
1432
+ id: string;
1433
+ }
1434
+ }
1435
+ interface ResellerRoyalty {
1436
+ fraction: number;
1437
+ netsuite_reseller_id: string;
1438
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
1439
+ starting_at: string;
1440
+ applicable_product_ids?: Array<string>;
1441
+ applicable_product_tags?: Array<string>;
1442
+ aws_account_number?: string;
1443
+ aws_offer_id?: string;
1444
+ aws_payer_reference_id?: string;
1445
+ ending_before?: string;
1446
+ gcp_account_id?: string;
1447
+ gcp_offer_id?: string;
1448
+ reseller_contract_value?: number;
1449
+ }
1450
+ interface UsageFilter {
1451
+ current: Shared.BaseUsageFilter | null;
1452
+ initial: Shared.BaseUsageFilter;
1453
+ updates: Array<UsageFilter.Update>;
1454
+ }
1455
+ namespace UsageFilter {
1456
+ interface Update {
1457
+ group_key: string;
1458
+ group_values: Array<string>;
1459
+ starting_at: string;
1460
+ }
1461
+ }
1462
+ }
1463
+ export interface Credit {
1464
+ id: string;
1465
+ product: Credit.Product;
1466
+ type: 'CREDIT';
1467
+ /**
1468
+ * The schedule that the customer will gain access to the credits.
1469
+ */
1470
+ access_schedule?: ScheduleDuration;
1471
+ applicable_contract_ids?: Array<string>;
1472
+ applicable_product_ids?: Array<string>;
1473
+ applicable_product_tags?: Array<string>;
1474
+ /**
1475
+ * The current balance of the credit or commit. This balance reflects the amount of
1476
+ * credit or commit that the customer has access to use at this moment - thus,
1477
+ * expired and upcoming credit or commit segments contribute 0 to the balance. The
1478
+ * balance will match the sum of all ledger entries with the exception of the case
1479
+ * where the sum of negative manual ledger entries exceeds the positive amount
1480
+ * remaining on the credit or commit - in that case, the balance will be 0. All
1481
+ * manual ledger entries associated with active credit or commit segments are
1482
+ * included in the balance, including future-dated manual ledger entries.
1483
+ */
1484
+ balance?: number;
1485
+ contract?: Credit.Contract;
1486
+ /**
1487
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1488
+ */
1489
+ custom_fields?: {
1490
+ [key: string]: string;
1491
+ };
1492
+ description?: string;
1493
+ /**
1494
+ * Optional configuration for credit hierarchy access control
1495
+ */
1496
+ hierarchy_configuration?: CommitHierarchyConfiguration;
1497
+ /**
1498
+ * A list of ordered events that impact the balance of a credit. For example, an
1499
+ * invoice deduction or an expiration.
1500
+ */
1501
+ ledger?: Array<Credit.CreditSegmentStartLedgerEntry | Credit.CreditAutomatedInvoiceDeductionLedgerEntry | Credit.CreditExpirationLedgerEntry | Credit.CreditCanceledLedgerEntry | Credit.CreditCreditedLedgerEntry | Credit.CreditManualLedgerEntry | Credit.CreditSeatBasedAdjustmentLedgerEntry>;
1502
+ name?: string;
1503
+ /**
1504
+ * This field's availability is dependent on your client's configuration.
1505
+ */
1506
+ netsuite_sales_order_id?: string;
1507
+ /**
1508
+ * If multiple credits or commits are applicable, the one with the lower priority
1509
+ * will apply first.
1510
+ */
1511
+ priority?: number;
1512
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
1513
+ /**
1514
+ * This field's availability is dependent on your client's configuration.
1515
+ */
1516
+ salesforce_opportunity_id?: string;
1517
+ /**
1518
+ * List of filters that determine what kind of customer usage draws down a commit
1519
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1520
+ * specifiers to contribute to a commit's or credit's drawdown.
1521
+ */
1522
+ specifiers?: Array<CommitSpecifier>;
1523
+ /**
1524
+ * Prevents the creation of duplicates. If a request to create a commit or credit
1525
+ * is made with a uniqueness key that was previously used to create a commit or
1526
+ * credit, a new record will not be created and the request will fail with a 409
1527
+ * error.
1528
+ */
1529
+ uniqueness_key?: string;
1530
+ }
1531
+ export declare namespace Credit {
1532
+ interface Product {
1533
+ id: string;
1534
+ name: string;
1535
+ }
1536
+ interface Contract {
1537
+ id: string;
1538
+ }
1539
+ interface CreditSegmentStartLedgerEntry {
1540
+ amount: number;
1541
+ segment_id: string;
1542
+ timestamp: string;
1543
+ type: 'CREDIT_SEGMENT_START';
1544
+ }
1545
+ interface CreditAutomatedInvoiceDeductionLedgerEntry {
1546
+ amount: number;
1547
+ invoice_id: string;
1548
+ segment_id: string;
1549
+ timestamp: string;
1550
+ type: 'CREDIT_AUTOMATED_INVOICE_DEDUCTION';
1551
+ contract_id?: string;
1552
+ }
1553
+ interface CreditExpirationLedgerEntry {
1554
+ amount: number;
1555
+ segment_id: string;
1556
+ timestamp: string;
1557
+ type: 'CREDIT_EXPIRATION';
1558
+ }
1559
+ interface CreditCanceledLedgerEntry {
1560
+ amount: number;
1561
+ invoice_id: string;
1562
+ segment_id: string;
1563
+ timestamp: string;
1564
+ type: 'CREDIT_CANCELED';
1565
+ contract_id?: string;
1566
+ }
1567
+ interface CreditCreditedLedgerEntry {
1568
+ amount: number;
1569
+ invoice_id: string;
1570
+ segment_id: string;
1571
+ timestamp: string;
1572
+ type: 'CREDIT_CREDITED';
1573
+ contract_id?: string;
1574
+ }
1575
+ interface CreditManualLedgerEntry {
1576
+ amount: number;
1577
+ reason: string;
1578
+ timestamp: string;
1579
+ type: 'CREDIT_MANUAL';
1580
+ }
1581
+ interface CreditSeatBasedAdjustmentLedgerEntry {
1582
+ amount: number;
1583
+ segment_id: string;
1584
+ timestamp: string;
1585
+ type: 'CREDIT_SEAT_BASED_ADJUSTMENT';
1586
+ }
1587
+ }
1588
+ export interface CreditTypeData {
1589
+ id: string;
1590
+ name: string;
1591
+ }
1592
+ export interface Discount {
1593
+ id: string;
1594
+ product: Discount.Product;
1595
+ schedule: SchedulePointInTime;
1596
+ /**
1597
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1598
+ */
1599
+ custom_fields?: {
1600
+ [key: string]: string;
1601
+ };
1602
+ name?: string;
1603
+ /**
1604
+ * This field's availability is dependent on your client's configuration.
1605
+ */
1606
+ netsuite_sales_order_id?: string;
1607
+ }
1608
+ export declare namespace Discount {
1609
+ interface Product {
1610
+ id: string;
1611
+ name: string;
1612
+ }
1613
+ }
1614
+ /**
1615
+ * An optional filtering rule to match the 'event_type' property of an event.
1616
+ */
1617
+ export interface EventTypeFilter {
1618
+ /**
1619
+ * A list of event types that are explicitly included in the billable metric. If
1620
+ * specified, only events of these types will match the billable metric. Must be
1621
+ * non-empty if present.
1622
+ */
1623
+ in_values?: Array<string>;
1624
+ /**
1625
+ * A list of event types that are explicitly excluded from the billable metric. If
1626
+ * specified, events of these types will not match the billable metric. Must be
1627
+ * non-empty if present.
1628
+ */
1629
+ not_in_values?: Array<string>;
1630
+ }
1631
+ /**
1632
+ * Either a **parent** configuration with a list of children or a **child**
1633
+ * configuration with a single parent.
1634
+ */
1635
+ export type HierarchyConfiguration = HierarchyConfiguration.ParentHierarchyConfiguration | HierarchyConfiguration.ChildHierarchyConfiguration;
1636
+ export declare namespace HierarchyConfiguration {
1637
+ interface ParentHierarchyConfiguration {
1638
+ /**
1639
+ * List of contracts that belong to this parent.
1640
+ */
1641
+ children: Array<ParentHierarchyConfiguration.Child>;
1642
+ }
1643
+ namespace ParentHierarchyConfiguration {
1644
+ interface Child {
1645
+ contract_id: string;
1646
+ customer_id: string;
1647
+ }
1648
+ }
1649
+ interface ChildHierarchyConfiguration {
1650
+ /**
1651
+ * The single parent contract/customer for this child.
1652
+ */
1653
+ parent: ChildHierarchyConfiguration.Parent;
1654
+ }
1655
+ namespace ChildHierarchyConfiguration {
1656
+ /**
1657
+ * The single parent contract/customer for this child.
1658
+ */
1659
+ interface Parent {
1660
+ contract_id: string;
1661
+ customer_id: string;
1662
+ }
1663
+ }
1664
+ }
1665
+ export interface ID {
1666
+ id: string;
1667
+ }
1668
+ export interface Override {
1669
+ id: string;
1670
+ starting_at: string;
1671
+ applicable_product_tags?: Array<string>;
1672
+ credit_type?: CreditTypeData;
1673
+ ending_before?: string;
1674
+ entitled?: boolean;
1675
+ is_commit_specific?: boolean;
1676
+ /**
1677
+ * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
1678
+ * set to true.
1679
+ */
1680
+ is_prorated?: boolean;
1681
+ multiplier?: number;
1682
+ override_specifiers?: Array<Override.OverrideSpecifier>;
1683
+ override_tiers?: Array<OverrideTier>;
1684
+ overwrite_rate?: OverwriteRate;
1685
+ /**
1686
+ * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
1687
+ * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
1688
+ */
1689
+ price?: number;
1690
+ priority?: number;
1691
+ product?: Override.Product;
1692
+ /**
1693
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
1694
+ */
1695
+ quantity?: number;
1696
+ rate_type?: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
1697
+ target?: 'COMMIT_RATE' | 'LIST_RATE';
1698
+ /**
1699
+ * Only set for TIERED rate_type.
1700
+ */
1701
+ tiers?: Array<Tier>;
1702
+ type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
1703
+ /**
1704
+ * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1705
+ * processors.
1706
+ */
1707
+ value?: {
1708
+ [key: string]: unknown;
1709
+ };
1710
+ }
1711
+ export declare namespace Override {
1712
+ interface OverrideSpecifier {
1713
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1714
+ commit_ids?: Array<string>;
1715
+ presentation_group_values?: {
1716
+ [key: string]: string | null;
1717
+ };
1718
+ pricing_group_values?: {
1719
+ [key: string]: string;
1720
+ };
1721
+ product_id?: string;
1722
+ product_tags?: Array<string>;
1723
+ recurring_commit_ids?: Array<string>;
1724
+ recurring_credit_ids?: Array<string>;
1725
+ }
1726
+ interface Product {
1727
+ id: string;
1728
+ name: string;
1729
+ }
1730
+ }
1731
+ export interface OverrideTier {
1732
+ multiplier: number;
1733
+ size?: number;
1734
+ }
1735
+ export interface OverwriteRate {
1736
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
1737
+ credit_type?: CreditTypeData;
1738
+ /**
1739
+ * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1740
+ * processors.
1741
+ */
1742
+ custom_rate?: {
1743
+ [key: string]: unknown;
1744
+ };
1745
+ /**
1746
+ * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
1747
+ * set to true.
1748
+ */
1749
+ is_prorated?: boolean;
1750
+ /**
1751
+ * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
1752
+ * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
1753
+ */
1754
+ price?: number;
1755
+ /**
1756
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
1757
+ */
1758
+ quantity?: number;
1759
+ /**
1760
+ * Only set for TIERED rate_type.
1761
+ */
1762
+ tiers?: Array<Tier>;
1763
+ }
1764
+ export interface PaymentGateConfig {
1765
+ /**
1766
+ * Gate access to the commit balance based on successful collection of payment.
1767
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1768
+ * facilitate payment using your own payment integration. Select NONE if you do not
1769
+ * wish to payment gate the commit balance.
1770
+ */
1771
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1772
+ /**
1773
+ * Only applicable if using PRECALCULATED as your tax type.
1774
+ */
1775
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1776
+ /**
1777
+ * Only applicable if using STRIPE as your payment gate type.
1778
+ */
1779
+ stripe_config?: PaymentGateConfig.StripeConfig;
1780
+ /**
1781
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1782
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1783
+ * will default to NONE.
1784
+ */
1785
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1786
+ }
1787
+ export declare namespace PaymentGateConfig {
1788
+ /**
1789
+ * Only applicable if using PRECALCULATED as your tax type.
1790
+ */
1791
+ interface PrecalculatedTaxConfig {
1792
+ /**
1793
+ * Amount of tax to be applied. This should be in the same currency and
1794
+ * denomination as the commit's invoice schedule
1795
+ */
1796
+ tax_amount: number;
1797
+ /**
1798
+ * Name of the tax to be applied. This may be used in an invoice line item
1799
+ * description.
1800
+ */
1801
+ tax_name?: string;
1802
+ }
1803
+ /**
1804
+ * Only applicable if using STRIPE as your payment gate type.
1805
+ */
1806
+ interface StripeConfig {
1807
+ /**
1808
+ * If left blank, will default to INVOICE
1809
+ */
1810
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1811
+ /**
1812
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1813
+ * your payment type.
1814
+ */
1815
+ invoice_metadata?: {
1816
+ [key: string]: string;
1817
+ };
1818
+ }
1819
+ }
1820
+ export interface PaymentGateConfigV2 {
1821
+ /**
1822
+ * Gate access to the commit balance based on successful collection of payment.
1823
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1824
+ * facilitate payment using your own payment integration. Select NONE if you do not
1825
+ * wish to payment gate the commit balance.
1826
+ */
1827
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1828
+ /**
1829
+ * Only applicable if using PRECALCULATED as your tax type.
1830
+ */
1831
+ precalculated_tax_config?: PaymentGateConfigV2.PrecalculatedTaxConfig;
1832
+ /**
1833
+ * Only applicable if using STRIPE as your payment gateway type.
1834
+ */
1835
+ stripe_config?: PaymentGateConfigV2.StripeConfig;
1836
+ /**
1837
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1838
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1839
+ * will default to NONE.
1840
+ */
1841
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1842
+ }
1843
+ export declare namespace PaymentGateConfigV2 {
1844
+ /**
1845
+ * Only applicable if using PRECALCULATED as your tax type.
1846
+ */
1847
+ interface PrecalculatedTaxConfig {
1848
+ /**
1849
+ * Amount of tax to be applied. This should be in the same currency and
1850
+ * denomination as the commit's invoice schedule
1851
+ */
1852
+ tax_amount: number;
1853
+ /**
1854
+ * Name of the tax to be applied. This may be used in an invoice line item
1855
+ * description.
1856
+ */
1857
+ tax_name?: string;
1858
+ }
1859
+ /**
1860
+ * Only applicable if using STRIPE as your payment gateway type.
1861
+ */
1862
+ interface StripeConfig {
1863
+ /**
1864
+ * If left blank, will default to INVOICE
1865
+ */
1866
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1867
+ /**
1868
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1869
+ * your payment type.
1870
+ */
1871
+ invoice_metadata?: {
1872
+ [key: string]: string;
1873
+ };
1874
+ }
1875
+ }
1876
+ export interface PrepaidBalanceThresholdConfiguration {
1877
+ commit: PrepaidBalanceThresholdConfiguration.Commit;
1878
+ /**
1879
+ * When set to false, the contract will not be evaluated against the
1880
+ * threshold_amount. Toggling to true will result an immediate evaluation,
1881
+ * regardless of prior state.
1882
+ */
1883
+ is_enabled: boolean;
1884
+ payment_gate_config: PaymentGateConfig;
1885
+ /**
1886
+ * Specify the amount the balance should be recharged to.
1887
+ */
1888
+ recharge_to_amount: number;
1889
+ /**
1890
+ * Specify the threshold amount for the contract. Each time the contract's prepaid
1891
+ * balance lowers to this amount, a threshold charge will be initiated.
1892
+ */
1893
+ threshold_amount: number;
1894
+ /**
1895
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
1896
+ * commit amount will be in terms of this credit type instead of the fiat currency.
1897
+ */
1898
+ custom_credit_type_id?: string;
1899
+ }
1900
+ export declare namespace PrepaidBalanceThresholdConfiguration {
1901
+ interface Commit extends Shared.BaseThresholdCommit {
1902
+ /**
1903
+ * Which products the threshold commit applies to. If applicable_product_ids,
1904
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1905
+ * all products.
1906
+ */
1907
+ applicable_product_ids?: Array<string>;
1908
+ /**
1909
+ * Which tags the threshold commit applies to. If applicable_product_ids,
1910
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1911
+ * all products.
1912
+ */
1913
+ applicable_product_tags?: Array<string>;
1914
+ /**
1915
+ * List of filters that determine what kind of customer usage draws down a commit
1916
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1917
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1918
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1919
+ */
1920
+ specifiers?: Array<Shared.CommitSpecifierInput>;
1921
+ }
1922
+ }
1923
+ export interface PrepaidBalanceThresholdConfigurationV2 {
1924
+ commit: PrepaidBalanceThresholdConfigurationV2.Commit;
1925
+ /**
1926
+ * When set to false, the contract will not be evaluated against the
1927
+ * threshold_amount. Toggling to true will result an immediate evaluation,
1928
+ * regardless of prior state.
1929
+ */
1930
+ is_enabled: boolean;
1931
+ payment_gate_config: PaymentGateConfigV2;
1932
+ /**
1933
+ * Specify the amount the balance should be recharged to.
1934
+ */
1935
+ recharge_to_amount: number;
1936
+ /**
1937
+ * Specify the threshold amount for the contract. Each time the contract's balance
1938
+ * lowers to this amount, a threshold charge will be initiated.
1939
+ */
1940
+ threshold_amount: number;
1941
+ /**
1942
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
1943
+ * commit amount will be in terms of this credit type instead of the fiat currency.
1944
+ */
1945
+ custom_credit_type_id?: string;
1946
+ }
1947
+ export declare namespace PrepaidBalanceThresholdConfigurationV2 {
1948
+ interface Commit extends Shared.UpdateBaseThresholdCommit {
1949
+ /**
1950
+ * Which products the threshold commit applies to. If applicable_product_ids,
1951
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1952
+ * all products.
1953
+ */
1954
+ applicable_product_ids?: Array<string>;
1955
+ /**
1956
+ * Which tags the threshold commit applies to. If applicable_product_ids,
1957
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1958
+ * all products.
1959
+ */
1960
+ applicable_product_tags?: Array<string>;
1961
+ /**
1962
+ * List of filters that determine what kind of customer usage draws down a commit
1963
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1964
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1965
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1966
+ * Instead, to target usage by product or product tag, pass those values in the
1967
+ * body of `specifiers`.
1968
+ */
1969
+ specifiers?: Array<Shared.CommitSpecifierInput>;
1970
+ }
1971
+ }
1972
+ export interface PropertyFilter {
1973
+ /**
1974
+ * The name of the event property.
1975
+ */
1976
+ name: string;
1977
+ /**
1978
+ * Determines whether the property must exist in the event. If true, only events
1979
+ * with this property will pass the filter. If false, only events without this
1980
+ * property will pass the filter. If null or omitted, the existence of the property
1981
+ * is optional.
1982
+ */
1983
+ exists?: boolean;
1984
+ /**
1985
+ * Specifies the allowed values for the property to match an event. An event will
1986
+ * pass the filter only if its property value is included in this list. If
1987
+ * undefined, all property values will pass the filter. Must be non-empty if
1988
+ * present.
1989
+ */
1990
+ in_values?: Array<string>;
1991
+ /**
1992
+ * Specifies the values that prevent an event from matching the filter. An event
1993
+ * will not pass the filter if its property value is included in this list. If null
1994
+ * or empty, all property values will pass the filter. Must be non-empty if
1995
+ * present.
1996
+ */
1997
+ not_in_values?: Array<string>;
1998
+ }
1999
+ export interface ProService {
2000
+ id: string;
2001
+ /**
2002
+ * Maximum amount for the term.
2003
+ */
2004
+ max_amount: number;
2005
+ product_id: string;
2006
+ /**
2007
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
2008
+ * amount.
2009
+ */
2010
+ quantity: number;
2011
+ /**
2012
+ * Unit price for the charge. Will be multiplied by quantity to determine the
2013
+ * amount and must be specified.
2014
+ */
2015
+ unit_price: number;
2016
+ /**
2017
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2018
+ */
2019
+ custom_fields?: {
2020
+ [key: string]: string;
2021
+ };
2022
+ description?: string;
2023
+ /**
2024
+ * This field's availability is dependent on your client's configuration.
2025
+ */
2026
+ netsuite_sales_order_id?: string;
2027
+ }
2028
+ export interface Rate {
2029
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'CUSTOM' | 'TIERED';
2030
+ credit_type?: CreditTypeData;
2031
+ /**
2032
+ * Only set for CUSTOM rate_type. This field is interpreted by custom rate
2033
+ * processors.
2034
+ */
2035
+ custom_rate?: {
2036
+ [key: string]: unknown;
2037
+ };
2038
+ /**
2039
+ * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
2040
+ * set to true.
2041
+ */
2042
+ is_prorated?: boolean;
2043
+ /**
2044
+ * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
2045
+ * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
2046
+ */
2047
+ price?: number;
2048
+ /**
2049
+ * if pricing groups are used, this will contain the values used to calculate the
2050
+ * price
2051
+ */
2052
+ pricing_group_values?: {
2053
+ [key: string]: string;
2054
+ };
2055
+ /**
2056
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
2057
+ */
2058
+ quantity?: number;
2059
+ /**
2060
+ * Only set for TIERED rate_type.
2061
+ */
2062
+ tiers?: Array<Tier>;
2063
+ /**
2064
+ * Only set for PERCENTAGE rate_type. Defaults to false. If true, rate is computed
2065
+ * using list prices rather than the standard rates for this product on the
2066
+ * contract.
2067
+ */
2068
+ use_list_prices?: boolean;
2069
+ }
2070
+ export interface RecurringCommitSubscriptionConfig {
2071
+ allocation: 'INDIVIDUAL' | 'POOLED';
2072
+ apply_seat_increase_config: RecurringCommitSubscriptionConfig.ApplySeatIncreaseConfig;
2073
+ subscription_id: string;
2074
+ }
2075
+ export declare namespace RecurringCommitSubscriptionConfig {
2076
+ interface ApplySeatIncreaseConfig {
2077
+ /**
2078
+ * Indicates whether a mid-period seat increase should be prorated.
2079
+ */
2080
+ is_prorated: boolean;
2081
+ }
2082
+ }
2083
+ export interface ScheduledCharge {
2084
+ id: string;
2085
+ product: ScheduledCharge.Product;
2086
+ schedule: SchedulePointInTime;
2087
+ archived_at?: string;
2088
+ /**
2089
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2090
+ */
2091
+ custom_fields?: {
2092
+ [key: string]: string;
2093
+ };
2094
+ /**
2095
+ * displayed on invoices
2096
+ */
2097
+ name?: string;
2098
+ /**
2099
+ * This field's availability is dependent on your client's configuration.
2100
+ */
2101
+ netsuite_sales_order_id?: string;
2102
+ }
2103
+ export declare namespace ScheduledCharge {
2104
+ interface Product {
2105
+ id: string;
2106
+ name: string;
2107
+ }
2108
+ }
2109
+ export interface ScheduleDuration {
2110
+ schedule_items: Array<ScheduleDuration.ScheduleItem>;
2111
+ credit_type?: CreditTypeData;
2112
+ }
2113
+ export declare namespace ScheduleDuration {
2114
+ interface ScheduleItem {
2115
+ id: string;
2116
+ amount: number;
2117
+ ending_before: string;
2118
+ starting_at: string;
2119
+ }
2120
+ }
2121
+ export interface SchedulePointInTime {
2122
+ credit_type?: CreditTypeData;
2123
+ /**
2124
+ * This field is only applicable to commit invoice schedules. If true, this
2125
+ * schedule will not generate an invoice.
2126
+ */
2127
+ do_not_invoice?: boolean;
2128
+ schedule_items?: Array<SchedulePointInTime.ScheduleItem>;
2129
+ }
2130
+ export declare namespace SchedulePointInTime {
2131
+ interface ScheduleItem {
2132
+ id: string;
2133
+ amount: number;
2134
+ quantity: number;
2135
+ timestamp: string;
2136
+ unit_price: number;
2137
+ invoice_id?: string | null;
2138
+ }
2139
+ }
2140
+ export interface SpendThresholdConfiguration {
2141
+ commit: BaseThresholdCommit;
2142
+ /**
2143
+ * When set to false, the contract will not be evaluated against the
2144
+ * threshold_amount. Toggling to true will result an immediate evaluation,
2145
+ * regardless of prior state.
2146
+ */
2147
+ is_enabled: boolean;
2148
+ payment_gate_config: PaymentGateConfig;
2149
+ /**
2150
+ * Specify the threshold amount for the contract. Each time the contract's usage
2151
+ * hits this amount, a threshold charge will be initiated.
2152
+ */
2153
+ threshold_amount: number;
2154
+ }
2155
+ export interface SpendThresholdConfigurationV2 {
2156
+ commit: UpdateBaseThresholdCommit;
2157
+ /**
2158
+ * When set to false, the contract will not be evaluated against the
2159
+ * threshold_amount. Toggling to true will result an immediate evaluation,
2160
+ * regardless of prior state.
2161
+ */
2162
+ is_enabled: boolean;
2163
+ payment_gate_config: PaymentGateConfigV2;
2164
+ /**
2165
+ * Specify the threshold amount for the contract. Each time the contract's usage
2166
+ * hits this amount, a threshold charge will be initiated.
2167
+ */
2168
+ threshold_amount: number;
2169
+ }
2170
+ export interface Subscription {
2171
+ collection_schedule: 'ADVANCE' | 'ARREARS';
2172
+ proration: Subscription.Proration;
2173
+ /**
2174
+ * Determines how the subscription's quantity is controlled. Defaults to
2175
+ * QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
2176
+ * directly on the subscription. `initial_quantity` must be provided with this
2177
+ * option. Compatible with recurring commits/credits that use POOLED allocation.
2178
+ */
2179
+ quantity_management_mode: 'SEAT_BASED' | 'QUANTITY_ONLY';
2180
+ /**
2181
+ * List of quantity schedule items for the subscription. Only includes the current
2182
+ * quantity and future quantity changes.
2183
+ */
2184
+ quantity_schedule: Array<Subscription.QuantitySchedule>;
2185
+ starting_at: string;
2186
+ subscription_rate: Subscription.SubscriptionRate;
2187
+ id?: string;
2188
+ /**
2189
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2190
+ */
2191
+ custom_fields?: {
2192
+ [key: string]: string;
2193
+ };
2194
+ description?: string;
2195
+ ending_before?: string;
2196
+ fiat_credit_type_id?: string;
2197
+ name?: string;
2198
+ }
2199
+ export declare namespace Subscription {
2200
+ interface Proration {
2201
+ invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
2202
+ is_prorated: boolean;
2203
+ }
2204
+ interface QuantitySchedule {
2205
+ quantity: number;
2206
+ starting_at: string;
2207
+ ending_before?: string;
2208
+ }
2209
+ interface SubscriptionRate {
2210
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2211
+ product: SubscriptionRate.Product;
2212
+ }
2213
+ namespace SubscriptionRate {
2214
+ interface Product {
2215
+ id: string;
2216
+ name: string;
2217
+ }
2218
+ }
2219
+ }
2220
+ export interface Tier {
2221
+ price: number;
2222
+ size?: number;
2223
+ }
2224
+ export interface UpdateBaseThresholdCommit {
2225
+ description?: string;
2226
+ /**
2227
+ * Specify the name of the line item for the threshold charge. If left blank, it
2228
+ * will default to the commit product name.
2229
+ */
2230
+ name?: string;
2231
+ /**
2232
+ * The commit product that will be used to generate the line item for commit
2233
+ * payment.
2234
+ */
2235
+ product_id?: string;
2236
+ }
2237
+ export type CommitsBodyCursorPage = BodyCursorPage<Commit>;
2238
+ export type CreditsBodyCursorPage = BodyCursorPage<Credit>;
2239
+ //# sourceMappingURL=shared.d.mts.map