@metronome/sdk 0.3.0 → 2.0.0

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