@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,2794 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import * as Shared from "../shared.mjs";
3
+ import { APIPromise } from "../../core/api-promise.mjs";
4
+ import { RequestOptions } from "../../internal/request-options.mjs";
5
+ export declare class Contracts extends APIResource {
6
+ /**
7
+ * Gets the details for a specific contract, including contract term, rate card
8
+ * information, credits and commits, and more.
9
+ *
10
+ * ### Use this endpoint to:
11
+ *
12
+ * - Check the duration of a customer's current contract
13
+ * - Get details on contract terms, including access schedule amounts for
14
+ * commitments and credits
15
+ * - Understand the state of a contract at a past time. As you can evolve the terms
16
+ * of a contract over time through editing, use the `as_of_date` parameter to
17
+ * view the full contract configuration as of that point in time.
18
+ *
19
+ * ### Usage guidelines:
20
+ *
21
+ * - Optionally, use the `include_balance` and `include_ledger` fields to include
22
+ * balances and ledgers in the credit and commit responses. Using these fields
23
+ * will cause the query to be slower.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const contract = await client.v2.contracts.retrieve({
28
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
29
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
30
+ * });
31
+ * ```
32
+ */
33
+ retrieve(body: ContractRetrieveParams, options?: RequestOptions): APIPromise<ContractRetrieveResponse>;
34
+ /**
35
+ * For a given customer, lists all of their contracts in chronological order.
36
+ *
37
+ * ### Use this endpoint to:
38
+ *
39
+ * - Check if a customer is provisioned with any contract, and at which tier
40
+ * - Check the duration and terms of a customer's current contract
41
+ * - Power a page in your end customer experience that shows the customer's history
42
+ * of tiers (e.g. this customer started out on the Pro Plan, then downgraded to
43
+ * the Starter plan).
44
+ *
45
+ * ### Usage guidelines:
46
+ *
47
+ * Use the `starting_at`, `covering_date`, and `include_archived` parameters to
48
+ * filter the list of returned contracts. For example, to list only currently
49
+ * active contracts, pass `covering_date` equal to the current time.
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * const contracts = await client.v2.contracts.list({
54
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
55
+ * });
56
+ * ```
57
+ */
58
+ list(body: ContractListParams, options?: RequestOptions): APIPromise<ContractListResponse>;
59
+ /**
60
+ * The ability to edit a contract helps you react quickly to the needs of your
61
+ * customers and your business.
62
+ *
63
+ * ### Use this endpoint to:
64
+ *
65
+ * - Encode mid-term commitment and discount changes
66
+ * - Fix configuration mistakes and easily roll back packaging changes
67
+ *
68
+ * ### Key response fields:
69
+ *
70
+ * - The `id` of the edit
71
+ * - Complete edit details. For example, if you edited the contract to add new
72
+ * overrides and credits, you will receive the IDs of those overrides and credits
73
+ * in the response.
74
+ *
75
+ * ### Usage guidelines:
76
+ *
77
+ * - When you edit a contract, any draft invoices update immediately to reflect
78
+ * that edit. Finalized invoices remain unchanged - you must void and regenerate
79
+ * them in the UI or API to reflect the edit.
80
+ * - Contract editing must be enabled to use this endpoint. Reach out to your
81
+ * Metronome representative to learn more.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * const response = await client.v2.contracts.edit({
86
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
87
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
88
+ * add_overrides: [
89
+ * {
90
+ * type: 'MULTIPLIER',
91
+ * starting_at: '2024-11-02T00:00:00Z',
92
+ * product_id: 'd4fc086c-d8e5-4091-a235-fbba5da4ec14',
93
+ * multiplier: 2,
94
+ * priority: 100,
95
+ * },
96
+ * ],
97
+ * add_scheduled_charges: [
98
+ * {
99
+ * product_id: '2e30f074-d04c-412e-a134-851ebfa5ceb2',
100
+ * schedule: {
101
+ * schedule_items: [
102
+ * {
103
+ * timestamp: '2020-02-15T00:00:00.000Z',
104
+ * unit_price: 1000000,
105
+ * quantity: 1,
106
+ * },
107
+ * ],
108
+ * },
109
+ * },
110
+ * ],
111
+ * });
112
+ * ```
113
+ */
114
+ edit(body: ContractEditParams, options?: RequestOptions): APIPromise<ContractEditResponse>;
115
+ /**
116
+ * Edit specific details for a contract-level or customer-level commit. Use this
117
+ * endpoint to modify individual commit access schedules, invoice schedules,
118
+ * applicable products, invoicing contracts, or other fields.
119
+ *
120
+ * ### Usage guidelines:
121
+ *
122
+ * - As with all edits in Metronome, draft invoices will reflect the edit
123
+ * immediately, while finalized invoices are untouched unless voided and
124
+ * regenerated.
125
+ * - If a commit's invoice schedule item is associated with a finalized invoice,
126
+ * you cannot remove or update the invoice schedule item.
127
+ * - If a commit's invoice schedule item is associated with a voided invoice, you
128
+ * cannot remove the invoice schedule item.
129
+ * - You cannot remove an commit access schedule segment that was applied to a
130
+ * finalized invoice. You can void the invoice beforehand and then remove the
131
+ * access schedule segment.
132
+ *
133
+ * @example
134
+ * ```ts
135
+ * const response = await client.v2.contracts.editCommit({
136
+ * commit_id: '5e7e82cf-ccb7-428c-a96f-a8e4f67af822',
137
+ * customer_id: '4c91c473-fc12-445a-9c38-40421d47023f',
138
+ * access_schedule: {
139
+ * update_schedule_items: [
140
+ * {
141
+ * id: 'd5edbd32-c744-48cb-9475-a9bca0e6fa39',
142
+ * ending_before: '2025-03-12T00:00:00Z',
143
+ * },
144
+ * ],
145
+ * },
146
+ * });
147
+ * ```
148
+ */
149
+ editCommit(body: ContractEditCommitParams, options?: RequestOptions): APIPromise<ContractEditCommitResponse>;
150
+ /**
151
+ * Edit details for a contract-level or customer-level credit.
152
+ *
153
+ * ### Use this endpoint to:
154
+ *
155
+ * - Extend the duration or the amount of an existing free credit like a trial
156
+ * - Modify individual credit access schedules, applicable products, priority, or
157
+ * other fields.
158
+ *
159
+ * ### Usage guidelines:
160
+ *
161
+ * - As with all edits in Metronome, draft invoices will reflect the edit
162
+ * immediately, while finalized invoices are untouched unless voided and
163
+ * regenerated.
164
+ * - You cannot remove an access schedule segment that was applied to a finalized
165
+ * invoice. You can void the invoice beforehand and then remove the access
166
+ * schedule segment.
167
+ *
168
+ * @example
169
+ * ```ts
170
+ * const response = await client.v2.contracts.editCredit({
171
+ * credit_id: '5e7e82cf-ccb7-428c-a96f-a8e4f67af822',
172
+ * customer_id: '4c91c473-fc12-445a-9c38-40421d47023f',
173
+ * access_schedule: {
174
+ * update_schedule_items: [
175
+ * {
176
+ * id: 'd5edbd32-c744-48cb-9475-a9bca0e6fa39',
177
+ * ending_before: '2025-03-12T00:00:00Z',
178
+ * },
179
+ * ],
180
+ * },
181
+ * });
182
+ * ```
183
+ */
184
+ editCredit(body: ContractEditCreditParams, options?: RequestOptions): APIPromise<ContractEditCreditResponse>;
185
+ /**
186
+ * List all the edits made to a contract over time. In Metronome, you can edit a
187
+ * contract at any point after it's created to fix mistakes or reflect changes in
188
+ * terms. Metronome stores a full history of all edits that were ever made to a
189
+ * contract, whether through the UI, `editContract` endpoint, or other endpoints
190
+ * like `updateContractEndDate`.
191
+ *
192
+ * ### Use this endpoint to:
193
+ *
194
+ * - Understand what changes were made to a contract, when, and by who
195
+ *
196
+ * ### Key response fields:
197
+ *
198
+ * - An array of every edit ever made to the contract
199
+ * - Details on each individual edit - for example showing that in one edit, a user
200
+ * added two discounts and incremented a subscription quantity.
201
+ *
202
+ * @example
203
+ * ```ts
204
+ * const response = await client.v2.contracts.getEditHistory({
205
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
206
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
207
+ * });
208
+ * ```
209
+ */
210
+ getEditHistory(body: ContractGetEditHistoryParams, options?: RequestOptions): APIPromise<ContractGetEditHistoryResponse>;
211
+ }
212
+ export interface ContractRetrieveResponse {
213
+ data: Shared.ContractV2;
214
+ }
215
+ export interface ContractListResponse {
216
+ data: Array<Shared.ContractV2>;
217
+ }
218
+ export interface ContractEditResponse {
219
+ data: Shared.ID;
220
+ }
221
+ export interface ContractEditCommitResponse {
222
+ data: Shared.ID;
223
+ }
224
+ export interface ContractEditCreditResponse {
225
+ data: Shared.ID;
226
+ }
227
+ export interface ContractGetEditHistoryResponse {
228
+ data: Array<ContractGetEditHistoryResponse.Data>;
229
+ }
230
+ export declare namespace ContractGetEditHistoryResponse {
231
+ interface Data {
232
+ id: string;
233
+ add_commits?: Array<Data.AddCommit>;
234
+ add_credits?: Array<Data.AddCredit>;
235
+ add_discounts?: Array<Shared.Discount>;
236
+ add_overrides?: Array<Data.AddOverride>;
237
+ add_prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfigurationV2;
238
+ add_pro_services?: Array<Shared.ProService>;
239
+ add_recurring_commits?: Array<Data.AddRecurringCommit>;
240
+ add_recurring_credits?: Array<Data.AddRecurringCredit>;
241
+ add_reseller_royalties?: Array<Data.AddResellerRoyalty>;
242
+ add_scheduled_charges?: Array<Data.AddScheduledCharge>;
243
+ add_spend_threshold_configuration?: Shared.SpendThresholdConfigurationV2;
244
+ /**
245
+ * List of subscriptions on the contract.
246
+ */
247
+ add_subscriptions?: Array<Shared.Subscription>;
248
+ add_usage_filters?: Array<Data.AddUsageFilter>;
249
+ archive_commits?: Array<Data.ArchiveCommit>;
250
+ archive_credits?: Array<Data.ArchiveCredit>;
251
+ archive_scheduled_charges?: Array<Data.ArchiveScheduledCharge>;
252
+ remove_overrides?: Array<Data.RemoveOverride>;
253
+ timestamp?: string;
254
+ /**
255
+ * Prevents the creation of duplicates. If a request to create a record is made
256
+ * with a previously used uniqueness key, a new record will not be created and the
257
+ * request will fail with a 409 error.
258
+ */
259
+ uniqueness_key?: string;
260
+ update_commits?: Array<Data.UpdateCommit>;
261
+ update_contract_end_date?: string;
262
+ /**
263
+ * Value to update the contract name to. If not provided, the contract name will
264
+ * remain unchanged.
265
+ */
266
+ update_contract_name?: string | null;
267
+ update_credits?: Array<Data.UpdateCredit>;
268
+ update_discounts?: Array<Data.UpdateDiscount>;
269
+ update_prepaid_balance_threshold_configuration?: Data.UpdatePrepaidBalanceThresholdConfiguration;
270
+ update_recurring_commits?: Array<Data.UpdateRecurringCommit>;
271
+ update_recurring_credits?: Array<Data.UpdateRecurringCredit>;
272
+ update_refund_invoices?: Array<Data.UpdateRefundInvoice>;
273
+ update_scheduled_charges?: Array<Data.UpdateScheduledCharge>;
274
+ update_spend_threshold_configuration?: Data.UpdateSpendThresholdConfiguration;
275
+ /**
276
+ * Optional list of subscriptions to update.
277
+ */
278
+ update_subscriptions?: Array<Data.UpdateSubscription>;
279
+ }
280
+ namespace Data {
281
+ interface AddCommit {
282
+ id: string;
283
+ product: AddCommit.Product;
284
+ type: 'PREPAID' | 'POSTPAID';
285
+ /**
286
+ * The schedule that the customer will gain access to the credits purposed with
287
+ * this commit.
288
+ */
289
+ access_schedule?: Shared.ScheduleDuration;
290
+ applicable_product_ids?: Array<string>;
291
+ applicable_product_tags?: Array<string>;
292
+ description?: string;
293
+ /**
294
+ * Optional configuration for commit hierarchy access control
295
+ */
296
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
297
+ /**
298
+ * The schedule that the customer will be invoiced for this commit.
299
+ */
300
+ invoice_schedule?: Shared.SchedulePointInTime;
301
+ name?: string;
302
+ /**
303
+ * This field's availability is dependent on your client's configuration.
304
+ */
305
+ netsuite_sales_order_id?: string;
306
+ /**
307
+ * If multiple credits or commits are applicable, the one with the lower priority
308
+ * will apply first.
309
+ */
310
+ priority?: number;
311
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
312
+ rollover_fraction?: number;
313
+ /**
314
+ * This field's availability is dependent on your client's configuration.
315
+ */
316
+ salesforce_opportunity_id?: string;
317
+ /**
318
+ * List of filters that determine what kind of customer usage draws down a commit
319
+ * or credit. A customer's usage needs to meet the condition of at least one of the
320
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
321
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
322
+ * Instead, to target usage by product or product tag, pass those values in the
323
+ * body of `specifiers`.
324
+ */
325
+ specifiers?: Array<Shared.CommitSpecifierInput>;
326
+ }
327
+ namespace AddCommit {
328
+ interface Product {
329
+ id: string;
330
+ name: string;
331
+ }
332
+ }
333
+ interface AddCredit {
334
+ id: string;
335
+ product: AddCredit.Product;
336
+ type: 'CREDIT';
337
+ /**
338
+ * The schedule that the customer will gain access to the credits.
339
+ */
340
+ access_schedule?: Shared.ScheduleDuration;
341
+ applicable_product_ids?: Array<string>;
342
+ applicable_product_tags?: Array<string>;
343
+ description?: string;
344
+ /**
345
+ * Optional configuration for recurring credit hierarchy access control
346
+ */
347
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
348
+ name?: string;
349
+ /**
350
+ * This field's availability is dependent on your client's configuration.
351
+ */
352
+ netsuite_sales_order_id?: string;
353
+ /**
354
+ * If multiple credits or commits are applicable, the one with the lower priority
355
+ * will apply first.
356
+ */
357
+ priority?: number;
358
+ /**
359
+ * This field's availability is dependent on your client's configuration.
360
+ */
361
+ salesforce_opportunity_id?: string;
362
+ /**
363
+ * List of filters that determine what kind of customer usage draws down a commit
364
+ * or credit. A customer's usage needs to meet the condition of at least one of the
365
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
366
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
367
+ * Instead, to target usage by product or product tag, pass those values in the
368
+ * body of `specifiers`.
369
+ */
370
+ specifiers?: Array<Shared.CommitSpecifierInput>;
371
+ }
372
+ namespace AddCredit {
373
+ interface Product {
374
+ id: string;
375
+ name: string;
376
+ }
377
+ }
378
+ interface AddOverride {
379
+ id: string;
380
+ starting_at: string;
381
+ applicable_product_tags?: Array<string>;
382
+ ending_before?: string;
383
+ entitled?: boolean;
384
+ is_commit_specific?: boolean;
385
+ multiplier?: number;
386
+ override_specifiers?: Array<AddOverride.OverrideSpecifier>;
387
+ override_tiers?: Array<Shared.OverrideTier>;
388
+ overwrite_rate?: Shared.OverwriteRate;
389
+ priority?: number;
390
+ product?: AddOverride.Product;
391
+ target?: 'COMMIT_RATE' | 'LIST_RATE';
392
+ type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
393
+ }
394
+ namespace AddOverride {
395
+ interface OverrideSpecifier {
396
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
397
+ commit_ids?: Array<string>;
398
+ presentation_group_values?: {
399
+ [key: string]: string | null;
400
+ };
401
+ pricing_group_values?: {
402
+ [key: string]: string;
403
+ };
404
+ product_id?: string;
405
+ product_tags?: Array<string>;
406
+ recurring_commit_ids?: Array<string>;
407
+ recurring_credit_ids?: Array<string>;
408
+ }
409
+ interface Product {
410
+ id: string;
411
+ name: string;
412
+ }
413
+ }
414
+ interface AddRecurringCommit {
415
+ id: string;
416
+ /**
417
+ * The amount of commit to grant.
418
+ */
419
+ access_amount: AddRecurringCommit.AccessAmount;
420
+ /**
421
+ * The amount of time the created commits will be valid for
422
+ */
423
+ commit_duration: AddRecurringCommit.CommitDuration;
424
+ /**
425
+ * Will be passed down to the individual commits
426
+ */
427
+ priority: number;
428
+ product: AddRecurringCommit.Product;
429
+ /**
430
+ * Whether the created commits will use the commit rate or list rate
431
+ */
432
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
433
+ /**
434
+ * Determines the start time for the first commit
435
+ */
436
+ starting_at: string;
437
+ /**
438
+ * Will be passed down to the individual commits
439
+ */
440
+ applicable_product_ids?: Array<string>;
441
+ /**
442
+ * Will be passed down to the individual commits
443
+ */
444
+ applicable_product_tags?: Array<string>;
445
+ contract?: AddRecurringCommit.Contract;
446
+ /**
447
+ * Will be passed down to the individual commits
448
+ */
449
+ description?: string;
450
+ /**
451
+ * Determines when the contract will stop creating recurring commits. Optional
452
+ */
453
+ ending_before?: string;
454
+ /**
455
+ * Optional configuration for recurring credit hierarchy access control
456
+ */
457
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
458
+ /**
459
+ * The amount the customer should be billed for the commit. Not required.
460
+ */
461
+ invoice_amount?: AddRecurringCommit.InvoiceAmount;
462
+ /**
463
+ * Displayed on invoices. Will be passed through to the individual commits
464
+ */
465
+ name?: string;
466
+ /**
467
+ * Will be passed down to the individual commits
468
+ */
469
+ netsuite_sales_order_id?: string;
470
+ /**
471
+ * Determines whether the first and last commit will be prorated. If not provided,
472
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
473
+ */
474
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
475
+ /**
476
+ * The frequency at which the recurring commits will be created. If not provided: -
477
+ * The commits will be created on the usage invoice frequency. If provided: - The
478
+ * period defined in the duration will correspond to this frequency. - Commits will
479
+ * be created aligned with the recurring commit's starting_at rather than the usage
480
+ * invoice dates.
481
+ */
482
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
483
+ /**
484
+ * Will be passed down to the individual commits. This controls how much of an
485
+ * individual unexpired commit will roll over upon contract transition. Must be
486
+ * between 0 and 1.
487
+ */
488
+ rollover_fraction?: number;
489
+ /**
490
+ * List of filters that determine what kind of customer usage draws down a commit
491
+ * or credit. A customer's usage needs to meet the condition of at least one of the
492
+ * specifiers to contribute to a commit's or credit's drawdown.
493
+ */
494
+ specifiers?: Array<Shared.CommitSpecifier>;
495
+ /**
496
+ * Attach a subscription to the recurring commit/credit.
497
+ */
498
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
499
+ }
500
+ namespace AddRecurringCommit {
501
+ /**
502
+ * The amount of commit to grant.
503
+ */
504
+ interface AccessAmount {
505
+ credit_type_id: string;
506
+ unit_price: number;
507
+ quantity?: number;
508
+ }
509
+ /**
510
+ * The amount of time the created commits will be valid for
511
+ */
512
+ interface CommitDuration {
513
+ value: number;
514
+ unit?: 'PERIODS';
515
+ }
516
+ interface Product {
517
+ id: string;
518
+ name: string;
519
+ }
520
+ interface Contract {
521
+ id: string;
522
+ }
523
+ /**
524
+ * The amount the customer should be billed for the commit. Not required.
525
+ */
526
+ interface InvoiceAmount {
527
+ credit_type_id: string;
528
+ quantity: number;
529
+ unit_price: number;
530
+ }
531
+ }
532
+ interface AddRecurringCredit {
533
+ id: string;
534
+ /**
535
+ * The amount of commit to grant.
536
+ */
537
+ access_amount: AddRecurringCredit.AccessAmount;
538
+ /**
539
+ * The amount of time the created commits will be valid for
540
+ */
541
+ commit_duration: AddRecurringCredit.CommitDuration;
542
+ /**
543
+ * Will be passed down to the individual commits
544
+ */
545
+ priority: number;
546
+ product: AddRecurringCredit.Product;
547
+ /**
548
+ * Whether the created commits will use the commit rate or list rate
549
+ */
550
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
551
+ /**
552
+ * Determines the start time for the first commit
553
+ */
554
+ starting_at: string;
555
+ /**
556
+ * Will be passed down to the individual commits
557
+ */
558
+ applicable_product_ids?: Array<string>;
559
+ /**
560
+ * Will be passed down to the individual commits
561
+ */
562
+ applicable_product_tags?: Array<string>;
563
+ contract?: AddRecurringCredit.Contract;
564
+ /**
565
+ * Will be passed down to the individual commits
566
+ */
567
+ description?: string;
568
+ /**
569
+ * Determines when the contract will stop creating recurring commits. Optional
570
+ */
571
+ ending_before?: string;
572
+ /**
573
+ * Optional configuration for recurring credit hierarchy access control
574
+ */
575
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
576
+ /**
577
+ * Displayed on invoices. Will be passed through to the individual commits
578
+ */
579
+ name?: string;
580
+ /**
581
+ * Will be passed down to the individual commits
582
+ */
583
+ netsuite_sales_order_id?: string;
584
+ /**
585
+ * Determines whether the first and last commit will be prorated. If not provided,
586
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
587
+ */
588
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
589
+ /**
590
+ * The frequency at which the recurring commits will be created. If not provided: -
591
+ * The commits will be created on the usage invoice frequency. If provided: - The
592
+ * period defined in the duration will correspond to this frequency. - Commits will
593
+ * be created aligned with the recurring commit's starting_at rather than the usage
594
+ * invoice dates.
595
+ */
596
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
597
+ /**
598
+ * Will be passed down to the individual commits. This controls how much of an
599
+ * individual unexpired commit will roll over upon contract transition. Must be
600
+ * between 0 and 1.
601
+ */
602
+ rollover_fraction?: number;
603
+ /**
604
+ * List of filters that determine what kind of customer usage draws down a commit
605
+ * or credit. A customer's usage needs to meet the condition of at least one of the
606
+ * specifiers to contribute to a commit's or credit's drawdown.
607
+ */
608
+ specifiers?: Array<Shared.CommitSpecifier>;
609
+ /**
610
+ * Attach a subscription to the recurring commit/credit.
611
+ */
612
+ subscription_config?: Shared.RecurringCommitSubscriptionConfig;
613
+ }
614
+ namespace AddRecurringCredit {
615
+ /**
616
+ * The amount of commit to grant.
617
+ */
618
+ interface AccessAmount {
619
+ credit_type_id: string;
620
+ unit_price: number;
621
+ quantity?: number;
622
+ }
623
+ /**
624
+ * The amount of time the created commits will be valid for
625
+ */
626
+ interface CommitDuration {
627
+ value: number;
628
+ unit?: 'PERIODS';
629
+ }
630
+ interface Product {
631
+ id: string;
632
+ name: string;
633
+ }
634
+ interface Contract {
635
+ id: string;
636
+ }
637
+ }
638
+ interface AddResellerRoyalty {
639
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
640
+ applicable_product_ids?: Array<string>;
641
+ applicable_product_tags?: Array<string>;
642
+ aws_account_number?: string;
643
+ aws_offer_id?: string;
644
+ aws_payer_reference_id?: string;
645
+ ending_before?: string | null;
646
+ fraction?: number;
647
+ gcp_account_id?: string;
648
+ gcp_offer_id?: string;
649
+ netsuite_reseller_id?: string;
650
+ reseller_contract_value?: number;
651
+ starting_at?: string;
652
+ }
653
+ interface AddScheduledCharge {
654
+ id: string;
655
+ product: AddScheduledCharge.Product;
656
+ schedule: Shared.SchedulePointInTime;
657
+ /**
658
+ * displayed on invoices
659
+ */
660
+ name?: string;
661
+ /**
662
+ * This field's availability is dependent on your client's configuration.
663
+ */
664
+ netsuite_sales_order_id?: string;
665
+ }
666
+ namespace AddScheduledCharge {
667
+ interface Product {
668
+ id: string;
669
+ name: string;
670
+ }
671
+ }
672
+ interface AddUsageFilter {
673
+ group_key: string;
674
+ group_values: Array<string>;
675
+ /**
676
+ * This will match contract starting_at value if usage filter is active from the
677
+ * beginning of the contract.
678
+ */
679
+ starting_at: string;
680
+ /**
681
+ * This will match contract ending_before value if usage filter is active until the
682
+ * end of the contract. It will be undefined if the contract is open-ended.
683
+ */
684
+ ending_before?: string;
685
+ }
686
+ interface ArchiveCommit {
687
+ id: string;
688
+ }
689
+ interface ArchiveCredit {
690
+ id: string;
691
+ }
692
+ interface ArchiveScheduledCharge {
693
+ id: string;
694
+ }
695
+ interface RemoveOverride {
696
+ id: string;
697
+ }
698
+ interface UpdateCommit {
699
+ id: string;
700
+ access_schedule?: UpdateCommit.AccessSchedule;
701
+ /**
702
+ * Which products the commit applies to. If applicable_product_ids,
703
+ * applicable_product_tags or specifiers are not provided, the commit applies to
704
+ * all products.
705
+ */
706
+ applicable_product_ids?: Array<string> | null;
707
+ /**
708
+ * Which tags the commit applies to. If applicable_product_ids,
709
+ * applicable_product_tags or specifiers are not provided, the commit applies to
710
+ * all products.
711
+ */
712
+ applicable_product_tags?: Array<string> | null;
713
+ /**
714
+ * Optional configuration for commit hierarchy access control
715
+ */
716
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
717
+ invoice_schedule?: UpdateCommit.InvoiceSchedule;
718
+ name?: string;
719
+ netsuite_sales_order_id?: string | null;
720
+ /**
721
+ * If multiple commits are applicable, the one with the lower priority will apply
722
+ * first.
723
+ */
724
+ priority?: number | null;
725
+ product_id?: string;
726
+ /**
727
+ * If set, the commit's rate type was updated to the specified value.
728
+ */
729
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
730
+ rollover_fraction?: number | null;
731
+ /**
732
+ * List of filters that determine what kind of customer usage draws down a commit
733
+ * or credit. A customer's usage needs to meet the condition of at least one of the
734
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
735
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
736
+ * Instead, to target usage by product or product tag, pass those values in the
737
+ * body of `specifiers`.
738
+ */
739
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
740
+ }
741
+ namespace UpdateCommit {
742
+ interface AccessSchedule {
743
+ add_schedule_items?: Array<AccessSchedule.AddScheduleItem>;
744
+ remove_schedule_items?: Array<AccessSchedule.RemoveScheduleItem>;
745
+ update_schedule_items?: Array<AccessSchedule.UpdateScheduleItem>;
746
+ }
747
+ namespace AccessSchedule {
748
+ interface AddScheduleItem {
749
+ amount: number;
750
+ /**
751
+ * RFC 3339 timestamp (exclusive)
752
+ */
753
+ ending_before: string;
754
+ /**
755
+ * RFC 3339 timestamp (inclusive)
756
+ */
757
+ starting_at: string;
758
+ }
759
+ interface RemoveScheduleItem {
760
+ id: string;
761
+ }
762
+ interface UpdateScheduleItem {
763
+ id: string;
764
+ amount?: number;
765
+ /**
766
+ * RFC 3339 timestamp (exclusive)
767
+ */
768
+ ending_before?: string;
769
+ /**
770
+ * RFC 3339 timestamp (inclusive)
771
+ */
772
+ starting_at?: string;
773
+ }
774
+ }
775
+ interface InvoiceSchedule {
776
+ add_schedule_items?: Array<InvoiceSchedule.AddScheduleItem>;
777
+ remove_schedule_items?: Array<InvoiceSchedule.RemoveScheduleItem>;
778
+ update_schedule_items?: Array<InvoiceSchedule.UpdateScheduleItem>;
779
+ }
780
+ namespace InvoiceSchedule {
781
+ interface AddScheduleItem {
782
+ timestamp: string;
783
+ amount?: number;
784
+ quantity?: number;
785
+ unit_price?: number;
786
+ }
787
+ interface RemoveScheduleItem {
788
+ id: string;
789
+ }
790
+ interface UpdateScheduleItem {
791
+ id: string;
792
+ amount?: number;
793
+ quantity?: number;
794
+ timestamp?: string;
795
+ unit_price?: number;
796
+ }
797
+ }
798
+ }
799
+ interface UpdateCredit {
800
+ id: string;
801
+ access_schedule?: UpdateCredit.AccessSchedule;
802
+ /**
803
+ * Optional configuration for credit hierarchy access control
804
+ */
805
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
806
+ name?: string;
807
+ netsuite_sales_order_id?: string | null;
808
+ /**
809
+ * If multiple credits are applicable, the one with the lower priority will apply
810
+ * first.
811
+ */
812
+ priority?: number | null;
813
+ /**
814
+ * If set, the credit's rate type was updated to the specified value.
815
+ */
816
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
817
+ rollover_fraction?: number | null;
818
+ }
819
+ namespace UpdateCredit {
820
+ interface AccessSchedule {
821
+ add_schedule_items?: Array<AccessSchedule.AddScheduleItem>;
822
+ remove_schedule_items?: Array<AccessSchedule.RemoveScheduleItem>;
823
+ update_schedule_items?: Array<AccessSchedule.UpdateScheduleItem>;
824
+ }
825
+ namespace AccessSchedule {
826
+ interface AddScheduleItem {
827
+ amount: number;
828
+ /**
829
+ * RFC 3339 timestamp (exclusive)
830
+ */
831
+ ending_before: string;
832
+ /**
833
+ * RFC 3339 timestamp (inclusive)
834
+ */
835
+ starting_at: string;
836
+ }
837
+ interface RemoveScheduleItem {
838
+ id: string;
839
+ }
840
+ interface UpdateScheduleItem {
841
+ id: string;
842
+ amount?: number;
843
+ /**
844
+ * RFC 3339 timestamp (exclusive)
845
+ */
846
+ ending_before?: string;
847
+ /**
848
+ * RFC 3339 timestamp (inclusive)
849
+ */
850
+ starting_at?: string;
851
+ }
852
+ }
853
+ }
854
+ interface UpdateDiscount {
855
+ id: string;
856
+ /**
857
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
858
+ */
859
+ custom_fields?: {
860
+ [key: string]: string;
861
+ };
862
+ name?: string;
863
+ netsuite_sales_order_id?: string;
864
+ /**
865
+ * Must provide either schedule_items or recurring_schedule.
866
+ */
867
+ schedule?: UpdateDiscount.Schedule;
868
+ }
869
+ namespace UpdateDiscount {
870
+ /**
871
+ * Must provide either schedule_items or recurring_schedule.
872
+ */
873
+ interface Schedule {
874
+ /**
875
+ * Defaults to USD (cents) if not passed.
876
+ */
877
+ credit_type_id?: string;
878
+ /**
879
+ * This field is only applicable to commit invoice schedules. If true, this
880
+ * schedule will not generate an invoice.
881
+ */
882
+ do_not_invoice?: boolean;
883
+ /**
884
+ * Enter the unit price and quantity for the charge or instead only send the
885
+ * amount. If amount is sent, the unit price is assumed to be the amount and
886
+ * quantity is inferred to be 1.
887
+ */
888
+ recurring_schedule?: Schedule.RecurringSchedule;
889
+ /**
890
+ * Either provide amount or provide both unit_price and quantity.
891
+ */
892
+ schedule_items?: Array<Schedule.ScheduleItem>;
893
+ }
894
+ namespace Schedule {
895
+ /**
896
+ * Enter the unit price and quantity for the charge or instead only send the
897
+ * amount. If amount is sent, the unit price is assumed to be the amount and
898
+ * quantity is inferred to be 1.
899
+ */
900
+ interface RecurringSchedule {
901
+ amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
902
+ /**
903
+ * RFC 3339 timestamp (exclusive).
904
+ */
905
+ ending_before: string;
906
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY';
907
+ /**
908
+ * RFC 3339 timestamp (inclusive).
909
+ */
910
+ starting_at: string;
911
+ /**
912
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
913
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
914
+ * inferred to be 1.
915
+ */
916
+ amount?: number;
917
+ /**
918
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
919
+ * amount and must be specified with unit_price. If specified amount cannot be
920
+ * provided.
921
+ */
922
+ quantity?: number;
923
+ /**
924
+ * Unit price for the charge. Will be multiplied by quantity to determine the
925
+ * amount and must be specified with quantity. If specified amount cannot be
926
+ * provided.
927
+ */
928
+ unit_price?: number;
929
+ }
930
+ interface ScheduleItem {
931
+ /**
932
+ * timestamp of the scheduled event
933
+ */
934
+ timestamp: string;
935
+ /**
936
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
937
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
938
+ * inferred to be 1.
939
+ */
940
+ amount?: number;
941
+ /**
942
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
943
+ * amount and must be specified with unit_price. If specified amount cannot be
944
+ * provided.
945
+ */
946
+ quantity?: number;
947
+ /**
948
+ * Unit price for the charge. Will be multiplied by quantity to determine the
949
+ * amount and must be specified with quantity. If specified amount cannot be
950
+ * provided.
951
+ */
952
+ unit_price?: number;
953
+ }
954
+ }
955
+ }
956
+ interface UpdatePrepaidBalanceThresholdConfiguration {
957
+ commit?: UpdatePrepaidBalanceThresholdConfiguration.Commit;
958
+ /**
959
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
960
+ * commit amount will be in terms of this credit type instead of the fiat currency.
961
+ */
962
+ custom_credit_type_id?: string | null;
963
+ /**
964
+ * When set to false, the contract will not be evaluated against the
965
+ * threshold_amount. Toggling to true will result an immediate evaluation,
966
+ * regardless of prior state.
967
+ */
968
+ is_enabled?: boolean;
969
+ payment_gate_config?: Shared.PaymentGateConfigV2;
970
+ /**
971
+ * Specify the amount the balance should be recharged to.
972
+ */
973
+ recharge_to_amount?: number;
974
+ /**
975
+ * Specify the threshold amount for the contract. Each time the contract's balance
976
+ * lowers to this amount, a threshold charge will be initiated.
977
+ */
978
+ threshold_amount?: number;
979
+ }
980
+ namespace UpdatePrepaidBalanceThresholdConfiguration {
981
+ interface Commit extends Shared.UpdateBaseThresholdCommit {
982
+ /**
983
+ * Which products the threshold commit applies to. If both applicable_product_ids
984
+ * and applicable_product_tags are not provided, the commit applies to all
985
+ * products.
986
+ */
987
+ applicable_product_ids?: Array<string> | null;
988
+ /**
989
+ * Which tags the threshold commit applies to. If both applicable_product_ids and
990
+ * applicable_product_tags are not provided, the commit applies to all products.
991
+ */
992
+ applicable_product_tags?: Array<string> | null;
993
+ /**
994
+ * List of filters that determine what kind of customer usage draws down a commit
995
+ * or credit. A customer's usage needs to meet the condition of at least one of the
996
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
997
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
998
+ * Instead, to target usage by product or product tag, pass those values in the
999
+ * body of `specifiers`.
1000
+ */
1001
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
1002
+ }
1003
+ }
1004
+ interface UpdateRecurringCommit {
1005
+ id: string;
1006
+ access_amount?: UpdateRecurringCommit.AccessAmount;
1007
+ ending_before?: string;
1008
+ invoice_amount?: UpdateRecurringCommit.InvoiceAmount;
1009
+ }
1010
+ namespace UpdateRecurringCommit {
1011
+ interface AccessAmount {
1012
+ quantity?: number;
1013
+ unit_price?: number;
1014
+ }
1015
+ interface InvoiceAmount {
1016
+ quantity?: number;
1017
+ unit_price?: number;
1018
+ }
1019
+ }
1020
+ interface UpdateRecurringCredit {
1021
+ id: string;
1022
+ access_amount?: UpdateRecurringCredit.AccessAmount;
1023
+ ending_before?: string;
1024
+ }
1025
+ namespace UpdateRecurringCredit {
1026
+ interface AccessAmount {
1027
+ quantity?: number;
1028
+ unit_price?: number;
1029
+ }
1030
+ }
1031
+ interface UpdateRefundInvoice {
1032
+ date: string;
1033
+ invoice_id: string;
1034
+ }
1035
+ interface UpdateScheduledCharge {
1036
+ id: string;
1037
+ invoice_schedule?: UpdateScheduledCharge.InvoiceSchedule;
1038
+ name?: string;
1039
+ netsuite_sales_order_id?: string | null;
1040
+ }
1041
+ namespace UpdateScheduledCharge {
1042
+ interface InvoiceSchedule {
1043
+ add_schedule_items?: Array<InvoiceSchedule.AddScheduleItem>;
1044
+ remove_schedule_items?: Array<InvoiceSchedule.RemoveScheduleItem>;
1045
+ update_schedule_items?: Array<InvoiceSchedule.UpdateScheduleItem>;
1046
+ }
1047
+ namespace InvoiceSchedule {
1048
+ interface AddScheduleItem {
1049
+ timestamp: string;
1050
+ amount?: number;
1051
+ quantity?: number;
1052
+ unit_price?: number;
1053
+ }
1054
+ interface RemoveScheduleItem {
1055
+ id: string;
1056
+ }
1057
+ interface UpdateScheduleItem {
1058
+ id: string;
1059
+ amount?: number;
1060
+ quantity?: number;
1061
+ timestamp?: string;
1062
+ unit_price?: number;
1063
+ }
1064
+ }
1065
+ }
1066
+ interface UpdateSpendThresholdConfiguration {
1067
+ commit?: Shared.UpdateBaseThresholdCommit;
1068
+ /**
1069
+ * When set to false, the contract will not be evaluated against the
1070
+ * threshold_amount. Toggling to true will result an immediate evaluation,
1071
+ * regardless of prior state.
1072
+ */
1073
+ is_enabled?: boolean;
1074
+ payment_gate_config?: Shared.PaymentGateConfigV2;
1075
+ /**
1076
+ * Specify the threshold amount for the contract. Each time the contract's usage
1077
+ * hits this amount, a threshold charge will be initiated.
1078
+ */
1079
+ threshold_amount?: number;
1080
+ }
1081
+ interface UpdateSubscription {
1082
+ id: string;
1083
+ ending_before?: string;
1084
+ quantity_updates?: Array<UpdateSubscription.QuantityUpdate>;
1085
+ }
1086
+ namespace UpdateSubscription {
1087
+ interface QuantityUpdate {
1088
+ starting_at: string;
1089
+ quantity?: number;
1090
+ quantity_delta?: number;
1091
+ }
1092
+ }
1093
+ }
1094
+ }
1095
+ export interface ContractRetrieveParams {
1096
+ contract_id: string;
1097
+ customer_id: string;
1098
+ /**
1099
+ * Optional RFC 3339 timestamp. Return the contract as of this date. Cannot be used
1100
+ * with include_ledgers parameter.
1101
+ */
1102
+ as_of_date?: string;
1103
+ /**
1104
+ * Include the balance of credits and commits in the response. Setting this flag
1105
+ * may cause the query to be slower.
1106
+ */
1107
+ include_balance?: boolean;
1108
+ /**
1109
+ * Include commit/credit ledgers in the response. Setting this flag may cause the
1110
+ * query to be slower. Cannot be used with as_of_date parameter.
1111
+ */
1112
+ include_ledgers?: boolean;
1113
+ }
1114
+ export interface ContractListParams {
1115
+ customer_id: string;
1116
+ /**
1117
+ * Optional RFC 3339 timestamp. Only include contracts active on the provided date.
1118
+ * This cannot be provided if starting_at filter is provided.
1119
+ */
1120
+ covering_date?: string;
1121
+ /**
1122
+ * Include archived contracts in the response.
1123
+ */
1124
+ include_archived?: boolean;
1125
+ /**
1126
+ * Include the balance of credits and commits in the response. Setting this flag
1127
+ * may cause the response to be slower.
1128
+ */
1129
+ include_balance?: boolean;
1130
+ /**
1131
+ * Include commit/credit ledgers in the response. Setting this flag may cause the
1132
+ * response to be slower.
1133
+ */
1134
+ include_ledgers?: boolean;
1135
+ /**
1136
+ * Optional RFC 3339 timestamp. Only include contracts that started on or after
1137
+ * this date. This cannot be provided if covering_date filter is provided.
1138
+ */
1139
+ starting_at?: string;
1140
+ }
1141
+ export interface ContractEditParams {
1142
+ /**
1143
+ * ID of the contract being edited
1144
+ */
1145
+ contract_id: string;
1146
+ /**
1147
+ * ID of the customer whose contract is being edited
1148
+ */
1149
+ customer_id: string;
1150
+ add_commits?: Array<ContractEditParams.AddCommit>;
1151
+ add_credits?: Array<ContractEditParams.AddCredit>;
1152
+ add_discounts?: Array<ContractEditParams.AddDiscount>;
1153
+ add_overrides?: Array<ContractEditParams.AddOverride>;
1154
+ add_prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfigurationV2;
1155
+ /**
1156
+ * This field's availability is dependent on your client's configuration.
1157
+ */
1158
+ add_professional_services?: Array<ContractEditParams.AddProfessionalService>;
1159
+ add_recurring_commits?: Array<ContractEditParams.AddRecurringCommit>;
1160
+ add_recurring_credits?: Array<ContractEditParams.AddRecurringCredit>;
1161
+ add_reseller_royalties?: Array<ContractEditParams.AddResellerRoyalty>;
1162
+ add_scheduled_charges?: Array<ContractEditParams.AddScheduledCharge>;
1163
+ add_spend_threshold_configuration?: Shared.SpendThresholdConfigurationV2;
1164
+ /**
1165
+ * Optional list of
1166
+ * [subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/)
1167
+ * to add to the contract.
1168
+ */
1169
+ add_subscriptions?: Array<ContractEditParams.AddSubscription>;
1170
+ /**
1171
+ * If true, allows setting the contract end date earlier than the end_timestamp of
1172
+ * existing finalized invoices. Finalized invoices will be unchanged; if you want
1173
+ * to incorporate the new end date, you can void and regenerate finalized usage
1174
+ * invoices. Defaults to true.
1175
+ */
1176
+ allow_contract_ending_before_finalized_invoice?: boolean;
1177
+ /**
1178
+ * IDs of commits to archive
1179
+ */
1180
+ archive_commits?: Array<ContractEditParams.ArchiveCommit>;
1181
+ /**
1182
+ * IDs of credits to archive
1183
+ */
1184
+ archive_credits?: Array<ContractEditParams.ArchiveCredit>;
1185
+ /**
1186
+ * IDs of scheduled charges to archive
1187
+ */
1188
+ archive_scheduled_charges?: Array<ContractEditParams.ArchiveScheduledCharge>;
1189
+ /**
1190
+ * IDs of overrides to remove
1191
+ */
1192
+ remove_overrides?: Array<ContractEditParams.RemoveOverride>;
1193
+ /**
1194
+ * Optional uniqueness key to prevent duplicate contract edits.
1195
+ */
1196
+ uniqueness_key?: string;
1197
+ update_commits?: Array<ContractEditParams.UpdateCommit>;
1198
+ /**
1199
+ * RFC 3339 timestamp indicating when the contract will end (exclusive).
1200
+ */
1201
+ update_contract_end_date?: string | null;
1202
+ /**
1203
+ * Value to update the contract name to. If not provided, the contract name will
1204
+ * remain unchanged.
1205
+ */
1206
+ update_contract_name?: string | null;
1207
+ update_credits?: Array<ContractEditParams.UpdateCredit>;
1208
+ update_prepaid_balance_threshold_configuration?: ContractEditParams.UpdatePrepaidBalanceThresholdConfiguration;
1209
+ /**
1210
+ * Edits to these recurring commits will only affect commits whose access schedules
1211
+ * has not started. Expired commits, and commits with an active access schedule
1212
+ * will remain unchanged.
1213
+ */
1214
+ update_recurring_commits?: Array<ContractEditParams.UpdateRecurringCommit>;
1215
+ /**
1216
+ * Edits to these recurring credits will only affect credits whose access schedules
1217
+ * has not started. Expired credits, and credits with an active access schedule
1218
+ * will remain unchanged.
1219
+ */
1220
+ update_recurring_credits?: Array<ContractEditParams.UpdateRecurringCredit>;
1221
+ update_scheduled_charges?: Array<ContractEditParams.UpdateScheduledCharge>;
1222
+ update_spend_threshold_configuration?: ContractEditParams.UpdateSpendThresholdConfiguration;
1223
+ /**
1224
+ * Optional list of subscriptions to update.
1225
+ */
1226
+ update_subscriptions?: Array<ContractEditParams.UpdateSubscription>;
1227
+ }
1228
+ export declare namespace ContractEditParams {
1229
+ interface AddCommit {
1230
+ product_id: string;
1231
+ type: 'PREPAID' | 'POSTPAID';
1232
+ /**
1233
+ * Required: Schedule for distributing the commit to the customer. For "POSTPAID"
1234
+ * commits only one schedule item is allowed and amount must match invoice_schedule
1235
+ * total.
1236
+ */
1237
+ access_schedule?: AddCommit.AccessSchedule;
1238
+ /**
1239
+ * (DEPRECATED) Use access_schedule and invoice_schedule instead.
1240
+ */
1241
+ amount?: number;
1242
+ /**
1243
+ * Which products the commit applies to. If applicable_product_ids,
1244
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1245
+ * all products.
1246
+ */
1247
+ applicable_product_ids?: Array<string>;
1248
+ /**
1249
+ * Which tags the commit applies to. If applicable_product_ids,
1250
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1251
+ * all products.
1252
+ */
1253
+ applicable_product_tags?: Array<string>;
1254
+ /**
1255
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1256
+ */
1257
+ custom_fields?: {
1258
+ [key: string]: string;
1259
+ };
1260
+ /**
1261
+ * Used only in UI/API. It is not exposed to end customers.
1262
+ */
1263
+ description?: string;
1264
+ /**
1265
+ * Optional configuration for commit hierarchy access control
1266
+ */
1267
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1268
+ /**
1269
+ * Required for "POSTPAID" commits: the true up invoice will be generated at this
1270
+ * time and only one schedule item is allowed; the total must match access_schedule
1271
+ * amount. Optional for "PREPAID" commits: if not provided, this will be a
1272
+ * "complimentary" commit with no invoice.
1273
+ */
1274
+ invoice_schedule?: AddCommit.InvoiceSchedule;
1275
+ /**
1276
+ * displayed on invoices
1277
+ */
1278
+ name?: string;
1279
+ /**
1280
+ * This field's availability is dependent on your client's configuration.
1281
+ */
1282
+ netsuite_sales_order_id?: string;
1283
+ /**
1284
+ * optionally payment gate this commit
1285
+ */
1286
+ payment_gate_config?: AddCommit.PaymentGateConfig;
1287
+ /**
1288
+ * If multiple commits are applicable, the one with the lower priority will apply
1289
+ * first.
1290
+ */
1291
+ priority?: number;
1292
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
1293
+ /**
1294
+ * Fraction of unused segments that will be rolled over. Must be between 0 and 1.
1295
+ */
1296
+ rollover_fraction?: number;
1297
+ /**
1298
+ * List of filters that determine what kind of customer usage draws down a commit
1299
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1300
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1301
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1302
+ * Instead, to target usage by product or product tag, pass those values in the
1303
+ * body of `specifiers`.
1304
+ */
1305
+ specifiers?: Array<Shared.CommitSpecifierInput>;
1306
+ /**
1307
+ * A temporary ID for the commit that can be used to reference the commit for
1308
+ * commit specific overrides.
1309
+ */
1310
+ temporary_id?: string;
1311
+ }
1312
+ namespace AddCommit {
1313
+ /**
1314
+ * Required: Schedule for distributing the commit to the customer. For "POSTPAID"
1315
+ * commits only one schedule item is allowed and amount must match invoice_schedule
1316
+ * total.
1317
+ */
1318
+ interface AccessSchedule {
1319
+ schedule_items: Array<AccessSchedule.ScheduleItem>;
1320
+ credit_type_id?: string;
1321
+ }
1322
+ namespace AccessSchedule {
1323
+ interface ScheduleItem {
1324
+ amount: number;
1325
+ /**
1326
+ * RFC 3339 timestamp (exclusive)
1327
+ */
1328
+ ending_before: string;
1329
+ /**
1330
+ * RFC 3339 timestamp (inclusive)
1331
+ */
1332
+ starting_at: string;
1333
+ }
1334
+ }
1335
+ /**
1336
+ * Required for "POSTPAID" commits: the true up invoice will be generated at this
1337
+ * time and only one schedule item is allowed; the total must match access_schedule
1338
+ * amount. Optional for "PREPAID" commits: if not provided, this will be a
1339
+ * "complimentary" commit with no invoice.
1340
+ */
1341
+ interface InvoiceSchedule {
1342
+ /**
1343
+ * Defaults to USD (cents) if not passed.
1344
+ */
1345
+ credit_type_id?: string;
1346
+ /**
1347
+ * This field is only applicable to commit invoice schedules. If true, this
1348
+ * schedule will not generate an invoice.
1349
+ */
1350
+ do_not_invoice?: boolean;
1351
+ /**
1352
+ * Enter the unit price and quantity for the charge or instead only send the
1353
+ * amount. If amount is sent, the unit price is assumed to be the amount and
1354
+ * quantity is inferred to be 1.
1355
+ */
1356
+ recurring_schedule?: InvoiceSchedule.RecurringSchedule;
1357
+ /**
1358
+ * Either provide amount or provide both unit_price and quantity.
1359
+ */
1360
+ schedule_items?: Array<InvoiceSchedule.ScheduleItem>;
1361
+ }
1362
+ namespace InvoiceSchedule {
1363
+ /**
1364
+ * Enter the unit price and quantity for the charge or instead only send the
1365
+ * amount. If amount is sent, the unit price is assumed to be the amount and
1366
+ * quantity is inferred to be 1.
1367
+ */
1368
+ interface RecurringSchedule {
1369
+ amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
1370
+ /**
1371
+ * RFC 3339 timestamp (exclusive).
1372
+ */
1373
+ ending_before: string;
1374
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY';
1375
+ /**
1376
+ * RFC 3339 timestamp (inclusive).
1377
+ */
1378
+ starting_at: string;
1379
+ /**
1380
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
1381
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
1382
+ * inferred to be 1.
1383
+ */
1384
+ amount?: number;
1385
+ /**
1386
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
1387
+ * amount and must be specified with unit_price. If specified amount cannot be
1388
+ * provided.
1389
+ */
1390
+ quantity?: number;
1391
+ /**
1392
+ * Unit price for the charge. Will be multiplied by quantity to determine the
1393
+ * amount and must be specified with quantity. If specified amount cannot be
1394
+ * provided.
1395
+ */
1396
+ unit_price?: number;
1397
+ }
1398
+ interface ScheduleItem {
1399
+ /**
1400
+ * timestamp of the scheduled event
1401
+ */
1402
+ timestamp: string;
1403
+ /**
1404
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
1405
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
1406
+ * inferred to be 1.
1407
+ */
1408
+ amount?: number;
1409
+ /**
1410
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
1411
+ * amount and must be specified with unit_price. If specified amount cannot be
1412
+ * provided.
1413
+ */
1414
+ quantity?: number;
1415
+ /**
1416
+ * Unit price for the charge. Will be multiplied by quantity to determine the
1417
+ * amount and must be specified with quantity. If specified amount cannot be
1418
+ * provided.
1419
+ */
1420
+ unit_price?: number;
1421
+ }
1422
+ }
1423
+ /**
1424
+ * optionally payment gate this commit
1425
+ */
1426
+ interface PaymentGateConfig {
1427
+ /**
1428
+ * Gate access to the commit balance based on successful collection of payment.
1429
+ * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1430
+ * facilitate payment using your own payment integration. Select NONE if you do not
1431
+ * wish to payment gate the commit balance.
1432
+ */
1433
+ payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1434
+ /**
1435
+ * Only applicable if using PRECALCULATED as your tax type.
1436
+ */
1437
+ precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1438
+ /**
1439
+ * Only applicable if using STRIPE as your payment gateway type.
1440
+ */
1441
+ stripe_config?: PaymentGateConfig.StripeConfig;
1442
+ /**
1443
+ * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1444
+ * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1445
+ * will default to NONE.
1446
+ */
1447
+ tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1448
+ }
1449
+ namespace PaymentGateConfig {
1450
+ /**
1451
+ * Only applicable if using PRECALCULATED as your tax type.
1452
+ */
1453
+ interface PrecalculatedTaxConfig {
1454
+ /**
1455
+ * Amount of tax to be applied. This should be in the same currency and
1456
+ * denomination as the commit's invoice schedule
1457
+ */
1458
+ tax_amount: number;
1459
+ /**
1460
+ * Name of the tax to be applied. This may be used in an invoice line item
1461
+ * description.
1462
+ */
1463
+ tax_name?: string;
1464
+ }
1465
+ /**
1466
+ * Only applicable if using STRIPE as your payment gateway type.
1467
+ */
1468
+ interface StripeConfig {
1469
+ /**
1470
+ * If left blank, will default to INVOICE
1471
+ */
1472
+ payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1473
+ /**
1474
+ * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1475
+ * your payment type.
1476
+ */
1477
+ invoice_metadata?: {
1478
+ [key: string]: string;
1479
+ };
1480
+ /**
1481
+ * If true, the payment will be made assuming the customer is present (i.e. on
1482
+ * session).
1483
+ *
1484
+ * If false, the payment will be made assuming the customer is not present (i.e.
1485
+ * off session). For cardholders from a country with an e-mandate requirement (e.g.
1486
+ * India), the payment may be declined.
1487
+ *
1488
+ * If left blank, will default to false.
1489
+ */
1490
+ on_session_payment?: boolean;
1491
+ }
1492
+ }
1493
+ }
1494
+ interface AddCredit {
1495
+ /**
1496
+ * Schedule for distributing the credit to the customer.
1497
+ */
1498
+ access_schedule: AddCredit.AccessSchedule;
1499
+ product_id: string;
1500
+ /**
1501
+ * Which products the credit applies to. If both applicable_product_ids and
1502
+ * applicable_product_tags are not provided, the credit applies to all products.
1503
+ */
1504
+ applicable_product_ids?: Array<string>;
1505
+ /**
1506
+ * Which tags the credit applies to. If both applicable_product_ids and
1507
+ * applicable_product_tags are not provided, the credit applies to all products.
1508
+ */
1509
+ applicable_product_tags?: Array<string>;
1510
+ /**
1511
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1512
+ */
1513
+ custom_fields?: {
1514
+ [key: string]: string;
1515
+ };
1516
+ /**
1517
+ * Used only in UI/API. It is not exposed to end customers.
1518
+ */
1519
+ description?: string;
1520
+ /**
1521
+ * Optional configuration for credit hierarchy access control
1522
+ */
1523
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1524
+ /**
1525
+ * displayed on invoices
1526
+ */
1527
+ name?: string;
1528
+ /**
1529
+ * This field's availability is dependent on your client's configuration.
1530
+ */
1531
+ netsuite_sales_order_id?: string;
1532
+ /**
1533
+ * If multiple credits are applicable, the one with the lower priority will apply
1534
+ * first.
1535
+ */
1536
+ priority?: number;
1537
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
1538
+ /**
1539
+ * List of filters that determine what kind of customer usage draws down a commit
1540
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1541
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1542
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1543
+ * Instead, to target usage by product or product tag, pass those values in the
1544
+ * body of `specifiers`.
1545
+ */
1546
+ specifiers?: Array<Shared.CommitSpecifierInput>;
1547
+ }
1548
+ namespace AddCredit {
1549
+ /**
1550
+ * Schedule for distributing the credit to the customer.
1551
+ */
1552
+ interface AccessSchedule {
1553
+ schedule_items: Array<AccessSchedule.ScheduleItem>;
1554
+ credit_type_id?: string;
1555
+ }
1556
+ namespace AccessSchedule {
1557
+ interface ScheduleItem {
1558
+ amount: number;
1559
+ /**
1560
+ * RFC 3339 timestamp (exclusive)
1561
+ */
1562
+ ending_before: string;
1563
+ /**
1564
+ * RFC 3339 timestamp (inclusive)
1565
+ */
1566
+ starting_at: string;
1567
+ }
1568
+ }
1569
+ }
1570
+ interface AddDiscount {
1571
+ product_id: string;
1572
+ /**
1573
+ * Must provide either schedule_items or recurring_schedule.
1574
+ */
1575
+ schedule: AddDiscount.Schedule;
1576
+ /**
1577
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1578
+ */
1579
+ custom_fields?: {
1580
+ [key: string]: string;
1581
+ };
1582
+ /**
1583
+ * displayed on invoices
1584
+ */
1585
+ name?: string;
1586
+ /**
1587
+ * This field's availability is dependent on your client's configuration.
1588
+ */
1589
+ netsuite_sales_order_id?: string;
1590
+ }
1591
+ namespace AddDiscount {
1592
+ /**
1593
+ * Must provide either schedule_items or recurring_schedule.
1594
+ */
1595
+ interface Schedule {
1596
+ /**
1597
+ * Defaults to USD (cents) if not passed.
1598
+ */
1599
+ credit_type_id?: string;
1600
+ /**
1601
+ * This field is only applicable to commit invoice schedules. If true, this
1602
+ * schedule will not generate an invoice.
1603
+ */
1604
+ do_not_invoice?: boolean;
1605
+ /**
1606
+ * Enter the unit price and quantity for the charge or instead only send the
1607
+ * amount. If amount is sent, the unit price is assumed to be the amount and
1608
+ * quantity is inferred to be 1.
1609
+ */
1610
+ recurring_schedule?: Schedule.RecurringSchedule;
1611
+ /**
1612
+ * Either provide amount or provide both unit_price and quantity.
1613
+ */
1614
+ schedule_items?: Array<Schedule.ScheduleItem>;
1615
+ }
1616
+ namespace Schedule {
1617
+ /**
1618
+ * Enter the unit price and quantity for the charge or instead only send the
1619
+ * amount. If amount is sent, the unit price is assumed to be the amount and
1620
+ * quantity is inferred to be 1.
1621
+ */
1622
+ interface RecurringSchedule {
1623
+ amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
1624
+ /**
1625
+ * RFC 3339 timestamp (exclusive).
1626
+ */
1627
+ ending_before: string;
1628
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY';
1629
+ /**
1630
+ * RFC 3339 timestamp (inclusive).
1631
+ */
1632
+ starting_at: string;
1633
+ /**
1634
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
1635
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
1636
+ * inferred to be 1.
1637
+ */
1638
+ amount?: number;
1639
+ /**
1640
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
1641
+ * amount and must be specified with unit_price. If specified amount cannot be
1642
+ * provided.
1643
+ */
1644
+ quantity?: number;
1645
+ /**
1646
+ * Unit price for the charge. Will be multiplied by quantity to determine the
1647
+ * amount and must be specified with quantity. If specified amount cannot be
1648
+ * provided.
1649
+ */
1650
+ unit_price?: number;
1651
+ }
1652
+ interface ScheduleItem {
1653
+ /**
1654
+ * timestamp of the scheduled event
1655
+ */
1656
+ timestamp: string;
1657
+ /**
1658
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
1659
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
1660
+ * inferred to be 1.
1661
+ */
1662
+ amount?: number;
1663
+ /**
1664
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
1665
+ * amount and must be specified with unit_price. If specified amount cannot be
1666
+ * provided.
1667
+ */
1668
+ quantity?: number;
1669
+ /**
1670
+ * Unit price for the charge. Will be multiplied by quantity to determine the
1671
+ * amount and must be specified with quantity. If specified amount cannot be
1672
+ * provided.
1673
+ */
1674
+ unit_price?: number;
1675
+ }
1676
+ }
1677
+ }
1678
+ interface AddOverride {
1679
+ /**
1680
+ * RFC 3339 timestamp indicating when the override will start applying (inclusive)
1681
+ */
1682
+ starting_at: string;
1683
+ /**
1684
+ * tags identifying products whose rates are being overridden
1685
+ */
1686
+ applicable_product_tags?: Array<string>;
1687
+ /**
1688
+ * RFC 3339 timestamp indicating when the override will stop applying (exclusive)
1689
+ */
1690
+ ending_before?: string;
1691
+ entitled?: boolean;
1692
+ /**
1693
+ * Indicates whether the override should only apply to commits. Defaults to
1694
+ * `false`. If `true`, you can specify relevant commits in `override_specifiers` by
1695
+ * passing `commit_ids`.
1696
+ */
1697
+ is_commit_specific?: boolean;
1698
+ /**
1699
+ * Required for MULTIPLIER type. Must be >=0.
1700
+ */
1701
+ multiplier?: number;
1702
+ /**
1703
+ * Cannot be used in conjunction with product_id or applicable_product_tags. If
1704
+ * provided, the override will apply to all products with the specified specifiers.
1705
+ */
1706
+ override_specifiers?: Array<AddOverride.OverrideSpecifier>;
1707
+ /**
1708
+ * Required for OVERWRITE type.
1709
+ */
1710
+ overwrite_rate?: AddOverride.OverwriteRate;
1711
+ /**
1712
+ * Required for EXPLICIT multiplier prioritization scheme and all TIERED overrides.
1713
+ * Under EXPLICIT prioritization, overwrites are prioritized first, and then tiered
1714
+ * and multiplier overrides are prioritized by their priority value (lowest first).
1715
+ * Must be > 0.
1716
+ */
1717
+ priority?: number;
1718
+ /**
1719
+ * ID of the product whose rate is being overridden
1720
+ */
1721
+ product_id?: string;
1722
+ /**
1723
+ * Indicates whether the override applies to commit rates or list rates. Can only
1724
+ * be used for overrides that have `is_commit_specific` set to `true`. Defaults to
1725
+ * `"LIST_RATE"`.
1726
+ */
1727
+ target?: 'COMMIT_RATE' | 'LIST_RATE';
1728
+ /**
1729
+ * Required for TIERED type. Must have at least one tier.
1730
+ */
1731
+ tiers?: Array<AddOverride.Tier>;
1732
+ /**
1733
+ * Overwrites are prioritized over multipliers and tiered overrides.
1734
+ */
1735
+ type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
1736
+ }
1737
+ namespace AddOverride {
1738
+ interface OverrideSpecifier {
1739
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1740
+ /**
1741
+ * If provided, the override will only apply to the specified commits. Can only be
1742
+ * used for commit specific overrides. If not provided, the override will apply to
1743
+ * all commits.
1744
+ */
1745
+ commit_ids?: Array<string>;
1746
+ /**
1747
+ * A map of group names to values. The override will only apply to line items with
1748
+ * the specified presentation group values. Can only be used for multiplier
1749
+ * overrides.
1750
+ */
1751
+ presentation_group_values?: {
1752
+ [key: string]: string;
1753
+ };
1754
+ /**
1755
+ * A map of pricing group names to values. The override will only apply to products
1756
+ * with the specified pricing group values.
1757
+ */
1758
+ pricing_group_values?: {
1759
+ [key: string]: string;
1760
+ };
1761
+ /**
1762
+ * If provided, the override will only apply to the product with the specified ID.
1763
+ */
1764
+ product_id?: string;
1765
+ /**
1766
+ * If provided, the override will only apply to products with all the specified
1767
+ * tags.
1768
+ */
1769
+ product_tags?: Array<string>;
1770
+ /**
1771
+ * Can only be used for commit specific overrides. Must be used in conjunction with
1772
+ * one of product_id, product_tags, pricing_group_values, or
1773
+ * presentation_group_values. If provided, the override will only apply to commits
1774
+ * created by the specified recurring commit ids.
1775
+ */
1776
+ recurring_commit_ids?: Array<string>;
1777
+ /**
1778
+ * Can only be used for commit specific overrides. Must be used in conjunction with
1779
+ * one of product_id, product_tags, pricing_group_values, or
1780
+ * presentation_group_values. If provided, the override will only apply to commits
1781
+ * created by the specified recurring credit ids.
1782
+ */
1783
+ recurring_credit_ids?: Array<string>;
1784
+ }
1785
+ /**
1786
+ * Required for OVERWRITE type.
1787
+ */
1788
+ interface OverwriteRate {
1789
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
1790
+ credit_type_id?: string;
1791
+ /**
1792
+ * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1793
+ * processors.
1794
+ */
1795
+ custom_rate?: {
1796
+ [key: string]: unknown;
1797
+ };
1798
+ /**
1799
+ * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
1800
+ * set to true.
1801
+ */
1802
+ is_prorated?: boolean;
1803
+ /**
1804
+ * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
1805
+ * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
1806
+ */
1807
+ price?: number;
1808
+ /**
1809
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
1810
+ */
1811
+ quantity?: number;
1812
+ /**
1813
+ * Only set for TIERED rate_type.
1814
+ */
1815
+ tiers?: Array<Shared.Tier>;
1816
+ }
1817
+ interface Tier {
1818
+ multiplier: number;
1819
+ size?: number;
1820
+ }
1821
+ }
1822
+ interface AddProfessionalService {
1823
+ /**
1824
+ * Maximum amount for the term.
1825
+ */
1826
+ max_amount: number;
1827
+ product_id: string;
1828
+ /**
1829
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
1830
+ * amount.
1831
+ */
1832
+ quantity: number;
1833
+ /**
1834
+ * Unit price for the charge. Will be multiplied by quantity to determine the
1835
+ * amount and must be specified.
1836
+ */
1837
+ unit_price: number;
1838
+ /**
1839
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1840
+ */
1841
+ custom_fields?: {
1842
+ [key: string]: string;
1843
+ };
1844
+ description?: string;
1845
+ /**
1846
+ * This field's availability is dependent on your client's configuration.
1847
+ */
1848
+ netsuite_sales_order_id?: string;
1849
+ }
1850
+ interface AddRecurringCommit {
1851
+ /**
1852
+ * The amount of commit to grant.
1853
+ */
1854
+ access_amount: AddRecurringCommit.AccessAmount;
1855
+ /**
1856
+ * Defines the length of the access schedule for each created commit/credit. The
1857
+ * value represents the number of units. Unit defaults to "PERIODS", where the
1858
+ * length of a period is determined by the recurrence_frequency.
1859
+ */
1860
+ commit_duration: AddRecurringCommit.CommitDuration;
1861
+ /**
1862
+ * Will be passed down to the individual commits
1863
+ */
1864
+ priority: number;
1865
+ product_id: string;
1866
+ /**
1867
+ * determines the start time for the first commit
1868
+ */
1869
+ starting_at: string;
1870
+ /**
1871
+ * Will be passed down to the individual commits
1872
+ */
1873
+ applicable_product_ids?: Array<string>;
1874
+ /**
1875
+ * Will be passed down to the individual commits
1876
+ */
1877
+ applicable_product_tags?: Array<string>;
1878
+ /**
1879
+ * Will be passed down to the individual commits
1880
+ */
1881
+ description?: string;
1882
+ /**
1883
+ * Determines when the contract will stop creating recurring commits. optional
1884
+ */
1885
+ ending_before?: string;
1886
+ /**
1887
+ * Optional configuration for recurring credit hierarchy access control
1888
+ */
1889
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1890
+ /**
1891
+ * The amount the customer should be billed for the commit. Not required.
1892
+ */
1893
+ invoice_amount?: AddRecurringCommit.InvoiceAmount;
1894
+ /**
1895
+ * displayed on invoices. will be passed through to the individual commits
1896
+ */
1897
+ name?: string;
1898
+ /**
1899
+ * Will be passed down to the individual commits
1900
+ */
1901
+ netsuite_sales_order_id?: string;
1902
+ /**
1903
+ * Determines whether the first and last commit will be prorated. If not provided,
1904
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1905
+ */
1906
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1907
+ /**
1908
+ * Whether the created commits will use the commit rate or list rate
1909
+ */
1910
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
1911
+ /**
1912
+ * The frequency at which the recurring commits will be created. If not provided: -
1913
+ * The commits will be created on the usage invoice frequency. If provided: - The
1914
+ * period defined in the duration will correspond to this frequency. - Commits will
1915
+ * be created aligned with the recurring commit's starting_at rather than the usage
1916
+ * invoice dates.
1917
+ */
1918
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1919
+ /**
1920
+ * Will be passed down to the individual commits. This controls how much of an
1921
+ * individual unexpired commit will roll over upon contract transition. Must be
1922
+ * between 0 and 1.
1923
+ */
1924
+ rollover_fraction?: number;
1925
+ /**
1926
+ * List of filters that determine what kind of customer usage draws down a commit
1927
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1928
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1929
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1930
+ * Instead, to target usage by product or product tag, pass those values in the
1931
+ * body of `specifiers`.
1932
+ */
1933
+ specifiers?: Array<Shared.CommitSpecifierInput>;
1934
+ /**
1935
+ * Attach a subscription to the recurring commit/credit.
1936
+ */
1937
+ subscription_config?: AddRecurringCommit.SubscriptionConfig;
1938
+ /**
1939
+ * A temporary ID that can be used to reference the recurring commit for commit
1940
+ * specific overrides.
1941
+ */
1942
+ temporary_id?: string;
1943
+ }
1944
+ namespace AddRecurringCommit {
1945
+ /**
1946
+ * The amount of commit to grant.
1947
+ */
1948
+ interface AccessAmount {
1949
+ credit_type_id: string;
1950
+ unit_price: number;
1951
+ /**
1952
+ * This field is required unless a subscription is attached via
1953
+ * `subscription_config`.
1954
+ */
1955
+ quantity?: number;
1956
+ }
1957
+ /**
1958
+ * Defines the length of the access schedule for each created commit/credit. The
1959
+ * value represents the number of units. Unit defaults to "PERIODS", where the
1960
+ * length of a period is determined by the recurrence_frequency.
1961
+ */
1962
+ interface CommitDuration {
1963
+ value: number;
1964
+ unit?: 'PERIODS';
1965
+ }
1966
+ /**
1967
+ * The amount the customer should be billed for the commit. Not required.
1968
+ */
1969
+ interface InvoiceAmount {
1970
+ credit_type_id: string;
1971
+ quantity: number;
1972
+ unit_price: number;
1973
+ }
1974
+ /**
1975
+ * Attach a subscription to the recurring commit/credit.
1976
+ */
1977
+ interface SubscriptionConfig {
1978
+ apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
1979
+ /**
1980
+ * ID of the subscription to configure on the recurring commit/credit.
1981
+ */
1982
+ subscription_id: string;
1983
+ /**
1984
+ * If set to POOLED, allocation added per seat is pooled across the account.
1985
+ */
1986
+ allocation?: 'POOLED' | 'INDIVIDUAL';
1987
+ }
1988
+ namespace SubscriptionConfig {
1989
+ interface ApplySeatIncreaseConfig {
1990
+ /**
1991
+ * Indicates whether a mid-period seat increase should be prorated.
1992
+ */
1993
+ is_prorated: boolean;
1994
+ }
1995
+ }
1996
+ }
1997
+ interface AddRecurringCredit {
1998
+ /**
1999
+ * The amount of commit to grant.
2000
+ */
2001
+ access_amount: AddRecurringCredit.AccessAmount;
2002
+ /**
2003
+ * Defines the length of the access schedule for each created commit/credit. The
2004
+ * value represents the number of units. Unit defaults to "PERIODS", where the
2005
+ * length of a period is determined by the recurrence_frequency.
2006
+ */
2007
+ commit_duration: AddRecurringCredit.CommitDuration;
2008
+ /**
2009
+ * Will be passed down to the individual commits
2010
+ */
2011
+ priority: number;
2012
+ product_id: string;
2013
+ /**
2014
+ * determines the start time for the first commit
2015
+ */
2016
+ starting_at: string;
2017
+ /**
2018
+ * Will be passed down to the individual commits
2019
+ */
2020
+ applicable_product_ids?: Array<string>;
2021
+ /**
2022
+ * Will be passed down to the individual commits
2023
+ */
2024
+ applicable_product_tags?: Array<string>;
2025
+ /**
2026
+ * Will be passed down to the individual commits
2027
+ */
2028
+ description?: string;
2029
+ /**
2030
+ * Determines when the contract will stop creating recurring commits. optional
2031
+ */
2032
+ ending_before?: string;
2033
+ /**
2034
+ * Optional configuration for recurring credit hierarchy access control
2035
+ */
2036
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
2037
+ /**
2038
+ * displayed on invoices. will be passed through to the individual commits
2039
+ */
2040
+ name?: string;
2041
+ /**
2042
+ * Will be passed down to the individual commits
2043
+ */
2044
+ netsuite_sales_order_id?: string;
2045
+ /**
2046
+ * Determines whether the first and last commit will be prorated. If not provided,
2047
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
2048
+ */
2049
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
2050
+ /**
2051
+ * Whether the created commits will use the commit rate or list rate
2052
+ */
2053
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
2054
+ /**
2055
+ * The frequency at which the recurring commits will be created. If not provided: -
2056
+ * The commits will be created on the usage invoice frequency. If provided: - The
2057
+ * period defined in the duration will correspond to this frequency. - Commits will
2058
+ * be created aligned with the recurring commit's starting_at rather than the usage
2059
+ * invoice dates.
2060
+ */
2061
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2062
+ /**
2063
+ * Will be passed down to the individual commits. This controls how much of an
2064
+ * individual unexpired commit will roll over upon contract transition. Must be
2065
+ * between 0 and 1.
2066
+ */
2067
+ rollover_fraction?: number;
2068
+ /**
2069
+ * List of filters that determine what kind of customer usage draws down a commit
2070
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2071
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2072
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2073
+ * Instead, to target usage by product or product tag, pass those values in the
2074
+ * body of `specifiers`.
2075
+ */
2076
+ specifiers?: Array<Shared.CommitSpecifierInput>;
2077
+ /**
2078
+ * Attach a subscription to the recurring commit/credit.
2079
+ */
2080
+ subscription_config?: AddRecurringCredit.SubscriptionConfig;
2081
+ /**
2082
+ * A temporary ID that can be used to reference the recurring commit for commit
2083
+ * specific overrides.
2084
+ */
2085
+ temporary_id?: string;
2086
+ }
2087
+ namespace AddRecurringCredit {
2088
+ /**
2089
+ * The amount of commit to grant.
2090
+ */
2091
+ interface AccessAmount {
2092
+ credit_type_id: string;
2093
+ unit_price: number;
2094
+ /**
2095
+ * This field is required unless a subscription is attached via
2096
+ * `subscription_config`.
2097
+ */
2098
+ quantity?: number;
2099
+ }
2100
+ /**
2101
+ * Defines the length of the access schedule for each created commit/credit. The
2102
+ * value represents the number of units. Unit defaults to "PERIODS", where the
2103
+ * length of a period is determined by the recurrence_frequency.
2104
+ */
2105
+ interface CommitDuration {
2106
+ value: number;
2107
+ unit?: 'PERIODS';
2108
+ }
2109
+ /**
2110
+ * Attach a subscription to the recurring commit/credit.
2111
+ */
2112
+ interface SubscriptionConfig {
2113
+ apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
2114
+ /**
2115
+ * ID of the subscription to configure on the recurring commit/credit.
2116
+ */
2117
+ subscription_id: string;
2118
+ /**
2119
+ * If set to POOLED, allocation added per seat is pooled across the account.
2120
+ */
2121
+ allocation?: 'POOLED' | 'INDIVIDUAL';
2122
+ }
2123
+ namespace SubscriptionConfig {
2124
+ interface ApplySeatIncreaseConfig {
2125
+ /**
2126
+ * Indicates whether a mid-period seat increase should be prorated.
2127
+ */
2128
+ is_prorated: boolean;
2129
+ }
2130
+ }
2131
+ }
2132
+ interface AddResellerRoyalty {
2133
+ reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
2134
+ /**
2135
+ * Must provide at least one of applicable_product_ids or applicable_product_tags.
2136
+ */
2137
+ applicable_product_ids?: Array<string>;
2138
+ /**
2139
+ * Must provide at least one of applicable_product_ids or applicable_product_tags.
2140
+ */
2141
+ applicable_product_tags?: Array<string>;
2142
+ aws_options?: AddResellerRoyalty.AwsOptions;
2143
+ /**
2144
+ * Use null to indicate that the existing end timestamp should be removed.
2145
+ */
2146
+ ending_before?: string | null;
2147
+ fraction?: number;
2148
+ gcp_options?: AddResellerRoyalty.GcpOptions;
2149
+ netsuite_reseller_id?: string;
2150
+ reseller_contract_value?: number;
2151
+ starting_at?: string;
2152
+ }
2153
+ namespace AddResellerRoyalty {
2154
+ interface AwsOptions {
2155
+ aws_account_number?: string;
2156
+ aws_offer_id?: string;
2157
+ aws_payer_reference_id?: string;
2158
+ }
2159
+ interface GcpOptions {
2160
+ gcp_account_id?: string;
2161
+ gcp_offer_id?: string;
2162
+ }
2163
+ }
2164
+ interface AddScheduledCharge {
2165
+ product_id: string;
2166
+ /**
2167
+ * Must provide either schedule_items or recurring_schedule.
2168
+ */
2169
+ schedule: AddScheduledCharge.Schedule;
2170
+ /**
2171
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2172
+ */
2173
+ custom_fields?: {
2174
+ [key: string]: string;
2175
+ };
2176
+ /**
2177
+ * displayed on invoices
2178
+ */
2179
+ name?: string;
2180
+ /**
2181
+ * This field's availability is dependent on your client's configuration.
2182
+ */
2183
+ netsuite_sales_order_id?: string;
2184
+ }
2185
+ namespace AddScheduledCharge {
2186
+ /**
2187
+ * Must provide either schedule_items or recurring_schedule.
2188
+ */
2189
+ interface Schedule {
2190
+ /**
2191
+ * Defaults to USD (cents) if not passed.
2192
+ */
2193
+ credit_type_id?: string;
2194
+ /**
2195
+ * This field is only applicable to commit invoice schedules. If true, this
2196
+ * schedule will not generate an invoice.
2197
+ */
2198
+ do_not_invoice?: boolean;
2199
+ /**
2200
+ * Enter the unit price and quantity for the charge or instead only send the
2201
+ * amount. If amount is sent, the unit price is assumed to be the amount and
2202
+ * quantity is inferred to be 1.
2203
+ */
2204
+ recurring_schedule?: Schedule.RecurringSchedule;
2205
+ /**
2206
+ * Either provide amount or provide both unit_price and quantity.
2207
+ */
2208
+ schedule_items?: Array<Schedule.ScheduleItem>;
2209
+ }
2210
+ namespace Schedule {
2211
+ /**
2212
+ * Enter the unit price and quantity for the charge or instead only send the
2213
+ * amount. If amount is sent, the unit price is assumed to be the amount and
2214
+ * quantity is inferred to be 1.
2215
+ */
2216
+ interface RecurringSchedule {
2217
+ amount_distribution: 'DIVIDED' | 'DIVIDED_ROUNDED' | 'EACH';
2218
+ /**
2219
+ * RFC 3339 timestamp (exclusive).
2220
+ */
2221
+ ending_before: string;
2222
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'SEMI_ANNUAL' | 'ANNUAL' | 'WEEKLY';
2223
+ /**
2224
+ * RFC 3339 timestamp (inclusive).
2225
+ */
2226
+ starting_at: string;
2227
+ /**
2228
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
2229
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
2230
+ * inferred to be 1.
2231
+ */
2232
+ amount?: number;
2233
+ /**
2234
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
2235
+ * amount and must be specified with unit_price. If specified amount cannot be
2236
+ * provided.
2237
+ */
2238
+ quantity?: number;
2239
+ /**
2240
+ * Unit price for the charge. Will be multiplied by quantity to determine the
2241
+ * amount and must be specified with quantity. If specified amount cannot be
2242
+ * provided.
2243
+ */
2244
+ unit_price?: number;
2245
+ }
2246
+ interface ScheduleItem {
2247
+ /**
2248
+ * timestamp of the scheduled event
2249
+ */
2250
+ timestamp: string;
2251
+ /**
2252
+ * Amount for the charge. Can be provided instead of unit_price and quantity. If
2253
+ * amount is sent, the unit_price is assumed to be the amount and quantity is
2254
+ * inferred to be 1.
2255
+ */
2256
+ amount?: number;
2257
+ /**
2258
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
2259
+ * amount and must be specified with unit_price. If specified amount cannot be
2260
+ * provided.
2261
+ */
2262
+ quantity?: number;
2263
+ /**
2264
+ * Unit price for the charge. Will be multiplied by quantity to determine the
2265
+ * amount and must be specified with quantity. If specified amount cannot be
2266
+ * provided.
2267
+ */
2268
+ unit_price?: number;
2269
+ }
2270
+ }
2271
+ }
2272
+ interface AddSubscription {
2273
+ collection_schedule: 'ADVANCE' | 'ARREARS';
2274
+ proration: AddSubscription.Proration;
2275
+ subscription_rate: AddSubscription.SubscriptionRate;
2276
+ /**
2277
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2278
+ */
2279
+ custom_fields?: {
2280
+ [key: string]: string;
2281
+ };
2282
+ description?: string;
2283
+ /**
2284
+ * Exclusive end time for the subscription. If not provided, subscription inherits
2285
+ * contract end date.
2286
+ */
2287
+ ending_before?: string;
2288
+ /**
2289
+ * The initial quantity for the subscription. It must be non-negative value.
2290
+ * Required if quantity_management_mode is QUANTITY_ONLY.
2291
+ */
2292
+ initial_quantity?: number;
2293
+ name?: string;
2294
+ /**
2295
+ * Determines how the subscription's quantity is controlled. Defaults to
2296
+ * QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
2297
+ * directly on the subscription. `initial_quantity` must be provided with this
2298
+ * option. Compatible with recurring commits/credits that use POOLED allocation.
2299
+ */
2300
+ quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY';
2301
+ /**
2302
+ * Inclusive start time for the subscription. If not provided, defaults to contract
2303
+ * start date
2304
+ */
2305
+ starting_at?: string;
2306
+ /**
2307
+ * A temporary ID used to reference the subscription in recurring commit/credit
2308
+ * subscription configs created within the same payload.
2309
+ */
2310
+ temporary_id?: string;
2311
+ }
2312
+ namespace AddSubscription {
2313
+ interface Proration {
2314
+ /**
2315
+ * Indicates how mid-period quantity adjustments are invoiced.
2316
+ * **BILL_IMMEDIATELY**: Only available when collection schedule is `ADVANCE`. The
2317
+ * quantity increase will be billed immediately on the scheduled date.
2318
+ * **BILL_ON_NEXT_COLLECTION_DATE**: The quantity increase will be billed for
2319
+ * in-arrears at the end of the period.
2320
+ */
2321
+ invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
2322
+ /**
2323
+ * Indicates if the partial period will be prorated or charged a full amount.
2324
+ */
2325
+ is_prorated?: boolean;
2326
+ }
2327
+ interface SubscriptionRate {
2328
+ /**
2329
+ * Frequency to bill subscription with. Together with product_id, must match
2330
+ * existing rate on the rate card.
2331
+ */
2332
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2333
+ /**
2334
+ * Must be subscription type product
2335
+ */
2336
+ product_id: string;
2337
+ }
2338
+ }
2339
+ interface ArchiveCommit {
2340
+ id: string;
2341
+ }
2342
+ interface ArchiveCredit {
2343
+ id: string;
2344
+ }
2345
+ interface ArchiveScheduledCharge {
2346
+ id: string;
2347
+ }
2348
+ interface RemoveOverride {
2349
+ id: string;
2350
+ }
2351
+ interface UpdateCommit {
2352
+ commit_id: string;
2353
+ access_schedule?: UpdateCommit.AccessSchedule;
2354
+ /**
2355
+ * Which products the commit applies to. If applicable_product_ids,
2356
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2357
+ * all products.
2358
+ */
2359
+ applicable_product_ids?: Array<string> | null;
2360
+ /**
2361
+ * Which tags the commit applies to. If applicable_product_ids,
2362
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2363
+ * all products.
2364
+ */
2365
+ applicable_product_tags?: Array<string> | null;
2366
+ /**
2367
+ * Optional configuration for commit hierarchy access control
2368
+ */
2369
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
2370
+ invoice_schedule?: UpdateCommit.InvoiceSchedule;
2371
+ netsuite_sales_order_id?: string | null;
2372
+ priority?: number | null;
2373
+ product_id?: string;
2374
+ /**
2375
+ * If provided, updates the commit to use the specified rate type for current and
2376
+ * future invoices. Previously finalized invoices will need to be voided and
2377
+ * regenerated to reflect the rate type change.
2378
+ */
2379
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
2380
+ rollover_fraction?: number | null;
2381
+ }
2382
+ namespace UpdateCommit {
2383
+ interface AccessSchedule {
2384
+ add_schedule_items?: Array<AccessSchedule.AddScheduleItem>;
2385
+ remove_schedule_items?: Array<AccessSchedule.RemoveScheduleItem>;
2386
+ update_schedule_items?: Array<AccessSchedule.UpdateScheduleItem>;
2387
+ }
2388
+ namespace AccessSchedule {
2389
+ interface AddScheduleItem {
2390
+ amount: number;
2391
+ ending_before: string;
2392
+ starting_at: string;
2393
+ }
2394
+ interface RemoveScheduleItem {
2395
+ id: string;
2396
+ }
2397
+ interface UpdateScheduleItem {
2398
+ id: string;
2399
+ amount?: number;
2400
+ ending_before?: string;
2401
+ starting_at?: string;
2402
+ }
2403
+ }
2404
+ interface InvoiceSchedule {
2405
+ add_schedule_items?: Array<InvoiceSchedule.AddScheduleItem>;
2406
+ remove_schedule_items?: Array<InvoiceSchedule.RemoveScheduleItem>;
2407
+ update_schedule_items?: Array<InvoiceSchedule.UpdateScheduleItem>;
2408
+ }
2409
+ namespace InvoiceSchedule {
2410
+ interface AddScheduleItem {
2411
+ timestamp: string;
2412
+ amount?: number;
2413
+ quantity?: number;
2414
+ unit_price?: number;
2415
+ }
2416
+ interface RemoveScheduleItem {
2417
+ id: string;
2418
+ }
2419
+ interface UpdateScheduleItem {
2420
+ id: string;
2421
+ amount?: number;
2422
+ quantity?: number;
2423
+ timestamp?: string;
2424
+ unit_price?: number;
2425
+ }
2426
+ }
2427
+ }
2428
+ interface UpdateCredit {
2429
+ credit_id: string;
2430
+ access_schedule?: UpdateCredit.AccessSchedule;
2431
+ /**
2432
+ * Which products the commit applies to. If applicable_product_ids,
2433
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2434
+ * all products.
2435
+ */
2436
+ applicable_product_ids?: Array<string> | null;
2437
+ /**
2438
+ * Which tags the commit applies to. If applicable_product_ids,
2439
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2440
+ * all products.
2441
+ */
2442
+ applicable_product_tags?: Array<string> | null;
2443
+ /**
2444
+ * Optional configuration for commit hierarchy access control
2445
+ */
2446
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
2447
+ netsuite_sales_order_id?: string | null;
2448
+ priority?: number | null;
2449
+ product_id?: string;
2450
+ /**
2451
+ * If provided, updates the credit to use the specified rate type for current and
2452
+ * future invoices. Previously finalized invoices will need to be voided and
2453
+ * regenerated to reflect the rate type change.
2454
+ */
2455
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
2456
+ }
2457
+ namespace UpdateCredit {
2458
+ interface AccessSchedule {
2459
+ add_schedule_items?: Array<AccessSchedule.AddScheduleItem>;
2460
+ remove_schedule_items?: Array<AccessSchedule.RemoveScheduleItem>;
2461
+ update_schedule_items?: Array<AccessSchedule.UpdateScheduleItem>;
2462
+ }
2463
+ namespace AccessSchedule {
2464
+ interface AddScheduleItem {
2465
+ amount: number;
2466
+ ending_before: string;
2467
+ starting_at: string;
2468
+ }
2469
+ interface RemoveScheduleItem {
2470
+ id: string;
2471
+ }
2472
+ interface UpdateScheduleItem {
2473
+ id: string;
2474
+ amount?: number;
2475
+ ending_before?: string;
2476
+ starting_at?: string;
2477
+ }
2478
+ }
2479
+ }
2480
+ interface UpdatePrepaidBalanceThresholdConfiguration {
2481
+ commit?: UpdatePrepaidBalanceThresholdConfiguration.Commit;
2482
+ /**
2483
+ * If provided, the threshold, recharge-to amount, and the resulting threshold
2484
+ * commit amount will be in terms of this credit type instead of the fiat currency.
2485
+ */
2486
+ custom_credit_type_id?: string | null;
2487
+ /**
2488
+ * When set to false, the contract will not be evaluated against the
2489
+ * threshold_amount. Toggling to true will result an immediate evaluation,
2490
+ * regardless of prior state.
2491
+ */
2492
+ is_enabled?: boolean;
2493
+ payment_gate_config?: Shared.PaymentGateConfigV2;
2494
+ /**
2495
+ * Specify the amount the balance should be recharged to.
2496
+ */
2497
+ recharge_to_amount?: number;
2498
+ /**
2499
+ * Specify the threshold amount for the contract. Each time the contract's balance
2500
+ * lowers to this amount, a threshold charge will be initiated.
2501
+ */
2502
+ threshold_amount?: number;
2503
+ }
2504
+ namespace UpdatePrepaidBalanceThresholdConfiguration {
2505
+ interface Commit extends Shared.UpdateBaseThresholdCommit {
2506
+ /**
2507
+ * Which products the threshold commit applies to. If both applicable_product_ids
2508
+ * and applicable_product_tags are not provided, the commit applies to all
2509
+ * products.
2510
+ */
2511
+ applicable_product_ids?: Array<string> | null;
2512
+ /**
2513
+ * Which tags the threshold commit applies to. If both applicable_product_ids and
2514
+ * applicable_product_tags are not provided, the commit applies to all products.
2515
+ */
2516
+ applicable_product_tags?: Array<string> | null;
2517
+ /**
2518
+ * List of filters that determine what kind of customer usage draws down a commit
2519
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2520
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2521
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2522
+ * Instead, to target usage by product or product tag, pass those values in the
2523
+ * body of `specifiers`.
2524
+ */
2525
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
2526
+ }
2527
+ }
2528
+ interface UpdateRecurringCommit {
2529
+ recurring_commit_id: string;
2530
+ access_amount?: UpdateRecurringCommit.AccessAmount;
2531
+ ending_before?: string | null;
2532
+ invoice_amount?: UpdateRecurringCommit.InvoiceAmount;
2533
+ }
2534
+ namespace UpdateRecurringCommit {
2535
+ interface AccessAmount {
2536
+ quantity?: number;
2537
+ unit_price?: number;
2538
+ }
2539
+ interface InvoiceAmount {
2540
+ quantity?: number;
2541
+ unit_price?: number;
2542
+ }
2543
+ }
2544
+ interface UpdateRecurringCredit {
2545
+ recurring_credit_id: string;
2546
+ access_amount?: UpdateRecurringCredit.AccessAmount;
2547
+ ending_before?: string | null;
2548
+ }
2549
+ namespace UpdateRecurringCredit {
2550
+ interface AccessAmount {
2551
+ quantity?: number;
2552
+ unit_price?: number;
2553
+ }
2554
+ }
2555
+ interface UpdateScheduledCharge {
2556
+ scheduled_charge_id: string;
2557
+ invoice_schedule?: UpdateScheduledCharge.InvoiceSchedule;
2558
+ netsuite_sales_order_id?: string | null;
2559
+ }
2560
+ namespace UpdateScheduledCharge {
2561
+ interface InvoiceSchedule {
2562
+ add_schedule_items?: Array<InvoiceSchedule.AddScheduleItem>;
2563
+ remove_schedule_items?: Array<InvoiceSchedule.RemoveScheduleItem>;
2564
+ update_schedule_items?: Array<InvoiceSchedule.UpdateScheduleItem>;
2565
+ }
2566
+ namespace InvoiceSchedule {
2567
+ interface AddScheduleItem {
2568
+ timestamp: string;
2569
+ amount?: number;
2570
+ quantity?: number;
2571
+ unit_price?: number;
2572
+ }
2573
+ interface RemoveScheduleItem {
2574
+ id: string;
2575
+ }
2576
+ interface UpdateScheduleItem {
2577
+ id: string;
2578
+ amount?: number;
2579
+ quantity?: number;
2580
+ timestamp?: string;
2581
+ unit_price?: number;
2582
+ }
2583
+ }
2584
+ }
2585
+ interface UpdateSpendThresholdConfiguration {
2586
+ commit?: Shared.UpdateBaseThresholdCommit;
2587
+ /**
2588
+ * When set to false, the contract will not be evaluated against the
2589
+ * threshold_amount. Toggling to true will result an immediate evaluation,
2590
+ * regardless of prior state.
2591
+ */
2592
+ is_enabled?: boolean;
2593
+ payment_gate_config?: Shared.PaymentGateConfigV2;
2594
+ /**
2595
+ * Specify the threshold amount for the contract. Each time the contract's usage
2596
+ * hits this amount, a threshold charge will be initiated.
2597
+ */
2598
+ threshold_amount?: number;
2599
+ }
2600
+ interface UpdateSubscription {
2601
+ subscription_id: string;
2602
+ ending_before?: string | null;
2603
+ /**
2604
+ * Quantity changes are applied on the effective date based on the order which they
2605
+ * are sent. For example, if I scheduled the quantity to be 12 on May 21 and then
2606
+ * scheduled a quantity delta change of -1, the result from that day would be 11.
2607
+ */
2608
+ quantity_updates?: Array<UpdateSubscription.QuantityUpdate>;
2609
+ }
2610
+ namespace UpdateSubscription {
2611
+ interface QuantityUpdate {
2612
+ starting_at: string;
2613
+ /**
2614
+ * The new quantity for the subscription. Must be provided if quantity_delta is not
2615
+ * provided. Must be non-negative.
2616
+ */
2617
+ quantity?: number;
2618
+ /**
2619
+ * The delta to add to the subscription's quantity. Must be provided if quantity is
2620
+ * not provided. Can't be zero. It also can't result in a negative quantity on the
2621
+ * subscription.
2622
+ */
2623
+ quantity_delta?: number;
2624
+ }
2625
+ }
2626
+ }
2627
+ export interface ContractEditCommitParams {
2628
+ /**
2629
+ * ID of the commit to edit
2630
+ */
2631
+ commit_id: string;
2632
+ /**
2633
+ * ID of the customer whose commit is being edited
2634
+ */
2635
+ customer_id: string;
2636
+ access_schedule?: ContractEditCommitParams.AccessSchedule;
2637
+ /**
2638
+ * Which products the commit applies to. If applicable_product_ids,
2639
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2640
+ * all products.
2641
+ */
2642
+ applicable_product_ids?: Array<string> | null;
2643
+ /**
2644
+ * Which tags the commit applies to. If applicable_product_ids,
2645
+ * applicable_product_tags or specifiers are not provided, the commit applies to
2646
+ * all products.
2647
+ */
2648
+ applicable_product_tags?: Array<string> | null;
2649
+ /**
2650
+ * ID of contract to use for invoicing
2651
+ */
2652
+ invoice_contract_id?: string;
2653
+ invoice_schedule?: ContractEditCommitParams.InvoiceSchedule;
2654
+ /**
2655
+ * If multiple commits are applicable, the one with the lower priority will apply
2656
+ * first.
2657
+ */
2658
+ priority?: number | null;
2659
+ product_id?: string;
2660
+ /**
2661
+ * If provided, updates the commit to use the specified rate type for current and
2662
+ * future invoices. Previously finalized invoices will need to be voided and
2663
+ * regenerated to reflect the rate type change.
2664
+ */
2665
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
2666
+ /**
2667
+ * List of filters that determine what kind of customer usage draws down a commit
2668
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2669
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2670
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2671
+ * Instead, to target usage by product or product tag, pass those values in the
2672
+ * body of `specifiers`.
2673
+ */
2674
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
2675
+ }
2676
+ export declare namespace ContractEditCommitParams {
2677
+ interface AccessSchedule {
2678
+ add_schedule_items?: Array<AccessSchedule.AddScheduleItem>;
2679
+ remove_schedule_items?: Array<AccessSchedule.RemoveScheduleItem>;
2680
+ update_schedule_items?: Array<AccessSchedule.UpdateScheduleItem>;
2681
+ }
2682
+ namespace AccessSchedule {
2683
+ interface AddScheduleItem {
2684
+ amount: number;
2685
+ ending_before: string;
2686
+ starting_at: string;
2687
+ }
2688
+ interface RemoveScheduleItem {
2689
+ id: string;
2690
+ }
2691
+ interface UpdateScheduleItem {
2692
+ id: string;
2693
+ amount?: number;
2694
+ ending_before?: string;
2695
+ starting_at?: string;
2696
+ }
2697
+ }
2698
+ interface InvoiceSchedule {
2699
+ add_schedule_items?: Array<InvoiceSchedule.AddScheduleItem>;
2700
+ remove_schedule_items?: Array<InvoiceSchedule.RemoveScheduleItem>;
2701
+ update_schedule_items?: Array<InvoiceSchedule.UpdateScheduleItem>;
2702
+ }
2703
+ namespace InvoiceSchedule {
2704
+ interface AddScheduleItem {
2705
+ timestamp: string;
2706
+ amount?: number;
2707
+ quantity?: number;
2708
+ unit_price?: number;
2709
+ }
2710
+ interface RemoveScheduleItem {
2711
+ id: string;
2712
+ }
2713
+ interface UpdateScheduleItem {
2714
+ id: string;
2715
+ amount?: number;
2716
+ quantity?: number;
2717
+ timestamp?: string;
2718
+ unit_price?: number;
2719
+ }
2720
+ }
2721
+ }
2722
+ export interface ContractEditCreditParams {
2723
+ /**
2724
+ * ID of the credit to edit
2725
+ */
2726
+ credit_id: string;
2727
+ /**
2728
+ * ID of the customer whose credit is being edited
2729
+ */
2730
+ customer_id: string;
2731
+ access_schedule?: ContractEditCreditParams.AccessSchedule;
2732
+ /**
2733
+ * Which products the credit applies to. If both applicable_product_ids and
2734
+ * applicable_product_tags are not provided, the credit applies to all products.
2735
+ */
2736
+ applicable_product_ids?: Array<string> | null;
2737
+ /**
2738
+ * Which tags the credit applies to. If both applicable_product_ids and
2739
+ * applicable_product_tags are not provided, the credit applies to all products.
2740
+ */
2741
+ applicable_product_tags?: Array<string> | null;
2742
+ /**
2743
+ * If multiple commits are applicable, the one with the lower priority will apply
2744
+ * first.
2745
+ */
2746
+ priority?: number | null;
2747
+ product_id?: string;
2748
+ /**
2749
+ * If provided, updates the credit to use the specified rate type for current and
2750
+ * future invoices. Previously finalized invoices will need to be voided and
2751
+ * regenerated to reflect the rate type change.
2752
+ */
2753
+ rate_type?: 'LIST_RATE' | 'COMMIT_RATE';
2754
+ /**
2755
+ * List of filters that determine what kind of customer usage draws down a commit
2756
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2757
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2758
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2759
+ * Instead, to target usage by product or product tag, pass those values in the
2760
+ * body of `specifiers`.
2761
+ */
2762
+ specifiers?: Array<Shared.CommitSpecifierInput> | null;
2763
+ }
2764
+ export declare namespace ContractEditCreditParams {
2765
+ interface AccessSchedule {
2766
+ add_schedule_items?: Array<AccessSchedule.AddScheduleItem>;
2767
+ remove_schedule_items?: Array<AccessSchedule.RemoveScheduleItem>;
2768
+ update_schedule_items?: Array<AccessSchedule.UpdateScheduleItem>;
2769
+ }
2770
+ namespace AccessSchedule {
2771
+ interface AddScheduleItem {
2772
+ amount: number;
2773
+ ending_before: string;
2774
+ starting_at: string;
2775
+ }
2776
+ interface RemoveScheduleItem {
2777
+ id: string;
2778
+ }
2779
+ interface UpdateScheduleItem {
2780
+ id: string;
2781
+ amount?: number;
2782
+ ending_before?: string;
2783
+ starting_at?: string;
2784
+ }
2785
+ }
2786
+ }
2787
+ export interface ContractGetEditHistoryParams {
2788
+ contract_id: string;
2789
+ customer_id: string;
2790
+ }
2791
+ export declare namespace Contracts {
2792
+ export { type ContractRetrieveResponse as ContractRetrieveResponse, type ContractListResponse as ContractListResponse, type ContractEditResponse as ContractEditResponse, type ContractEditCommitResponse as ContractEditCommitResponse, type ContractEditCreditResponse as ContractEditCreditResponse, type ContractGetEditHistoryResponse as ContractGetEditHistoryResponse, type ContractRetrieveParams as ContractRetrieveParams, type ContractListParams as ContractListParams, type ContractEditParams as ContractEditParams, type ContractEditCommitParams as ContractEditCommitParams, type ContractEditCreditParams as ContractEditCreditParams, type ContractGetEditHistoryParams as ContractGetEditHistoryParams, };
2793
+ }
2794
+ //# sourceMappingURL=contracts.d.mts.map