@metronome/sdk 0.2.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (808) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/README.md +123 -51
  3. package/api-promise.d.mts +2 -0
  4. package/api-promise.d.mts.map +1 -0
  5. package/api-promise.d.ts +2 -0
  6. package/api-promise.d.ts.map +1 -0
  7. package/api-promise.js +6 -0
  8. package/api-promise.js.map +1 -0
  9. package/api-promise.mjs +2 -0
  10. package/api-promise.mjs.map +1 -0
  11. package/bin/cli +53 -0
  12. package/bin/migration-config.json +6 -0
  13. package/client.d.mts +232 -0
  14. package/client.d.mts.map +1 -0
  15. package/client.d.ts +232 -0
  16. package/client.d.ts.map +1 -0
  17. package/client.js +464 -0
  18. package/client.js.map +1 -0
  19. package/client.mjs +460 -0
  20. package/client.mjs.map +1 -0
  21. package/core/api-promise.d.mts +46 -0
  22. package/core/api-promise.d.mts.map +1 -0
  23. package/core/api-promise.d.ts +46 -0
  24. package/core/api-promise.d.ts.map +1 -0
  25. package/core/api-promise.js +74 -0
  26. package/core/api-promise.js.map +1 -0
  27. package/core/api-promise.mjs +70 -0
  28. package/core/api-promise.mjs.map +1 -0
  29. package/core/error.d.mts +46 -0
  30. package/core/error.d.mts.map +1 -0
  31. package/core/error.d.ts +46 -0
  32. package/core/error.d.ts.map +1 -0
  33. package/core/error.js +113 -0
  34. package/core/error.js.map +1 -0
  35. package/core/error.mjs +97 -0
  36. package/core/error.mjs.map +1 -0
  37. package/core/pagination.d.mts +137 -0
  38. package/core/pagination.d.mts.map +1 -0
  39. package/core/pagination.d.ts +137 -0
  40. package/core/pagination.d.ts.map +1 -0
  41. package/core/pagination.js +158 -0
  42. package/core/pagination.js.map +1 -0
  43. package/core/pagination.mjs +150 -0
  44. package/core/pagination.mjs.map +1 -0
  45. package/core/resource.d.mts +6 -0
  46. package/core/resource.d.mts.map +1 -0
  47. package/core/resource.d.ts +6 -0
  48. package/core/resource.d.ts.map +1 -0
  49. package/core/resource.js +11 -0
  50. package/core/resource.js.map +1 -0
  51. package/core/resource.mjs +7 -0
  52. package/core/resource.mjs.map +1 -0
  53. package/core/uploads.d.mts +3 -0
  54. package/core/uploads.d.mts.map +1 -0
  55. package/core/uploads.d.ts +3 -0
  56. package/core/uploads.d.ts.map +1 -0
  57. package/core/uploads.js +6 -0
  58. package/core/uploads.js.map +1 -0
  59. package/core/uploads.mjs +2 -0
  60. package/core/uploads.mjs.map +1 -0
  61. package/error.d.mts +2 -0
  62. package/error.d.mts.map +1 -0
  63. package/error.d.ts +1 -46
  64. package/error.d.ts.map +1 -1
  65. package/error.js +3 -110
  66. package/error.js.map +1 -1
  67. package/error.mjs +1 -96
  68. package/error.mjs.map +1 -1
  69. package/index.d.mts +7 -144
  70. package/index.d.mts.map +1 -0
  71. package/index.d.ts +6 -143
  72. package/index.d.ts.map +1 -1
  73. package/index.js +14 -120
  74. package/index.js.map +1 -1
  75. package/index.mjs +6 -93
  76. package/index.mjs.map +1 -1
  77. package/internal/builtin-types.d.mts +73 -0
  78. package/internal/builtin-types.d.mts.map +1 -0
  79. package/internal/builtin-types.d.ts +73 -0
  80. package/internal/builtin-types.d.ts.map +1 -0
  81. package/internal/builtin-types.js +4 -0
  82. package/internal/builtin-types.js.map +1 -0
  83. package/internal/builtin-types.mjs +3 -0
  84. package/internal/builtin-types.mjs.map +1 -0
  85. package/internal/detect-platform.d.mts +15 -0
  86. package/internal/detect-platform.d.mts.map +1 -0
  87. package/internal/detect-platform.d.ts +15 -0
  88. package/internal/detect-platform.d.ts.map +1 -0
  89. package/internal/detect-platform.js +162 -0
  90. package/internal/detect-platform.js.map +1 -0
  91. package/internal/detect-platform.mjs +157 -0
  92. package/internal/detect-platform.mjs.map +1 -0
  93. package/internal/errors.d.mts +3 -0
  94. package/internal/errors.d.mts.map +1 -0
  95. package/internal/errors.d.ts +3 -0
  96. package/internal/errors.d.ts.map +1 -0
  97. package/internal/errors.js +41 -0
  98. package/internal/errors.js.map +1 -0
  99. package/internal/errors.mjs +36 -0
  100. package/internal/errors.mjs.map +1 -0
  101. package/internal/headers.d.mts +26 -0
  102. package/internal/headers.d.mts.map +1 -0
  103. package/internal/headers.d.ts +26 -0
  104. package/internal/headers.d.ts.map +1 -0
  105. package/internal/headers.js +120 -0
  106. package/internal/headers.js.map +1 -0
  107. package/internal/headers.mjs +112 -0
  108. package/internal/headers.mjs.map +1 -0
  109. package/internal/parse.d.mts +12 -0
  110. package/internal/parse.d.mts.map +1 -0
  111. package/internal/parse.d.ts +12 -0
  112. package/internal/parse.d.ts.map +1 -0
  113. package/internal/parse.js +35 -0
  114. package/internal/parse.js.map +1 -0
  115. package/internal/parse.mjs +32 -0
  116. package/internal/parse.mjs.map +1 -0
  117. package/internal/qs/formats.d.mts +7 -0
  118. package/internal/qs/formats.d.mts.map +1 -0
  119. package/internal/qs/formats.d.ts +1 -0
  120. package/internal/qs/formats.d.ts.map +1 -1
  121. package/internal/qs/formats.js +4 -2
  122. package/internal/qs/formats.js.map +1 -1
  123. package/internal/qs/formats.mjs +2 -1
  124. package/internal/qs/formats.mjs.map +1 -1
  125. package/internal/qs/index.d.mts +10 -0
  126. package/internal/qs/index.d.mts.map +1 -0
  127. package/internal/qs/index.d.ts.map +1 -1
  128. package/internal/qs/stringify.d.mts +3 -0
  129. package/internal/qs/stringify.d.mts.map +1 -0
  130. package/internal/qs/stringify.d.ts.map +1 -1
  131. package/internal/qs/stringify.js +16 -19
  132. package/internal/qs/stringify.js.map +1 -1
  133. package/internal/qs/stringify.mjs +17 -19
  134. package/internal/qs/stringify.mjs.map +1 -1
  135. package/internal/qs/types.d.mts +57 -0
  136. package/internal/qs/types.d.mts.map +1 -0
  137. package/internal/qs/utils.d.mts +15 -0
  138. package/internal/qs/utils.d.mts.map +1 -0
  139. package/internal/qs/utils.d.ts +1 -0
  140. package/internal/qs/utils.d.ts.map +1 -1
  141. package/internal/qs/utils.js +22 -21
  142. package/internal/qs/utils.js.map +1 -1
  143. package/internal/qs/utils.mjs +12 -12
  144. package/internal/qs/utils.mjs.map +1 -1
  145. package/internal/request-options.d.mts +75 -0
  146. package/internal/request-options.d.mts.map +1 -0
  147. package/internal/request-options.d.ts +75 -0
  148. package/internal/request-options.d.ts.map +1 -0
  149. package/internal/request-options.js +14 -0
  150. package/internal/request-options.js.map +1 -0
  151. package/internal/request-options.mjs +10 -0
  152. package/internal/request-options.mjs.map +1 -0
  153. package/internal/shim-types.d.mts +17 -0
  154. package/internal/shim-types.d.mts.map +1 -0
  155. package/internal/shim-types.d.ts +17 -0
  156. package/internal/shim-types.d.ts.map +1 -0
  157. package/internal/shim-types.js +4 -0
  158. package/internal/shim-types.js.map +1 -0
  159. package/internal/shim-types.mjs +3 -0
  160. package/internal/shim-types.mjs.map +1 -0
  161. package/internal/shims.d.mts +20 -0
  162. package/internal/shims.d.mts.map +1 -0
  163. package/internal/shims.d.ts +20 -0
  164. package/internal/shims.d.ts.map +1 -0
  165. package/internal/shims.js +92 -0
  166. package/internal/shims.js.map +1 -0
  167. package/internal/shims.mjs +85 -0
  168. package/internal/shims.mjs.map +1 -0
  169. package/internal/to-file.d.mts +45 -0
  170. package/internal/to-file.d.mts.map +1 -0
  171. package/internal/to-file.d.ts +45 -0
  172. package/internal/to-file.d.ts.map +1 -0
  173. package/internal/to-file.js +91 -0
  174. package/internal/to-file.js.map +1 -0
  175. package/internal/to-file.mjs +88 -0
  176. package/internal/to-file.mjs.map +1 -0
  177. package/internal/tslib.js +81 -0
  178. package/internal/tslib.mjs +17 -0
  179. package/internal/types.d.mts +69 -0
  180. package/internal/types.d.mts.map +1 -0
  181. package/internal/types.d.ts +69 -0
  182. package/internal/types.d.ts.map +1 -0
  183. package/internal/types.js +4 -0
  184. package/internal/types.js.map +1 -0
  185. package/internal/types.mjs +3 -0
  186. package/internal/types.mjs.map +1 -0
  187. package/internal/uploads.d.mts +42 -0
  188. package/internal/uploads.d.mts.map +1 -0
  189. package/internal/uploads.d.ts +42 -0
  190. package/internal/uploads.d.ts.map +1 -0
  191. package/internal/uploads.js +141 -0
  192. package/internal/uploads.js.map +1 -0
  193. package/internal/uploads.mjs +131 -0
  194. package/internal/uploads.mjs.map +1 -0
  195. package/internal/utils/base64.d.mts +3 -0
  196. package/internal/utils/base64.d.mts.map +1 -0
  197. package/internal/utils/base64.d.ts +3 -0
  198. package/internal/utils/base64.d.ts.map +1 -0
  199. package/internal/utils/base64.js +38 -0
  200. package/internal/utils/base64.js.map +1 -0
  201. package/internal/utils/base64.mjs +33 -0
  202. package/internal/utils/base64.mjs.map +1 -0
  203. package/internal/utils/bytes.d.mts +4 -0
  204. package/internal/utils/bytes.d.mts.map +1 -0
  205. package/internal/utils/bytes.d.ts +4 -0
  206. package/internal/utils/bytes.d.ts.map +1 -0
  207. package/internal/utils/bytes.js +31 -0
  208. package/internal/utils/bytes.js.map +1 -0
  209. package/internal/utils/bytes.mjs +26 -0
  210. package/internal/utils/bytes.mjs.map +1 -0
  211. package/internal/utils/env.d.mts +9 -0
  212. package/internal/utils/env.d.mts.map +1 -0
  213. package/internal/utils/env.d.ts +9 -0
  214. package/internal/utils/env.d.ts.map +1 -0
  215. package/internal/utils/env.js +22 -0
  216. package/internal/utils/env.js.map +1 -0
  217. package/internal/utils/env.mjs +18 -0
  218. package/internal/utils/env.mjs.map +1 -0
  219. package/internal/utils/log.d.mts +37 -0
  220. package/internal/utils/log.d.mts.map +1 -0
  221. package/internal/utils/log.d.ts +37 -0
  222. package/internal/utils/log.d.ts.map +1 -0
  223. package/internal/utils/log.js +85 -0
  224. package/internal/utils/log.js.map +1 -0
  225. package/internal/utils/log.mjs +79 -0
  226. package/internal/utils/log.mjs.map +1 -0
  227. package/internal/utils/path.d.mts +15 -0
  228. package/internal/utils/path.d.mts.map +1 -0
  229. package/internal/utils/path.d.ts +15 -0
  230. package/internal/utils/path.d.ts.map +1 -0
  231. package/internal/utils/path.js +79 -0
  232. package/internal/utils/path.js.map +1 -0
  233. package/internal/utils/path.mjs +74 -0
  234. package/internal/utils/path.mjs.map +1 -0
  235. package/internal/utils/sleep.d.mts +2 -0
  236. package/internal/utils/sleep.d.mts.map +1 -0
  237. package/internal/utils/sleep.d.ts +2 -0
  238. package/internal/utils/sleep.d.ts.map +1 -0
  239. package/internal/utils/sleep.js +7 -0
  240. package/internal/utils/sleep.js.map +1 -0
  241. package/internal/utils/sleep.mjs +3 -0
  242. package/internal/utils/sleep.mjs.map +1 -0
  243. package/internal/utils/uuid.d.mts +5 -0
  244. package/internal/utils/uuid.d.mts.map +1 -0
  245. package/internal/utils/uuid.d.ts +5 -0
  246. package/internal/utils/uuid.d.ts.map +1 -0
  247. package/internal/utils/uuid.js +19 -0
  248. package/internal/utils/uuid.js.map +1 -0
  249. package/internal/utils/uuid.mjs +15 -0
  250. package/internal/utils/uuid.mjs.map +1 -0
  251. package/internal/utils/values.d.mts +18 -0
  252. package/internal/utils/values.d.mts.map +1 -0
  253. package/internal/utils/values.d.ts +18 -0
  254. package/internal/utils/values.d.ts.map +1 -0
  255. package/internal/utils/values.js +112 -0
  256. package/internal/utils/values.js.map +1 -0
  257. package/internal/utils/values.mjs +94 -0
  258. package/internal/utils/values.mjs.map +1 -0
  259. package/internal/utils.d.mts +7 -0
  260. package/internal/utils.d.mts.map +1 -0
  261. package/internal/utils.d.ts +7 -0
  262. package/internal/utils.d.ts.map +1 -0
  263. package/internal/utils.js +11 -0
  264. package/internal/utils.js.map +1 -0
  265. package/internal/utils.mjs +8 -0
  266. package/internal/utils.mjs.map +1 -0
  267. package/package.json +116 -64
  268. package/pagination.d.mts +2 -0
  269. package/pagination.d.mts.map +1 -0
  270. package/pagination.d.ts +1 -36
  271. package/pagination.d.ts.map +1 -1
  272. package/pagination.js +3 -40
  273. package/pagination.js.map +1 -1
  274. package/pagination.mjs +1 -38
  275. package/pagination.mjs.map +1 -1
  276. package/resource.d.mts +2 -0
  277. package/resource.d.mts.map +1 -0
  278. package/resource.d.ts +1 -5
  279. package/resource.d.ts.map +1 -1
  280. package/resource.js +3 -8
  281. package/resource.js.map +1 -1
  282. package/resource.mjs +1 -6
  283. package/resource.mjs.map +1 -1
  284. package/resources/index.d.mts +5 -0
  285. package/resources/index.d.mts.map +1 -0
  286. package/resources/index.d.ts.map +1 -1
  287. package/resources/index.js +2 -15
  288. package/resources/index.js.map +1 -1
  289. package/resources/shared.d.mts +2239 -0
  290. package/resources/shared.d.mts.map +1 -0
  291. package/resources/shared.d.ts +1409 -523
  292. package/resources/shared.d.ts.map +1 -1
  293. package/resources/v1/alerts.d.mts +203 -0
  294. package/resources/v1/alerts.d.mts.map +1 -0
  295. package/resources/v1/alerts.d.ts +78 -7
  296. package/resources/v1/alerts.d.ts.map +1 -1
  297. package/resources/v1/alerts.js +73 -3
  298. package/resources/v1/alerts.js.map +1 -1
  299. package/resources/v1/alerts.mjs +73 -3
  300. package/resources/v1/alerts.mjs.map +1 -1
  301. package/resources/v1/audit-logs.d.mts +108 -0
  302. package/resources/v1/audit-logs.d.mts.map +1 -0
  303. package/resources/v1/audit-logs.d.ts +45 -12
  304. package/resources/v1/audit-logs.d.ts.map +1 -1
  305. package/resources/v1/audit-logs.js +53 -12
  306. package/resources/v1/audit-logs.js.map +1 -1
  307. package/resources/v1/audit-logs.mjs +52 -10
  308. package/resources/v1/audit-logs.mjs.map +1 -1
  309. package/resources/v1/billable-metrics.d.mts +293 -0
  310. package/resources/v1/billable-metrics.d.mts.map +1 -0
  311. package/resources/v1/billable-metrics.d.ts +70 -15
  312. package/resources/v1/billable-metrics.d.ts.map +1 -1
  313. package/resources/v1/billable-metrics.js +70 -16
  314. package/resources/v1/billable-metrics.js.map +1 -1
  315. package/resources/v1/billable-metrics.mjs +69 -14
  316. package/resources/v1/billable-metrics.mjs.map +1 -1
  317. package/resources/v1/contracts/contracts.d.mts +2984 -0
  318. package/resources/v1/contracts/contracts.d.mts.map +1 -0
  319. package/resources/v1/contracts/contracts.d.ts +450 -1285
  320. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  321. package/resources/v1/contracts/contracts.js +268 -50
  322. package/resources/v1/contracts/contracts.js.map +1 -1
  323. package/resources/v1/contracts/contracts.mjs +266 -26
  324. package/resources/v1/contracts/contracts.mjs.map +1 -1
  325. package/resources/v1/contracts/index.d.mts +5 -0
  326. package/resources/v1/contracts/index.d.mts.map +1 -0
  327. package/resources/v1/contracts/index.d.ts +3 -3
  328. package/resources/v1/contracts/index.d.ts.map +1 -1
  329. package/resources/v1/contracts/index.js +1 -3
  330. package/resources/v1/contracts/index.js.map +1 -1
  331. package/resources/v1/contracts/index.mjs +2 -2
  332. package/resources/v1/contracts/index.mjs.map +1 -1
  333. package/resources/v1/contracts/named-schedules.d.mts +82 -0
  334. package/resources/v1/contracts/named-schedules.d.mts.map +1 -0
  335. package/resources/v1/contracts/named-schedules.d.ts +5 -4
  336. package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
  337. package/resources/v1/contracts/named-schedules.js +3 -2
  338. package/resources/v1/contracts/named-schedules.js.map +1 -1
  339. package/resources/v1/contracts/named-schedules.mjs +3 -2
  340. package/resources/v1/contracts/named-schedules.mjs.map +1 -1
  341. package/resources/v1/contracts/products.d.mts +502 -0
  342. package/resources/v1/contracts/products.d.mts.map +1 -0
  343. package/resources/v1/contracts/products.d.ts +47 -17
  344. package/resources/v1/contracts/products.d.ts.map +1 -1
  345. package/resources/v1/contracts/products.js +41 -17
  346. package/resources/v1/contracts/products.js.map +1 -1
  347. package/resources/v1/contracts/products.mjs +40 -15
  348. package/resources/v1/contracts/products.mjs.map +1 -1
  349. package/resources/v1/contracts/rate-cards/index.d.mts +5 -0
  350. package/resources/v1/contracts/rate-cards/index.d.mts.map +1 -0
  351. package/resources/v1/contracts/rate-cards/index.d.ts +2 -2
  352. package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
  353. package/resources/v1/contracts/rate-cards/index.js +1 -3
  354. package/resources/v1/contracts/rate-cards/index.js.map +1 -1
  355. package/resources/v1/contracts/rate-cards/index.mjs +2 -2
  356. package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
  357. package/resources/v1/contracts/rate-cards/named-schedules.d.mts +94 -0
  358. package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -0
  359. package/resources/v1/contracts/rate-cards/named-schedules.d.ts +5 -4
  360. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
  361. package/resources/v1/contracts/rate-cards/named-schedules.js +3 -2
  362. package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
  363. package/resources/v1/contracts/rate-cards/named-schedules.mjs +3 -2
  364. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
  365. package/resources/v1/contracts/rate-cards/product-orders.d.mts +85 -0
  366. package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -0
  367. package/resources/v1/contracts/rate-cards/product-orders.d.ts +12 -6
  368. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
  369. package/resources/v1/contracts/rate-cards/product-orders.js +8 -3
  370. package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
  371. package/resources/v1/contracts/rate-cards/product-orders.mjs +8 -3
  372. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
  373. package/resources/v1/contracts/rate-cards/rate-cards.d.mts +452 -0
  374. package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -0
  375. package/resources/v1/contracts/rate-cards/rate-cards.d.ts +134 -41
  376. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
  377. package/resources/v1/contracts/rate-cards/rate-cards.js +127 -47
  378. package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
  379. package/resources/v1/contracts/rate-cards/rate-cards.mjs +123 -20
  380. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
  381. package/resources/v1/contracts/rate-cards/rates.d.mts +382 -0
  382. package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -0
  383. package/resources/v1/contracts/rate-cards/rates.d.ts +25 -82
  384. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  385. package/resources/v1/contracts/rate-cards/rates.js +13 -9
  386. package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
  387. package/resources/v1/contracts/rate-cards/rates.mjs +12 -7
  388. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  389. package/resources/v1/contracts/rate-cards.d.mts +2 -0
  390. package/resources/v1/contracts/rate-cards.d.mts.map +1 -0
  391. package/resources/v1/contracts/rate-cards.d.ts.map +1 -1
  392. package/resources/v1/contracts/rate-cards.js +2 -15
  393. package/resources/v1/contracts/rate-cards.js.map +1 -1
  394. package/resources/v1/contracts.d.mts +2 -0
  395. package/resources/v1/contracts.d.mts.map +1 -0
  396. package/resources/v1/contracts.d.ts.map +1 -1
  397. package/resources/v1/contracts.js +2 -15
  398. package/resources/v1/contracts.js.map +1 -1
  399. package/resources/v1/credit-grants.d.mts +505 -0
  400. package/resources/v1/credit-grants.d.mts.map +1 -0
  401. package/resources/v1/credit-grants.d.ts +73 -74
  402. package/resources/v1/credit-grants.d.ts.map +1 -1
  403. package/resources/v1/credit-grants.js +52 -18
  404. package/resources/v1/credit-grants.js.map +1 -1
  405. package/resources/v1/credit-grants.mjs +51 -16
  406. package/resources/v1/credit-grants.mjs.map +1 -1
  407. package/resources/v1/custom-fields.d.mts +151 -0
  408. package/resources/v1/custom-fields.d.mts.map +1 -0
  409. package/resources/v1/custom-fields.d.ts +69 -38
  410. package/resources/v1/custom-fields.d.ts.map +1 -1
  411. package/resources/v1/custom-fields.js +66 -22
  412. package/resources/v1/custom-fields.js.map +1 -1
  413. package/resources/v1/custom-fields.mjs +66 -22
  414. package/resources/v1/custom-fields.mjs.map +1 -1
  415. package/resources/v1/customers/alerts.d.mts +288 -0
  416. package/resources/v1/customers/alerts.d.mts.map +1 -0
  417. package/resources/v1/customers/alerts.d.ts +128 -23
  418. package/resources/v1/customers/alerts.d.ts.map +1 -1
  419. package/resources/v1/customers/alerts.js +112 -10
  420. package/resources/v1/customers/alerts.js.map +1 -1
  421. package/resources/v1/customers/alerts.mjs +112 -10
  422. package/resources/v1/customers/alerts.mjs.map +1 -1
  423. package/resources/v1/customers/billing-config.d.mts +125 -0
  424. package/resources/v1/customers/billing-config.d.mts.map +1 -0
  425. package/resources/v1/customers/billing-config.d.ts +8 -7
  426. package/resources/v1/customers/billing-config.d.ts.map +1 -1
  427. package/resources/v1/customers/billing-config.js +8 -6
  428. package/resources/v1/customers/billing-config.js.map +1 -1
  429. package/resources/v1/customers/billing-config.mjs +8 -6
  430. package/resources/v1/customers/billing-config.mjs.map +1 -1
  431. package/resources/v1/customers/commits.d.mts +456 -0
  432. package/resources/v1/customers/commits.d.mts.map +1 -0
  433. package/resources/v1/customers/commits.d.ts +145 -47
  434. package/resources/v1/customers/commits.d.ts.map +1 -1
  435. package/resources/v1/customers/commits.js +132 -12
  436. package/resources/v1/customers/commits.js.map +1 -1
  437. package/resources/v1/customers/commits.mjs +132 -12
  438. package/resources/v1/customers/commits.mjs.map +1 -1
  439. package/resources/v1/customers/credits.d.mts +310 -0
  440. package/resources/v1/customers/credits.d.mts.map +1 -0
  441. package/resources/v1/customers/credits.d.ts +124 -46
  442. package/resources/v1/customers/credits.d.ts.map +1 -1
  443. package/resources/v1/customers/credits.js +116 -11
  444. package/resources/v1/customers/credits.js.map +1 -1
  445. package/resources/v1/customers/credits.mjs +116 -11
  446. package/resources/v1/customers/credits.mjs.map +1 -1
  447. package/resources/v1/customers/customers.d.mts +818 -0
  448. package/resources/v1/customers/customers.d.mts.map +1 -0
  449. package/resources/v1/customers/customers.d.ts +304 -41
  450. package/resources/v1/customers/customers.d.ts.map +1 -1
  451. package/resources/v1/customers/customers.js +214 -73
  452. package/resources/v1/customers/customers.js.map +1 -1
  453. package/resources/v1/customers/customers.mjs +207 -41
  454. package/resources/v1/customers/customers.mjs.map +1 -1
  455. package/resources/v1/customers/index.d.mts +9 -0
  456. package/resources/v1/customers/index.d.mts.map +1 -0
  457. package/resources/v1/customers/index.d.ts +6 -6
  458. package/resources/v1/customers/index.d.ts.map +1 -1
  459. package/resources/v1/customers/index.js +1 -8
  460. package/resources/v1/customers/index.js.map +1 -1
  461. package/resources/v1/customers/index.mjs +3 -3
  462. package/resources/v1/customers/index.mjs.map +1 -1
  463. package/resources/v1/customers/invoices.d.mts +710 -0
  464. package/resources/v1/customers/invoices.d.mts.map +1 -0
  465. package/resources/v1/customers/invoices.d.ts +196 -19
  466. package/resources/v1/customers/invoices.d.ts.map +1 -1
  467. package/resources/v1/customers/invoices.js +131 -22
  468. package/resources/v1/customers/invoices.js.map +1 -1
  469. package/resources/v1/customers/invoices.mjs +130 -19
  470. package/resources/v1/customers/invoices.mjs.map +1 -1
  471. package/resources/v1/customers/named-schedules.d.mts +82 -0
  472. package/resources/v1/customers/named-schedules.d.mts.map +1 -0
  473. package/resources/v1/customers/named-schedules.d.ts +5 -4
  474. package/resources/v1/customers/named-schedules.d.ts.map +1 -1
  475. package/resources/v1/customers/named-schedules.js +3 -2
  476. package/resources/v1/customers/named-schedules.js.map +1 -1
  477. package/resources/v1/customers/named-schedules.mjs +3 -2
  478. package/resources/v1/customers/named-schedules.mjs.map +1 -1
  479. package/resources/v1/customers/plans.d.mts +281 -0
  480. package/resources/v1/customers/plans.d.mts.map +1 -0
  481. package/resources/v1/customers/plans.d.ts +14 -12
  482. package/resources/v1/customers/plans.d.ts.map +1 -1
  483. package/resources/v1/customers/plans.js +8 -15
  484. package/resources/v1/customers/plans.js.map +1 -1
  485. package/resources/v1/customers/plans.mjs +7 -12
  486. package/resources/v1/customers/plans.mjs.map +1 -1
  487. package/resources/v1/customers.d.mts +2 -0
  488. package/resources/v1/customers.d.mts.map +1 -0
  489. package/resources/v1/customers.d.ts.map +1 -1
  490. package/resources/v1/customers.js +2 -15
  491. package/resources/v1/customers.js.map +1 -1
  492. package/resources/v1/dashboards.d.mts +133 -0
  493. package/resources/v1/dashboards.d.mts.map +1 -0
  494. package/resources/v1/dashboards.d.ts +33 -6
  495. package/resources/v1/dashboards.d.ts.map +1 -1
  496. package/resources/v1/dashboards.js +30 -4
  497. package/resources/v1/dashboards.js.map +1 -1
  498. package/resources/v1/dashboards.mjs +30 -4
  499. package/resources/v1/dashboards.mjs.map +1 -1
  500. package/resources/v1/index.d.mts +15 -0
  501. package/resources/v1/index.d.mts.map +1 -0
  502. package/resources/v1/index.d.ts +9 -9
  503. package/resources/v1/index.d.ts.map +1 -1
  504. package/resources/v1/index.js +1 -12
  505. package/resources/v1/index.js.map +1 -1
  506. package/resources/v1/index.mjs +7 -7
  507. package/resources/v1/index.mjs.map +1 -1
  508. package/resources/v1/invoices.d.mts +83 -0
  509. package/resources/v1/invoices.d.mts.map +1 -0
  510. package/resources/v1/invoices.d.ts +28 -6
  511. package/resources/v1/invoices.d.ts.map +1 -1
  512. package/resources/v1/invoices.js +24 -3
  513. package/resources/v1/invoices.js.map +1 -1
  514. package/resources/v1/invoices.mjs +24 -3
  515. package/resources/v1/invoices.mjs.map +1 -1
  516. package/resources/v1/plans.d.mts +240 -0
  517. package/resources/v1/plans.d.mts.map +1 -0
  518. package/resources/v1/plans.d.ts +24 -15
  519. package/resources/v1/plans.d.ts.map +1 -1
  520. package/resources/v1/plans.js +19 -26
  521. package/resources/v1/plans.js.map +1 -1
  522. package/resources/v1/plans.mjs +18 -22
  523. package/resources/v1/plans.mjs.map +1 -1
  524. package/resources/v1/pricing-units.d.mts +34 -0
  525. package/resources/v1/pricing-units.d.mts.map +1 -0
  526. package/resources/v1/pricing-units.d.ts +12 -9
  527. package/resources/v1/pricing-units.d.ts.map +1 -1
  528. package/resources/v1/pricing-units.js +20 -12
  529. package/resources/v1/pricing-units.js.map +1 -1
  530. package/resources/v1/pricing-units.mjs +19 -10
  531. package/resources/v1/pricing-units.mjs.map +1 -1
  532. package/resources/v1/services.d.mts +33 -0
  533. package/resources/v1/services.d.mts.map +1 -0
  534. package/resources/v1/services.d.ts +10 -7
  535. package/resources/v1/services.d.ts.map +1 -1
  536. package/resources/v1/services.js +7 -5
  537. package/resources/v1/services.js.map +1 -1
  538. package/resources/v1/services.mjs +7 -5
  539. package/resources/v1/services.mjs.map +1 -1
  540. package/resources/v1/usage.d.mts +488 -0
  541. package/resources/v1/usage.d.mts.map +1 -0
  542. package/resources/v1/usage.d.ts +220 -57
  543. package/resources/v1/usage.d.ts.map +1 -1
  544. package/resources/v1/usage.js +212 -26
  545. package/resources/v1/usage.js.map +1 -1
  546. package/resources/v1/usage.mjs +211 -24
  547. package/resources/v1/usage.mjs.map +1 -1
  548. package/resources/v1/v1.d.mts +58 -0
  549. package/resources/v1/v1.d.mts.map +1 -0
  550. package/resources/v1/v1.d.ts +15 -15
  551. package/resources/v1/v1.d.ts.map +1 -1
  552. package/resources/v1/v1.js +15 -48
  553. package/resources/v1/v1.js.map +1 -1
  554. package/resources/v1/v1.mjs +8 -19
  555. package/resources/v1/v1.mjs.map +1 -1
  556. package/resources/v1.d.mts +2 -0
  557. package/resources/v1.d.mts.map +1 -0
  558. package/resources/v1.d.ts.map +1 -1
  559. package/resources/v1.js +2 -15
  560. package/resources/v1.js.map +1 -1
  561. package/resources/v2/contracts.d.mts +2794 -0
  562. package/resources/v2/contracts.d.mts.map +1 -0
  563. package/resources/v2/contracts.d.ts +381 -3862
  564. package/resources/v2/contracts.d.ts.map +1 -1
  565. package/resources/v2/contracts.js +102 -12
  566. package/resources/v2/contracts.js.map +1 -1
  567. package/resources/v2/contracts.mjs +102 -12
  568. package/resources/v2/contracts.mjs.map +1 -1
  569. package/resources/v2/index.d.mts +3 -0
  570. package/resources/v2/index.d.mts.map +1 -0
  571. package/resources/v2/index.d.ts.map +1 -1
  572. package/resources/v2/v2.d.mts +10 -0
  573. package/resources/v2/v2.d.mts.map +1 -0
  574. package/resources/v2/v2.d.ts +1 -1
  575. package/resources/v2/v2.d.ts.map +1 -1
  576. package/resources/v2/v2.js +3 -25
  577. package/resources/v2/v2.js.map +1 -1
  578. package/resources/v2/v2.mjs +1 -1
  579. package/resources/v2.d.mts +2 -0
  580. package/resources/v2.d.mts.map +1 -0
  581. package/resources/v2.d.ts.map +1 -1
  582. package/resources/v2.js +2 -15
  583. package/resources/v2.js.map +1 -1
  584. package/resources/webhooks.d.mts +22 -0
  585. package/resources/webhooks.d.mts.map +1 -0
  586. package/resources/webhooks.d.ts +1 -1
  587. package/resources/webhooks.d.ts.map +1 -1
  588. package/resources/webhooks.js +3 -3
  589. package/resources/webhooks.js.map +1 -1
  590. package/resources/webhooks.mjs +1 -1
  591. package/resources/webhooks.mjs.map +1 -1
  592. package/resources.d.mts +2 -0
  593. package/resources.d.mts.map +1 -0
  594. package/resources.d.ts.map +1 -1
  595. package/resources.js +2 -15
  596. package/resources.js.map +1 -1
  597. package/src/api-promise.ts +2 -0
  598. package/src/client.ts +809 -0
  599. package/src/core/README.md +3 -0
  600. package/src/core/api-promise.ts +92 -0
  601. package/src/core/error.ts +130 -0
  602. package/src/core/pagination.ts +319 -0
  603. package/src/core/resource.ts +11 -0
  604. package/src/core/uploads.ts +2 -0
  605. package/src/error.ts +2 -130
  606. package/src/index.ts +6 -220
  607. package/src/internal/README.md +3 -0
  608. package/src/internal/builtin-types.ts +93 -0
  609. package/src/internal/detect-platform.ts +196 -0
  610. package/src/internal/errors.ts +33 -0
  611. package/src/internal/headers.ts +144 -0
  612. package/src/internal/parse.ts +50 -0
  613. package/src/internal/qs/formats.ts +3 -2
  614. package/src/internal/qs/index.ts +3 -3
  615. package/src/internal/qs/stringify.ts +18 -21
  616. package/src/internal/qs/utils.ts +16 -16
  617. package/src/internal/request-options.ts +91 -0
  618. package/src/internal/shim-types.ts +26 -0
  619. package/src/internal/shims.ts +107 -0
  620. package/src/internal/to-file.ts +154 -0
  621. package/src/internal/types.ts +95 -0
  622. package/src/internal/uploads.ts +187 -0
  623. package/src/internal/utils/base64.ts +40 -0
  624. package/src/internal/utils/bytes.ts +32 -0
  625. package/src/internal/utils/env.ts +18 -0
  626. package/src/internal/utils/log.ts +126 -0
  627. package/src/internal/utils/path.ts +88 -0
  628. package/src/internal/utils/sleep.ts +3 -0
  629. package/src/internal/utils/uuid.ts +17 -0
  630. package/src/internal/utils/values.ts +105 -0
  631. package/src/internal/utils.ts +8 -0
  632. package/src/pagination.ts +2 -82
  633. package/src/resource.ts +2 -11
  634. package/src/resources/index.ts +4 -4
  635. package/src/resources/shared.ts +1786 -520
  636. package/src/resources/v1/alerts.ts +79 -8
  637. package/src/resources/v1/audit-logs.ts +48 -26
  638. package/src/resources/v1/billable-metrics.ts +79 -34
  639. package/src/resources/v1/contracts/contracts.ts +518 -1622
  640. package/src/resources/v1/contracts/index.ts +7 -6
  641. package/src/resources/v1/contracts/named-schedules.ts +8 -6
  642. package/src/resources/v1/contracts/products.ts +52 -38
  643. package/src/resources/v1/contracts/rate-cards/index.ts +6 -6
  644. package/src/resources/v1/contracts/rate-cards/named-schedules.ts +8 -6
  645. package/src/resources/v1/contracts/rate-cards/product-orders.ts +13 -10
  646. package/src/resources/v1/contracts/rate-cards/rate-cards.ts +145 -72
  647. package/src/resources/v1/contracts/rate-cards/rates.ts +28 -98
  648. package/src/resources/v1/contracts/rate-cards.ts +1 -1
  649. package/src/resources/v1/contracts.ts +1 -1
  650. package/src/resources/v1/credit-grants.ts +100 -112
  651. package/src/resources/v1/custom-fields.ts +106 -74
  652. package/src/resources/v1/customers/alerts.ts +147 -28
  653. package/src/resources/v1/customers/billing-config.ts +27 -13
  654. package/src/resources/v1/customers/commits.ts +153 -54
  655. package/src/resources/v1/customers/credits.ts +131 -53
  656. package/src/resources/v1/customers/customers.ts +390 -101
  657. package/src/resources/v1/customers/index.ts +19 -18
  658. package/src/resources/v1/customers/invoices.ts +206 -37
  659. package/src/resources/v1/customers/named-schedules.ts +8 -6
  660. package/src/resources/v1/customers/plans.ts +24 -22
  661. package/src/resources/v1/customers.ts +1 -1
  662. package/src/resources/v1/dashboards.ts +34 -7
  663. package/src/resources/v1/index.ts +32 -25
  664. package/src/resources/v1/invoices.ts +28 -9
  665. package/src/resources/v1/plans.ts +42 -43
  666. package/src/resources/v1/pricing-units.ts +15 -23
  667. package/src/resources/v1/services.ts +10 -7
  668. package/src/resources/v1/usage.ts +244 -72
  669. package/src/resources/v1/v1.ts +52 -49
  670. package/src/resources/v1.ts +1 -1
  671. package/src/resources/v2/contracts.ts +431 -4967
  672. package/src/resources/v2/index.ts +2 -2
  673. package/src/resources/v2/v2.ts +3 -3
  674. package/src/resources/v2.ts +1 -1
  675. package/src/resources/webhooks.ts +2 -2
  676. package/src/resources.ts +1 -1
  677. package/src/tsconfig.json +2 -2
  678. package/src/uploads.ts +2 -255
  679. package/src/version.ts +1 -1
  680. package/uploads.d.mts +2 -0
  681. package/uploads.d.mts.map +1 -0
  682. package/uploads.d.ts +1 -74
  683. package/uploads.d.ts.map +1 -1
  684. package/uploads.js +3 -168
  685. package/uploads.js.map +1 -1
  686. package/uploads.mjs +1 -157
  687. package/uploads.mjs.map +1 -1
  688. package/version.d.mts +2 -0
  689. package/version.d.mts.map +1 -0
  690. package/version.d.ts +1 -1
  691. package/version.js +1 -1
  692. package/version.mjs +1 -1
  693. package/_shims/MultipartBody.d.ts +0 -9
  694. package/_shims/MultipartBody.d.ts.map +0 -1
  695. package/_shims/MultipartBody.js +0 -16
  696. package/_shims/MultipartBody.js.map +0 -1
  697. package/_shims/MultipartBody.mjs +0 -12
  698. package/_shims/MultipartBody.mjs.map +0 -1
  699. package/_shims/README.md +0 -46
  700. package/_shims/auto/runtime-bun.d.ts +0 -5
  701. package/_shims/auto/runtime-bun.d.ts.map +0 -1
  702. package/_shims/auto/runtime-bun.js +0 -21
  703. package/_shims/auto/runtime-bun.js.map +0 -1
  704. package/_shims/auto/runtime-bun.mjs +0 -2
  705. package/_shims/auto/runtime-bun.mjs.map +0 -1
  706. package/_shims/auto/runtime-node.d.ts +0 -5
  707. package/_shims/auto/runtime-node.d.ts.map +0 -1
  708. package/_shims/auto/runtime-node.js +0 -21
  709. package/_shims/auto/runtime-node.js.map +0 -1
  710. package/_shims/auto/runtime-node.mjs +0 -2
  711. package/_shims/auto/runtime-node.mjs.map +0 -1
  712. package/_shims/auto/runtime.d.ts +0 -5
  713. package/_shims/auto/runtime.d.ts.map +0 -1
  714. package/_shims/auto/runtime.js +0 -21
  715. package/_shims/auto/runtime.js.map +0 -1
  716. package/_shims/auto/runtime.mjs +0 -2
  717. package/_shims/auto/runtime.mjs.map +0 -1
  718. package/_shims/auto/types-node.d.ts +0 -5
  719. package/_shims/auto/types-node.d.ts.map +0 -1
  720. package/_shims/auto/types-node.js +0 -21
  721. package/_shims/auto/types-node.js.map +0 -1
  722. package/_shims/auto/types-node.mjs +0 -2
  723. package/_shims/auto/types-node.mjs.map +0 -1
  724. package/_shims/auto/types.d.ts +0 -101
  725. package/_shims/auto/types.js +0 -3
  726. package/_shims/auto/types.mjs +0 -3
  727. package/_shims/bun-runtime.d.ts +0 -6
  728. package/_shims/bun-runtime.d.ts.map +0 -1
  729. package/_shims/bun-runtime.js +0 -14
  730. package/_shims/bun-runtime.js.map +0 -1
  731. package/_shims/bun-runtime.mjs +0 -10
  732. package/_shims/bun-runtime.mjs.map +0 -1
  733. package/_shims/index.d.ts +0 -83
  734. package/_shims/index.js +0 -17
  735. package/_shims/index.mjs +0 -11
  736. package/_shims/manual-types.d.ts +0 -12
  737. package/_shims/manual-types.js +0 -3
  738. package/_shims/manual-types.mjs +0 -3
  739. package/_shims/node-runtime.d.ts +0 -3
  740. package/_shims/node-runtime.d.ts.map +0 -1
  741. package/_shims/node-runtime.js +0 -89
  742. package/_shims/node-runtime.js.map +0 -1
  743. package/_shims/node-runtime.mjs +0 -56
  744. package/_shims/node-runtime.mjs.map +0 -1
  745. package/_shims/node-types.d.ts +0 -42
  746. package/_shims/node-types.js +0 -3
  747. package/_shims/node-types.mjs +0 -3
  748. package/_shims/registry.d.ts +0 -37
  749. package/_shims/registry.d.ts.map +0 -1
  750. package/_shims/registry.js +0 -41
  751. package/_shims/registry.js.map +0 -1
  752. package/_shims/registry.mjs +0 -37
  753. package/_shims/registry.mjs.map +0 -1
  754. package/_shims/web-runtime.d.ts +0 -5
  755. package/_shims/web-runtime.d.ts.map +0 -1
  756. package/_shims/web-runtime.js +0 -78
  757. package/_shims/web-runtime.js.map +0 -1
  758. package/_shims/web-runtime.mjs +0 -71
  759. package/_shims/web-runtime.mjs.map +0 -1
  760. package/_shims/web-types.d.ts +0 -83
  761. package/_shims/web-types.js +0 -3
  762. package/_shims/web-types.mjs +0 -3
  763. package/core.d.ts +0 -255
  764. package/core.d.ts.map +0 -1
  765. package/core.js +0 -924
  766. package/core.js.map +0 -1
  767. package/core.mjs +0 -892
  768. package/core.mjs.map +0 -1
  769. package/shims/node.d.ts +0 -30
  770. package/shims/node.d.ts.map +0 -1
  771. package/shims/node.js +0 -31
  772. package/shims/node.js.map +0 -1
  773. package/shims/node.mjs +0 -5
  774. package/shims/node.mjs.map +0 -1
  775. package/shims/web.d.ts +0 -26
  776. package/shims/web.d.ts.map +0 -1
  777. package/shims/web.js +0 -31
  778. package/shims/web.js.map +0 -1
  779. package/shims/web.mjs +0 -5
  780. package/shims/web.mjs.map +0 -1
  781. package/src/_shims/MultipartBody.ts +0 -9
  782. package/src/_shims/README.md +0 -46
  783. package/src/_shims/auto/runtime-bun.ts +0 -4
  784. package/src/_shims/auto/runtime-node.ts +0 -4
  785. package/src/_shims/auto/runtime.ts +0 -4
  786. package/src/_shims/auto/types-node.ts +0 -4
  787. package/src/_shims/auto/types.d.ts +0 -101
  788. package/src/_shims/auto/types.js +0 -3
  789. package/src/_shims/auto/types.mjs +0 -3
  790. package/src/_shims/bun-runtime.ts +0 -14
  791. package/src/_shims/index.d.ts +0 -83
  792. package/src/_shims/index.js +0 -17
  793. package/src/_shims/index.mjs +0 -11
  794. package/src/_shims/manual-types.d.ts +0 -12
  795. package/src/_shims/manual-types.js +0 -3
  796. package/src/_shims/manual-types.mjs +0 -3
  797. package/src/_shims/node-runtime.ts +0 -81
  798. package/src/_shims/node-types.d.ts +0 -42
  799. package/src/_shims/node-types.js +0 -3
  800. package/src/_shims/node-types.mjs +0 -3
  801. package/src/_shims/registry.ts +0 -67
  802. package/src/_shims/web-runtime.ts +0 -103
  803. package/src/_shims/web-types.d.ts +0 -83
  804. package/src/_shims/web-types.js +0 -3
  805. package/src/_shims/web-types.mjs +0 -3
  806. package/src/core.ts +0 -1236
  807. package/src/shims/node.ts +0 -50
  808. package/src/shims/web.ts +0 -50
@@ -1,16 +1,15 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from "../../../resource.js";
4
- import * as Core from "../../../core.js";
5
- import * as Shared from "../../shared.js";
6
- import * as NamedSchedulesAPI from "./named-schedules.js";
3
+ import { APIResource } from '../../../core/resource';
4
+ import * as Shared from '../../shared';
5
+ import * as NamedSchedulesAPI from './named-schedules';
7
6
  import {
8
7
  NamedScheduleRetrieveParams,
9
8
  NamedScheduleRetrieveResponse,
10
9
  NamedScheduleUpdateParams,
11
10
  NamedSchedules,
12
- } from "./named-schedules.js";
13
- import * as ProductsAPI from "./products.js";
11
+ } from './named-schedules';
12
+ import * as ProductsAPI from './products';
14
13
  import {
15
14
  ProductArchiveParams,
16
15
  ProductArchiveResponse,
@@ -27,9 +26,9 @@ import {
27
26
  Products,
28
27
  QuantityConversion,
29
28
  QuantityRounding,
30
- } from "./products.js";
31
- import * as InvoicesAPI from "../customers/invoices.js";
32
- import * as RateCardsAPI from "./rate-cards/rate-cards.js";
29
+ } from './products';
30
+ import * as InvoicesAPI from '../customers/invoices';
31
+ import * as RateCardsAPI from './rate-cards/rate-cards';
33
32
  import {
34
33
  RateCardArchiveParams,
35
34
  RateCardArchiveResponse,
@@ -45,7 +44,11 @@ import {
45
44
  RateCardUpdateParams,
46
45
  RateCardUpdateResponse,
47
46
  RateCards,
48
- } from "./rate-cards/rate-cards.js";
47
+ } from './rate-cards/rate-cards';
48
+ import { APIPromise } from '../../../core/api-promise';
49
+ import { BodyCursorPage, type BodyCursorPageParams, PagePromise } from '../../../core/pagination';
50
+ import { buildHeaders } from '../../../internal/headers';
51
+ import { RequestOptions } from '../../../internal/request-options';
49
52
 
50
53
  export class Contracts extends APIResource {
51
54
  products: ProductsAPI.Products = new ProductsAPI.Products(this._client);
@@ -53,7 +56,129 @@ export class Contracts extends APIResource {
53
56
  namedSchedules: NamedSchedulesAPI.NamedSchedules = new NamedSchedulesAPI.NamedSchedules(this._client);
54
57
 
55
58
  /**
56
- * Create a new contract
59
+ * Contracts define a customer's products, pricing, discounts, access duration, and
60
+ * billing configuration. Contracts serve as the central billing agreement for both
61
+ * PLG and Enterprise customers, you can automatically customers access to your
62
+ * products and services directly from your product or CRM.
63
+ *
64
+ * ### Use this endpoint to:
65
+ *
66
+ * - PLG onboarding: Automatically provision new self-serve customers with
67
+ * contracts when they sign up.
68
+ * - Enterprise sales: Push negotiated contracts from Salesforce with custom
69
+ * pricing and commitments
70
+ * - Promotional pricing: Implement time-limited discounts and free trials through
71
+ * overrides
72
+ *
73
+ * ### Key components:
74
+ *
75
+ * #### Contract Term and Billing Schedule
76
+ *
77
+ * - Set contract duration using `starting_at` and `ending_before` fields. PLG
78
+ * contracts typically use perpetual agreements (no end date), while Enterprise
79
+ * contracts have fixed end dates which can be edited over time in the case of
80
+ * co-term upsells.
81
+ *
82
+ * #### Rate Card
83
+ *
84
+ * If you are offering usage based pricing, you can set a rate card for the
85
+ * contract to reference through `rate_card_id` or `rate_card_alias`. The rate card
86
+ * is a store of all of your usage based products and their centralized pricing.
87
+ * Any new products or price changes on the rate card can be set to automatically
88
+ * propagate to all associated contracts - this ensures consistent pricing and
89
+ * product launches flow to contracts without manual updates and migrations. The
90
+ * `usage_statement_schedule` determines the cadence on which Metronome will
91
+ * finalize a usage invoice for the customer. This defaults to monthly on the 1st,
92
+ * with options for custom dates, quarterly, or annual cadences. Note: Most usage
93
+ * based billing companies align usage statements to be evaluated aligned to the
94
+ * first of the month. Read more about
95
+ * [Rate Cards](https://docs.metronome.com/pricing-packaging/create-manage-rate-cards/).
96
+ *
97
+ * #### Overrides and discounts
98
+ *
99
+ * Customize pricing on the contract through time-bounded overrides that can target
100
+ * specific products, product families, or complex usage scenarios. Overrides
101
+ * enable two key capabilities:
102
+ *
103
+ * - Discounts: Apply percentage discounts, fixed rate reductions, or
104
+ * quantity-based pricing tiers
105
+ * - Entitlements: Provide special pricing or access to specific products for
106
+ * negotiated deals
107
+ *
108
+ * Read more about
109
+ * [Contract Overrides](https://docs.metronome.com/manage-product-access/add-contract-override/).
110
+ *
111
+ * #### Commits and Credits
112
+ *
113
+ * Using commits, configure prepaid or postpaid spending commitments where
114
+ * customers promise to spend a certain amount over the contract period paid in
115
+ * advance or in arrears. Use credits to provide free spending allowances. Under
116
+ * the hood these are the same mechanisms, however, credits are typically offered
117
+ * for free (SLA or promotional) or as a part of an allotment associated with a
118
+ * Subscription.
119
+ *
120
+ * In Metronome, you can set commits and credits to only be applicable for a subset
121
+ * of usage. Use `applicable_product_ids` or `applicable_product_tags` to create
122
+ * product or product-family specific commits or credits, or you can build complex
123
+ * boolean logic specifiers to target usage based on pricing and presentation group
124
+ * values using `override_specifiers`.
125
+ *
126
+ * These objects can also also be configured to have a recurrence schedule to
127
+ * easily model customer packaging which includes recurring monthly or quarterly
128
+ * allotments.
129
+ *
130
+ * Commits support rollover settings (`rollover_fraction`) to transfer unused
131
+ * balances between contract periods, either entirely or as a percentage.
132
+ *
133
+ * Read more about
134
+ * [Credits and Commits](https://docs.metronome.com/pricing-packaging/apply-credits-commits/).
135
+ *
136
+ * #### Subscriptions
137
+ *
138
+ * You can add a fixed recurring charge to a contract, like monthly licenses or
139
+ * seat-based fees, using the subscription charge. Subscription charges are defined
140
+ * on your rate card and you can select which subscription is applicable to add to
141
+ * each contract. When you add a subscription to a contract you need to:
142
+ *
143
+ * - Define whether the subscription is paid for in-advance or in-arrears
144
+ * (`collection_schedule`)
145
+ * - Define the proration behavior (`proration`)
146
+ * - Specify an initial quantity (`initial_quantity`)
147
+ * - Define which subscription rate on the rate card should be used
148
+ * (`subscription_rate`)
149
+ *
150
+ * Read more about
151
+ * [Subscriptions](https://docs.metronome.com/manage-product-access/create-subscription/).
152
+ *
153
+ * #### Scheduled Charges
154
+ *
155
+ * Set up one-time, recurring, or entirely custom charges that occur on specific
156
+ * dates, separate from usage-based billing or commitments. These can be used to
157
+ * model non-recurring platform charges or professional services.
158
+ *
159
+ * #### Threshold Billing
160
+ *
161
+ * Metronome allows you to configure automatic billing triggers when customers
162
+ * reach spending thresholds to prevent fraud and manage risk. You can use
163
+ * `spend_threshold_configuration` to trigger an invoice to cover current charges
164
+ * whenever the threshold is reached or you can ensure the customer maintains a
165
+ * minimum prepaid balance using the `prepaid_balance_configuration`.
166
+ *
167
+ * Read more about
168
+ * [Spend Threshold](https://docs.metronome.com/manage-product-access/spend-thresholds/)
169
+ * and
170
+ * [Prepaid Balance Thresholds](https://docs.metronome.com/manage-product-access/prepaid-balance-thresholds/).
171
+ *
172
+ * ### Usage guidelines:
173
+ *
174
+ * - You can always
175
+ * [Edit Contracts](https://docs.metronome.com/manage-product-access/edit-contract/)
176
+ * after it has been created, using the `editContract` endpoint. Metronome keeps
177
+ * track of all edits, both in the audit log and over the `getEditHistory`
178
+ * endpoint.
179
+ * - Customers in Metronome can have multiple concurrent contracts at one time. Use
180
+ * `usage_filters` to route the correct usage to each contract.
181
+ * [Read more about usage filters](https://docs.metronome.com/manage-product-access/provision-customer/#create-a-usage-filter).
57
182
  *
58
183
  * @example
59
184
  * ```ts
@@ -68,7 +193,7 @@ export class Contracts extends APIResource {
68
193
  * });
69
194
  * ```
70
195
  */
71
- create(body: ContractCreateParams, options?: Core.RequestOptions): Core.APIPromise<ContractCreateResponse> {
196
+ create(body: ContractCreateParams, options?: RequestOptions): APIPromise<ContractCreateResponse> {
72
197
  return this._client.post('/v1/contracts/create', { body, ...options });
73
198
  }
74
199
 
@@ -84,16 +209,18 @@ export class Contracts extends APIResource {
84
209
  * });
85
210
  * ```
86
211
  */
87
- retrieve(
88
- body: ContractRetrieveParams,
89
- options?: Core.RequestOptions,
90
- ): Core.APIPromise<ContractRetrieveResponse> {
212
+ retrieve(body: ContractRetrieveParams, options?: RequestOptions): APIPromise<ContractRetrieveResponse> {
91
213
  return this._client.post('/v1/contracts/get', { body, ...options });
92
214
  }
93
215
 
94
216
  /**
95
- * This is the v1 endpoint to list all contracts for a customer. New clients should
96
- * implement using the v2 endpoint.
217
+ * Retrieves all contracts for a specific customer, including pricing, terms,
218
+ * credits, and commitments. Use this to view a customer's contract history and
219
+ * current agreements for billing management. Returns contract details with
220
+ * optional ledgers and balance information.
221
+ *
222
+ * ⚠️ Note: This is the legacy v1 endpoint - new integrations should use the v2
223
+ * endpoint for enhanced features.
97
224
  *
98
225
  * @example
99
226
  * ```ts
@@ -102,12 +229,29 @@ export class Contracts extends APIResource {
102
229
  * });
103
230
  * ```
104
231
  */
105
- list(body: ContractListParams, options?: Core.RequestOptions): Core.APIPromise<ContractListResponse> {
232
+ list(body: ContractListParams, options?: RequestOptions): APIPromise<ContractListResponse> {
106
233
  return this._client.post('/v1/contracts/list', { body, ...options });
107
234
  }
108
235
 
109
236
  /**
110
- * Add a manual balance entry
237
+ * Manually adjust the available balance on a commit or credit. This entry is
238
+ * appended to the commit ledger as a new event. Optionally include a description
239
+ * that provides the reasoning for the entry.
240
+ *
241
+ * ### Use this endpoint to:
242
+ *
243
+ * - Address incorrect usage burn-down caused by malformed usage or invalid config
244
+ * - Decrease available balance to account for outages where usage may have not
245
+ * been tracked or sent to Metronome
246
+ * - Issue credits to customers in the form of increased balance on existing commit
247
+ * or credit
248
+ *
249
+ * ### Usage guidelines:
250
+ *
251
+ * Manual ledger entries can be extremely useful for resolving discrepancies in
252
+ * Metronome. However, most corrections to inaccurate billings can be modified
253
+ * upstream of the commit, whether that is via contract editing, rate editing, or
254
+ * other actions that cause an invoice to be recalculated.
111
255
  *
112
256
  * @example
113
257
  * ```ts
@@ -123,18 +267,18 @@ export class Contracts extends APIResource {
123
267
  */
124
268
  addManualBalanceEntry(
125
269
  body: ContractAddManualBalanceEntryParams,
126
- options?: Core.RequestOptions,
127
- ): Core.APIPromise<void> {
270
+ options?: RequestOptions,
271
+ ): APIPromise<void> {
128
272
  return this._client.post('/v1/contracts/addManualBalanceLedgerEntry', {
129
273
  body,
130
274
  ...options,
131
- headers: { Accept: '*/*', ...options?.headers },
275
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
132
276
  });
133
277
  }
134
278
 
135
279
  /**
136
280
  * Amendments will be replaced by Contract editing. New clients should implement
137
- * using the editContract endpoint. Read more about the migration to contract
281
+ * using the `editContract` endpoint. Read more about the migration to contract
138
282
  * editing [here](https://docs.metronome.com/migrate-amendments-to-edits/) and
139
283
  * reach out to your Metronome representative for more details. Once contract
140
284
  * editing is enabled, access to this endpoint will be removed.
@@ -148,12 +292,31 @@ export class Contracts extends APIResource {
148
292
  * });
149
293
  * ```
150
294
  */
151
- amend(body: ContractAmendParams, options?: Core.RequestOptions): Core.APIPromise<ContractAmendResponse> {
295
+ amend(body: ContractAmendParams, options?: RequestOptions): APIPromise<ContractAmendResponse> {
152
296
  return this._client.post('/v1/contracts/amend', { body, ...options });
153
297
  }
154
298
 
155
299
  /**
156
- * Archive a contract
300
+ * Permanently end and archive a contract along with all its terms. Any draft
301
+ * invoices will be canceled, and all upcoming scheduled invoices will be
302
+ * voided–also all finalized invoices can optionally be voided. Use this in the
303
+ * event a contract was incorrectly created and needed to be removed from a
304
+ * customer.
305
+ *
306
+ * #### Impact on commits and credits:
307
+ *
308
+ * When archiving a contract, all associated commits and credits are also archived.
309
+ * For prepaid commits with active segments, Metronome automatically generates
310
+ * expiration ledger entries to close out any remaining balances, ensuring accurate
311
+ * accounting of unused prepaid amounts. These ledger entries will appear in the
312
+ * commit's transaction history with type `PREPAID_COMMIT_EXPIRATION`.
313
+ *
314
+ * #### Archived contract visibility:
315
+ *
316
+ * Archived contracts remain accessible for historical reporting and audit
317
+ * purposes. They can be retrieved using the `ListContracts` endpoint by setting
318
+ * the `include_archived` parameter to `true` or in the Metronome UI when the "Show
319
+ * archived" option is enabled.
157
320
  *
158
321
  * @example
159
322
  * ```ts
@@ -164,15 +327,16 @@ export class Contracts extends APIResource {
164
327
  * });
165
328
  * ```
166
329
  */
167
- archive(
168
- body: ContractArchiveParams,
169
- options?: Core.RequestOptions,
170
- ): Core.APIPromise<ContractArchiveResponse> {
330
+ archive(body: ContractArchiveParams, options?: RequestOptions): APIPromise<ContractArchiveResponse> {
171
331
  return this._client.post('/v1/contracts/archive', { body, ...options });
172
332
  }
173
333
 
174
334
  /**
175
- * Creates historical usage invoices for a contract
335
+ * Create historical usage invoices for past billing periods on specific contracts.
336
+ * Use this endpoint to generate retroactive invoices with custom usage line items,
337
+ * quantities, and date ranges. Supports preview mode to validate invoice data
338
+ * before creation. Ideal for billing migrations or correcting past billing
339
+ * periods.
176
340
  *
177
341
  * @example
178
342
  * ```ts
@@ -205,32 +369,80 @@ export class Contracts extends APIResource {
205
369
  */
206
370
  createHistoricalInvoices(
207
371
  body: ContractCreateHistoricalInvoicesParams,
208
- options?: Core.RequestOptions,
209
- ): Core.APIPromise<ContractCreateHistoricalInvoicesResponse> {
372
+ options?: RequestOptions,
373
+ ): APIPromise<ContractCreateHistoricalInvoicesResponse> {
210
374
  return this._client.post('/v1/contracts/createHistoricalInvoices', { body, ...options });
211
375
  }
212
376
 
213
377
  /**
214
- * List balances (commits and credits).
378
+ * Retrieve a comprehensive view of all available balances (commits and credits)
379
+ * for a customer. This endpoint provides real-time visibility into prepaid funds,
380
+ * postpaid commitments, promotional credits, and other balance types that can
381
+ * offset usage charges, helping you build transparent billing experiences.
382
+ *
383
+ * ### Use this endpoint to:
384
+ *
385
+ * - Display current available balances in customer dashboards
386
+ * - Verify available funds before approving high-usage operations
387
+ * - Generate balance reports for finance teams
388
+ * - Filter balances by contract or date ranges
389
+ *
390
+ * ### Key response fields:
391
+ *
392
+ * An array of balance objects (all credits and commits) containing:
393
+ *
394
+ * - Balance details: Current available amount for each commit or credit
395
+ * - Metadata: Product associations, priorities, applicable date ranges
396
+ * - Optional ledger entries: Detailed transaction history (if
397
+ * `include_ledgers=true`)
398
+ * - Balance calculations: Including pending transactions and future-dated entries
399
+ * - Custom fields: Any additional metadata attached to balances
400
+ *
401
+ * ### Usage guidelines:
402
+ *
403
+ * - Date filtering: Use `effective_before` to include only balances with access
404
+ * before a specific date (exclusive)
405
+ * - Set `include_balance=true` for calculated balance amounts on each commit or
406
+ * credit
407
+ * - Set `include_ledgers=true` for full transaction history
408
+ * - Set `include_contract_balances = true` to see contract level balances
409
+ * - Balance logic: Reflects currently accessible amounts, excluding expired/future
410
+ * segments
411
+ * - Manual adjustments: Includes all manual ledger entries, even future-dated ones
215
412
  *
216
413
  * @example
217
414
  * ```ts
218
- * const response = await client.v1.contracts.listBalances({
219
- * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
220
- * id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
221
- * include_ledgers: true,
222
- * });
415
+ * // Automatically fetches more pages as needed.
416
+ * for await (const contractListBalancesResponse of client.v1.contracts.listBalances(
417
+ * {
418
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
419
+ * id: '6162d87b-e5db-4a33-b7f2-76ce6ead4e85',
420
+ * include_ledgers: true,
421
+ * },
422
+ * )) {
423
+ * // ...
424
+ * }
223
425
  * ```
224
426
  */
225
427
  listBalances(
226
428
  body: ContractListBalancesParams,
227
- options?: Core.RequestOptions,
228
- ): Core.APIPromise<ContractListBalancesResponse> {
229
- return this._client.post('/v1/contracts/customerBalances/list', { body, ...options });
429
+ options?: RequestOptions,
430
+ ): PagePromise<ContractListBalancesResponsesBodyCursorPage, ContractListBalancesResponse> {
431
+ return this._client.getAPIList(
432
+ '/v1/contracts/customerBalances/list',
433
+ BodyCursorPage<ContractListBalancesResponse>,
434
+ { body, method: 'post', ...options },
435
+ );
230
436
  }
231
437
 
232
438
  /**
233
- * Get the rate schedule for the rate card on a given contract.
439
+ * For a specific customer and contract, get the rates at a specific point in time.
440
+ * This endpoint takes the contract's rate card into consideration, including
441
+ * scheduled changes. It also takes into account overrides on the contract.
442
+ *
443
+ * For example, if you want to show your customer a summary of the prices they are
444
+ * paying, inclusive of any negotiated discounts or promotions, use this endpoint.
445
+ * This endpoint only returns rates that are entitled.
234
446
  *
235
447
  * @example
236
448
  * ```ts
@@ -253,8 +465,8 @@ export class Contracts extends APIResource {
253
465
  */
254
466
  retrieveRateSchedule(
255
467
  params: ContractRetrieveRateScheduleParams,
256
- options?: Core.RequestOptions,
257
- ): Core.APIPromise<ContractRetrieveRateScheduleResponse> {
468
+ options?: RequestOptions,
469
+ ): APIPromise<ContractRetrieveRateScheduleResponse> {
258
470
  const { limit, next_page, ...body } = params;
259
471
  return this._client.post('/v1/contracts/getContractRateSchedule', {
260
472
  query: { limit, next_page },
@@ -264,8 +476,16 @@ export class Contracts extends APIResource {
264
476
  }
265
477
 
266
478
  /**
267
- * Fetch the quantity and price for a subscription over time. End-point does not
268
- * return future scheduled changes.
479
+ * Get the history of subscription quantities and prices over time for a given
480
+ * `subscription_id`. This endpoint can be used to power an in-product experience
481
+ * where you show a customer their historical changes to seat count. Future changes
482
+ * are not included in this endpoint - use the `getContract` endpoint to view the
483
+ * future scheduled changes to a subscription's quantity.
484
+ *
485
+ * Subscriptions are used to model fixed recurring fees as well as seat-based
486
+ * recurring fees. To model changes to the number of seats in Metronome, you can
487
+ * increment or decrement the quantity on a subscription at any point in the past
488
+ * or future.
269
489
  *
270
490
  * @example
271
491
  * ```ts
@@ -282,8 +502,8 @@ export class Contracts extends APIResource {
282
502
  */
283
503
  retrieveSubscriptionQuantityHistory(
284
504
  body: ContractRetrieveSubscriptionQuantityHistoryParams,
285
- options?: Core.RequestOptions,
286
- ): Core.APIPromise<ContractRetrieveSubscriptionQuantityHistoryResponse> {
505
+ options?: RequestOptions,
506
+ ): APIPromise<ContractRetrieveSubscriptionQuantityHistoryResponse> {
287
507
  return this._client.post('/v1/contracts/getSubscriptionQuantityHistory', { body, ...options });
288
508
  }
289
509
 
@@ -302,992 +522,93 @@ export class Contracts extends APIResource {
302
522
  * {
303
523
  * professional_service_id:
304
524
  * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
305
- * },
306
- * ],
307
- * });
308
- * ```
309
- */
310
- scheduleProServicesInvoice(
311
- body: ContractScheduleProServicesInvoiceParams,
312
- options?: Core.RequestOptions,
313
- ): Core.APIPromise<ContractScheduleProServicesInvoiceResponse> {
314
- return this._client.post('/v1/contracts/scheduleProServicesInvoice', { body, ...options });
315
- }
316
-
317
- /**
318
- * Set usage filter for a contract
319
- *
320
- * @example
321
- * ```ts
322
- * await client.v1.contracts.setUsageFilter({
323
- * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
324
- * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
325
- * group_key: 'business_subscription_id',
326
- * group_values: ['ID-1', 'ID-2'],
327
- * starting_at: '2020-01-01T00:00:00.000Z',
328
- * });
329
- * ```
330
- */
331
- setUsageFilter(body: ContractSetUsageFilterParams, options?: Core.RequestOptions): Core.APIPromise<void> {
332
- return this._client.post('/v1/contracts/setUsageFilter', {
333
- body,
334
- ...options,
335
- headers: { Accept: '*/*', ...options?.headers },
336
- });
337
- }
338
-
339
- /**
340
- * Update the end date of a contract
341
- *
342
- * @example
343
- * ```ts
344
- * const response = await client.v1.contracts.updateEndDate({
345
- * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
346
- * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
347
- * ending_before: '2020-01-01T00:00:00.000Z',
348
- * });
349
- * ```
350
- */
351
- updateEndDate(
352
- body: ContractUpdateEndDateParams,
353
- options?: Core.RequestOptions,
354
- ): Core.APIPromise<ContractUpdateEndDateResponse> {
355
- return this._client.post('/v1/contracts/updateEndDate', { body, ...options });
356
- }
357
- }
358
-
359
- export interface ContractCreateResponse {
360
- data: Shared.ID;
361
- }
362
-
363
- export interface ContractRetrieveResponse {
364
- data: ContractRetrieveResponse.Data;
365
- }
366
-
367
- export namespace ContractRetrieveResponse {
368
- export interface Data {
369
- id: string;
370
-
371
- amendments: Array<Data.Amendment>;
372
-
373
- current: Shared.ContractWithoutAmendments;
374
-
375
- customer_id: string;
376
-
377
- initial: Shared.ContractWithoutAmendments;
378
-
379
- /**
380
- * RFC 3339 timestamp indicating when the contract was archived. If not returned,
381
- * the contract is not archived.
382
- */
383
- archived_at?: string;
384
-
385
- custom_fields?: { [key: string]: string };
386
-
387
- /**
388
- * The billing provider configuration associated with a contract.
389
- */
390
- customer_billing_provider_configuration?: Data.CustomerBillingProviderConfiguration;
391
-
392
- prepaid_balance_threshold_configuration?: Data.PrepaidBalanceThresholdConfiguration;
393
-
394
- /**
395
- * Priority of the contract.
396
- */
397
- priority?: number;
398
-
399
- /**
400
- * Determines which scheduled and commit charges to consolidate onto the Contract's
401
- * usage invoice. The charge's `timestamp` must match the usage invoice's
402
- * `ending_before` date for consolidation to occur. This field cannot be modified
403
- * after a Contract has been created. If this field is omitted, charges will appear
404
- * on a separate invoice from usage charges.
405
- */
406
- scheduled_charges_on_usage_invoices?: 'ALL';
407
-
408
- spend_threshold_configuration?: Data.SpendThresholdConfiguration;
409
-
410
- /**
411
- * List of subscriptions on the contract.
412
- */
413
- subscriptions?: Array<Data.Subscription>;
414
-
415
- /**
416
- * Prevents the creation of duplicates. If a request to create a record is made
417
- * with a previously used uniqueness key, a new record will not be created and the
418
- * request will fail with a 409 error.
419
- */
420
- uniqueness_key?: string;
421
- }
422
-
423
- export namespace Data {
424
- export interface Amendment {
425
- id: string;
426
-
427
- commits: Array<Shared.Commit>;
428
-
429
- created_at: string;
430
-
431
- created_by: string;
432
-
433
- overrides: Array<Shared.Override>;
434
-
435
- scheduled_charges: Array<Shared.ScheduledCharge>;
436
-
437
- starting_at: string;
438
-
439
- credits?: Array<Shared.Credit>;
440
-
441
- /**
442
- * This field's availability is dependent on your client's configuration.
443
- */
444
- discounts?: Array<Shared.Discount>;
445
-
446
- /**
447
- * This field's availability is dependent on your client's configuration.
448
- */
449
- netsuite_sales_order_id?: string;
450
-
451
- /**
452
- * This field's availability is dependent on your client's configuration.
453
- */
454
- professional_services?: Array<Shared.ProService>;
455
-
456
- /**
457
- * This field's availability is dependent on your client's configuration.
458
- */
459
- reseller_royalties?: Array<Amendment.ResellerRoyalty>;
460
-
461
- /**
462
- * This field's availability is dependent on your client's configuration.
463
- */
464
- salesforce_opportunity_id?: string;
465
- }
466
-
467
- export namespace Amendment {
468
- export interface ResellerRoyalty {
469
- reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
470
-
471
- aws_account_number?: string;
472
-
473
- aws_offer_id?: string;
474
-
475
- aws_payer_reference_id?: string;
476
-
477
- ending_before?: string | null;
478
-
479
- fraction?: number;
480
-
481
- gcp_account_id?: string;
482
-
483
- gcp_offer_id?: string;
484
-
485
- netsuite_reseller_id?: string;
486
-
487
- reseller_contract_value?: number;
488
-
489
- starting_at?: string;
490
- }
491
- }
492
-
493
- /**
494
- * The billing provider configuration associated with a contract.
495
- */
496
- export interface CustomerBillingProviderConfiguration {
497
- billing_provider:
498
- | 'aws_marketplace'
499
- | 'stripe'
500
- | 'netsuite'
501
- | 'custom'
502
- | 'azure_marketplace'
503
- | 'quickbooks_online'
504
- | 'workday'
505
- | 'gcp_marketplace';
506
-
507
- delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
508
-
509
- id?: string;
510
-
511
- /**
512
- * Configuration for the billing provider. The structure of this object is specific
513
- * to the billing provider.
514
- */
515
- configuration?: { [key: string]: unknown };
516
- }
517
-
518
- export interface PrepaidBalanceThresholdConfiguration {
519
- commit: PrepaidBalanceThresholdConfiguration.Commit;
520
-
521
- /**
522
- * When set to false, the contract will not be evaluated against the
523
- * threshold_amount. Toggling to true will result an immediate evaluation,
524
- * regardless of prior state.
525
- */
526
- is_enabled: boolean;
527
-
528
- payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
529
-
530
- /**
531
- * Specify the amount the balance should be recharged to.
532
- */
533
- recharge_to_amount: number;
534
-
535
- /**
536
- * Specify the threshold amount for the contract. Each time the contract's prepaid
537
- * balance lowers to this amount, a threshold charge will be initiated.
538
- */
539
- threshold_amount: number;
540
-
541
- /**
542
- * If provided, the threshold, recharge-to amount, and the resulting threshold
543
- * commit amount will be in terms of this credit type instead of the fiat currency.
544
- */
545
- custom_credit_type_id?: string;
546
- }
547
-
548
- export namespace PrepaidBalanceThresholdConfiguration {
549
- export interface Commit {
550
- /**
551
- * The commit product that will be used to generate the line item for commit
552
- * payment.
553
- */
554
- product_id: string;
555
-
556
- /**
557
- * Which products the threshold commit applies to. If applicable_product_ids,
558
- * applicable_product_tags or specifiers are not provided, the commit applies to
559
- * all products.
560
- */
561
- applicable_product_ids?: Array<string>;
562
-
563
- /**
564
- * Which tags the threshold commit applies to. If applicable_product_ids,
565
- * applicable_product_tags or specifiers are not provided, the commit applies to
566
- * all products.
567
- */
568
- applicable_product_tags?: Array<string>;
569
-
570
- description?: string;
571
-
572
- /**
573
- * Specify the name of the line item for the threshold charge. If left blank, it
574
- * will default to the commit product name.
575
- */
576
- name?: string;
577
-
578
- /**
579
- * List of filters that determine what kind of customer usage draws down a commit
580
- * or credit. A customer's usage needs to meet the condition of at least one of the
581
- * specifiers to contribute to a commit's or credit's drawdown. This field cannot
582
- * be used together with `applicable_product_ids` or `applicable_product_tags`.
583
- */
584
- specifiers?: Array<Commit.Specifier>;
585
- }
586
-
587
- export namespace Commit {
588
- export interface Specifier {
589
- presentation_group_values?: { [key: string]: string };
590
-
591
- pricing_group_values?: { [key: string]: string };
592
-
593
- /**
594
- * If provided, the specifier will only apply to the product with the specified ID.
595
- */
596
- product_id?: string;
597
-
598
- /**
599
- * If provided, the specifier will only apply to products with all the specified
600
- * tags.
601
- */
602
- product_tags?: Array<string>;
603
- }
604
- }
605
-
606
- export interface PaymentGateConfig {
607
- /**
608
- * Gate access to the commit balance based on successful collection of payment.
609
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
610
- * facilitate payment using your own payment integration. Select NONE if you do not
611
- * wish to payment gate the commit balance.
612
- */
613
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
614
-
615
- /**
616
- * Only applicable if using PRECALCULATED as your tax type.
617
- */
618
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
619
-
620
- /**
621
- * Only applicable if using STRIPE as your payment gate type.
622
- */
623
- stripe_config?: PaymentGateConfig.StripeConfig;
624
-
625
- /**
626
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
627
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
628
- * will default to NONE.
629
- */
630
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
631
- }
632
-
633
- export namespace PaymentGateConfig {
634
- /**
635
- * Only applicable if using PRECALCULATED as your tax type.
636
- */
637
- export interface PrecalculatedTaxConfig {
638
- /**
639
- * Amount of tax to be applied. This should be in the same currency and
640
- * denomination as the commit's invoice schedule
641
- */
642
- tax_amount: number;
643
-
644
- /**
645
- * Name of the tax to be applied. This may be used in an invoice line item
646
- * description.
647
- */
648
- tax_name?: string;
649
- }
650
-
651
- /**
652
- * Only applicable if using STRIPE as your payment gate type.
653
- */
654
- export interface StripeConfig {
655
- /**
656
- * If left blank, will default to INVOICE
657
- */
658
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
659
-
660
- /**
661
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
662
- * your payment type.
663
- */
664
- invoice_metadata?: { [key: string]: string };
665
- }
666
- }
667
- }
668
-
669
- export interface SpendThresholdConfiguration {
670
- commit: SpendThresholdConfiguration.Commit;
671
-
672
- /**
673
- * When set to false, the contract will not be evaluated against the
674
- * threshold_amount. Toggling to true will result an immediate evaluation,
675
- * regardless of prior state.
676
- */
677
- is_enabled: boolean;
678
-
679
- payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
680
-
681
- /**
682
- * Specify the threshold amount for the contract. Each time the contract's usage
683
- * hits this amount, a threshold charge will be initiated.
684
- */
685
- threshold_amount: number;
686
- }
687
-
688
- export namespace SpendThresholdConfiguration {
689
- export interface Commit {
690
- /**
691
- * The commit product that will be used to generate the line item for commit
692
- * payment.
693
- */
694
- product_id: string;
695
-
696
- description?: string;
697
-
698
- /**
699
- * Specify the name of the line item for the threshold charge. If left blank, it
700
- * will default to the commit product name.
701
- */
702
- name?: string;
703
- }
704
-
705
- export interface PaymentGateConfig {
706
- /**
707
- * Gate access to the commit balance based on successful collection of payment.
708
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
709
- * facilitate payment using your own payment integration. Select NONE if you do not
710
- * wish to payment gate the commit balance.
711
- */
712
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
713
-
714
- /**
715
- * Only applicable if using PRECALCULATED as your tax type.
716
- */
717
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
718
-
719
- /**
720
- * Only applicable if using STRIPE as your payment gate type.
721
- */
722
- stripe_config?: PaymentGateConfig.StripeConfig;
723
-
724
- /**
725
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
726
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
727
- * will default to NONE.
728
- */
729
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
730
- }
731
-
732
- export namespace PaymentGateConfig {
733
- /**
734
- * Only applicable if using PRECALCULATED as your tax type.
735
- */
736
- export interface PrecalculatedTaxConfig {
737
- /**
738
- * Amount of tax to be applied. This should be in the same currency and
739
- * denomination as the commit's invoice schedule
740
- */
741
- tax_amount: number;
742
-
743
- /**
744
- * Name of the tax to be applied. This may be used in an invoice line item
745
- * description.
746
- */
747
- tax_name?: string;
748
- }
749
-
750
- /**
751
- * Only applicable if using STRIPE as your payment gate type.
752
- */
753
- export interface StripeConfig {
754
- /**
755
- * If left blank, will default to INVOICE
756
- */
757
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
758
-
759
- /**
760
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
761
- * your payment type.
762
- */
763
- invoice_metadata?: { [key: string]: string };
764
- }
765
- }
766
- }
767
-
768
- export interface Subscription {
769
- collection_schedule: 'ADVANCE' | 'ARREARS';
770
-
771
- proration: Subscription.Proration;
772
-
773
- /**
774
- * List of quantity schedule items for the subscription. Only includes the current
775
- * quantity and future quantity changes.
776
- */
777
- quantity_schedule: Array<Subscription.QuantitySchedule>;
778
-
779
- starting_at: string;
780
-
781
- subscription_rate: Subscription.SubscriptionRate;
782
-
783
- id?: string;
784
-
785
- custom_fields?: { [key: string]: string };
786
-
787
- description?: string;
788
-
789
- ending_before?: string;
790
-
791
- fiat_credit_type_id?: string;
792
-
793
- name?: string;
794
- }
795
-
796
- export namespace Subscription {
797
- export interface Proration {
798
- invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
799
-
800
- is_prorated: boolean;
801
- }
802
-
803
- export interface QuantitySchedule {
804
- quantity: number;
805
-
806
- starting_at: string;
807
-
808
- ending_before?: string;
809
- }
810
-
811
- export interface SubscriptionRate {
812
- billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
813
-
814
- product: SubscriptionRate.Product;
815
- }
816
-
817
- export namespace SubscriptionRate {
818
- export interface Product {
819
- id: string;
820
-
821
- name: string;
822
- }
823
- }
824
- }
825
- }
826
- }
827
-
828
- export interface ContractListResponse {
829
- data: Array<ContractListResponse.Data>;
830
- }
831
-
832
- export namespace ContractListResponse {
833
- export interface Data {
834
- id: string;
835
-
836
- amendments: Array<Data.Amendment>;
837
-
838
- current: Shared.ContractWithoutAmendments;
839
-
840
- customer_id: string;
841
-
842
- initial: Shared.ContractWithoutAmendments;
843
-
844
- /**
845
- * RFC 3339 timestamp indicating when the contract was archived. If not returned,
846
- * the contract is not archived.
847
- */
848
- archived_at?: string;
849
-
850
- custom_fields?: { [key: string]: string };
851
-
852
- /**
853
- * The billing provider configuration associated with a contract.
854
- */
855
- customer_billing_provider_configuration?: Data.CustomerBillingProviderConfiguration;
856
-
857
- prepaid_balance_threshold_configuration?: Data.PrepaidBalanceThresholdConfiguration;
858
-
859
- /**
860
- * Priority of the contract.
861
- */
862
- priority?: number;
863
-
864
- /**
865
- * Determines which scheduled and commit charges to consolidate onto the Contract's
866
- * usage invoice. The charge's `timestamp` must match the usage invoice's
867
- * `ending_before` date for consolidation to occur. This field cannot be modified
868
- * after a Contract has been created. If this field is omitted, charges will appear
869
- * on a separate invoice from usage charges.
870
- */
871
- scheduled_charges_on_usage_invoices?: 'ALL';
872
-
873
- spend_threshold_configuration?: Data.SpendThresholdConfiguration;
874
-
875
- /**
876
- * List of subscriptions on the contract.
877
- */
878
- subscriptions?: Array<Data.Subscription>;
879
-
880
- /**
881
- * Prevents the creation of duplicates. If a request to create a record is made
882
- * with a previously used uniqueness key, a new record will not be created and the
883
- * request will fail with a 409 error.
884
- */
885
- uniqueness_key?: string;
886
- }
887
-
888
- export namespace Data {
889
- export interface Amendment {
890
- id: string;
891
-
892
- commits: Array<Shared.Commit>;
893
-
894
- created_at: string;
895
-
896
- created_by: string;
897
-
898
- overrides: Array<Shared.Override>;
899
-
900
- scheduled_charges: Array<Shared.ScheduledCharge>;
901
-
902
- starting_at: string;
903
-
904
- credits?: Array<Shared.Credit>;
905
-
906
- /**
907
- * This field's availability is dependent on your client's configuration.
908
- */
909
- discounts?: Array<Shared.Discount>;
910
-
911
- /**
912
- * This field's availability is dependent on your client's configuration.
913
- */
914
- netsuite_sales_order_id?: string;
915
-
916
- /**
917
- * This field's availability is dependent on your client's configuration.
918
- */
919
- professional_services?: Array<Shared.ProService>;
920
-
921
- /**
922
- * This field's availability is dependent on your client's configuration.
923
- */
924
- reseller_royalties?: Array<Amendment.ResellerRoyalty>;
925
-
926
- /**
927
- * This field's availability is dependent on your client's configuration.
928
- */
929
- salesforce_opportunity_id?: string;
930
- }
931
-
932
- export namespace Amendment {
933
- export interface ResellerRoyalty {
934
- reseller_type: 'AWS' | 'AWS_PRO_SERVICE' | 'GCP' | 'GCP_PRO_SERVICE';
935
-
936
- aws_account_number?: string;
937
-
938
- aws_offer_id?: string;
939
-
940
- aws_payer_reference_id?: string;
941
-
942
- ending_before?: string | null;
943
-
944
- fraction?: number;
945
-
946
- gcp_account_id?: string;
947
-
948
- gcp_offer_id?: string;
949
-
950
- netsuite_reseller_id?: string;
951
-
952
- reseller_contract_value?: number;
953
-
954
- starting_at?: string;
955
- }
956
- }
957
-
958
- /**
959
- * The billing provider configuration associated with a contract.
960
- */
961
- export interface CustomerBillingProviderConfiguration {
962
- billing_provider:
963
- | 'aws_marketplace'
964
- | 'stripe'
965
- | 'netsuite'
966
- | 'custom'
967
- | 'azure_marketplace'
968
- | 'quickbooks_online'
969
- | 'workday'
970
- | 'gcp_marketplace';
971
-
972
- delivery_method: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
973
-
974
- id?: string;
975
-
976
- /**
977
- * Configuration for the billing provider. The structure of this object is specific
978
- * to the billing provider.
979
- */
980
- configuration?: { [key: string]: unknown };
981
- }
982
-
983
- export interface PrepaidBalanceThresholdConfiguration {
984
- commit: PrepaidBalanceThresholdConfiguration.Commit;
985
-
986
- /**
987
- * When set to false, the contract will not be evaluated against the
988
- * threshold_amount. Toggling to true will result an immediate evaluation,
989
- * regardless of prior state.
990
- */
991
- is_enabled: boolean;
992
-
993
- payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
994
-
995
- /**
996
- * Specify the amount the balance should be recharged to.
997
- */
998
- recharge_to_amount: number;
999
-
1000
- /**
1001
- * Specify the threshold amount for the contract. Each time the contract's prepaid
1002
- * balance lowers to this amount, a threshold charge will be initiated.
1003
- */
1004
- threshold_amount: number;
1005
-
1006
- /**
1007
- * If provided, the threshold, recharge-to amount, and the resulting threshold
1008
- * commit amount will be in terms of this credit type instead of the fiat currency.
1009
- */
1010
- custom_credit_type_id?: string;
1011
- }
1012
-
1013
- export namespace PrepaidBalanceThresholdConfiguration {
1014
- export interface Commit {
1015
- /**
1016
- * The commit product that will be used to generate the line item for commit
1017
- * payment.
1018
- */
1019
- product_id: string;
1020
-
1021
- /**
1022
- * Which products the threshold commit applies to. If applicable_product_ids,
1023
- * applicable_product_tags or specifiers are not provided, the commit applies to
1024
- * all products.
1025
- */
1026
- applicable_product_ids?: Array<string>;
1027
-
1028
- /**
1029
- * Which tags the threshold commit applies to. If applicable_product_ids,
1030
- * applicable_product_tags or specifiers are not provided, the commit applies to
1031
- * all products.
1032
- */
1033
- applicable_product_tags?: Array<string>;
1034
-
1035
- description?: string;
1036
-
1037
- /**
1038
- * Specify the name of the line item for the threshold charge. If left blank, it
1039
- * will default to the commit product name.
1040
- */
1041
- name?: string;
1042
-
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
- */
1049
- specifiers?: Array<Commit.Specifier>;
1050
- }
1051
-
1052
- export namespace Commit {
1053
- export interface Specifier {
1054
- presentation_group_values?: { [key: string]: string };
1055
-
1056
- pricing_group_values?: { [key: string]: string };
1057
-
1058
- /**
1059
- * If provided, the specifier will only apply to the product with the specified ID.
1060
- */
1061
- product_id?: string;
1062
-
1063
- /**
1064
- * If provided, the specifier will only apply to products with all the specified
1065
- * tags.
1066
- */
1067
- product_tags?: Array<string>;
1068
- }
1069
- }
1070
-
1071
- export interface PaymentGateConfig {
1072
- /**
1073
- * Gate access to the commit balance based on successful collection of payment.
1074
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1075
- * facilitate payment using your own payment integration. Select NONE if you do not
1076
- * wish to payment gate the commit balance.
1077
- */
1078
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1079
-
1080
- /**
1081
- * Only applicable if using PRECALCULATED as your tax type.
1082
- */
1083
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1084
-
1085
- /**
1086
- * Only applicable if using STRIPE as your payment gate type.
1087
- */
1088
- stripe_config?: PaymentGateConfig.StripeConfig;
1089
-
1090
- /**
1091
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1092
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1093
- * will default to NONE.
1094
- */
1095
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1096
- }
1097
-
1098
- export namespace PaymentGateConfig {
1099
- /**
1100
- * Only applicable if using PRECALCULATED as your tax type.
1101
- */
1102
- export interface PrecalculatedTaxConfig {
1103
- /**
1104
- * Amount of tax to be applied. This should be in the same currency and
1105
- * denomination as the commit's invoice schedule
1106
- */
1107
- tax_amount: number;
1108
-
1109
- /**
1110
- * Name of the tax to be applied. This may be used in an invoice line item
1111
- * description.
1112
- */
1113
- tax_name?: string;
1114
- }
1115
-
1116
- /**
1117
- * Only applicable if using STRIPE as your payment gate type.
1118
- */
1119
- export interface StripeConfig {
1120
- /**
1121
- * If left blank, will default to INVOICE
1122
- */
1123
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1124
-
1125
- /**
1126
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1127
- * your payment type.
1128
- */
1129
- invoice_metadata?: { [key: string]: string };
1130
- }
1131
- }
1132
- }
1133
-
1134
- export interface SpendThresholdConfiguration {
1135
- commit: SpendThresholdConfiguration.Commit;
1136
-
1137
- /**
1138
- * When set to false, the contract will not be evaluated against the
1139
- * threshold_amount. Toggling to true will result an immediate evaluation,
1140
- * regardless of prior state.
1141
- */
1142
- is_enabled: boolean;
1143
-
1144
- payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
1145
-
1146
- /**
1147
- * Specify the threshold amount for the contract. Each time the contract's usage
1148
- * hits this amount, a threshold charge will be initiated.
1149
- */
1150
- threshold_amount: number;
1151
- }
1152
-
1153
- export namespace SpendThresholdConfiguration {
1154
- export interface Commit {
1155
- /**
1156
- * The commit product that will be used to generate the line item for commit
1157
- * payment.
1158
- */
1159
- product_id: string;
1160
-
1161
- description?: string;
1162
-
1163
- /**
1164
- * Specify the name of the line item for the threshold charge. If left blank, it
1165
- * will default to the commit product name.
1166
- */
1167
- name?: string;
1168
- }
1169
-
1170
- export interface PaymentGateConfig {
1171
- /**
1172
- * Gate access to the commit balance based on successful collection of payment.
1173
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
1174
- * facilitate payment using your own payment integration. Select NONE if you do not
1175
- * wish to payment gate the commit balance.
1176
- */
1177
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
1178
-
1179
- /**
1180
- * Only applicable if using PRECALCULATED as your tax type.
1181
- */
1182
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
1183
-
1184
- /**
1185
- * Only applicable if using STRIPE as your payment gate type.
1186
- */
1187
- stripe_config?: PaymentGateConfig.StripeConfig;
1188
-
1189
- /**
1190
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
1191
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
1192
- * will default to NONE.
1193
- */
1194
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
1195
- }
1196
-
1197
- export namespace PaymentGateConfig {
1198
- /**
1199
- * Only applicable if using PRECALCULATED as your tax type.
1200
- */
1201
- export interface PrecalculatedTaxConfig {
1202
- /**
1203
- * Amount of tax to be applied. This should be in the same currency and
1204
- * denomination as the commit's invoice schedule
1205
- */
1206
- tax_amount: number;
1207
-
1208
- /**
1209
- * Name of the tax to be applied. This may be used in an invoice line item
1210
- * description.
1211
- */
1212
- tax_name?: string;
1213
- }
1214
-
1215
- /**
1216
- * Only applicable if using STRIPE as your payment gate type.
1217
- */
1218
- export interface StripeConfig {
1219
- /**
1220
- * If left blank, will default to INVOICE
1221
- */
1222
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1223
-
1224
- /**
1225
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
1226
- * your payment type.
1227
- */
1228
- invoice_metadata?: { [key: string]: string };
1229
- }
1230
- }
1231
- }
1232
-
1233
- export interface Subscription {
1234
- collection_schedule: 'ADVANCE' | 'ARREARS';
1235
-
1236
- proration: Subscription.Proration;
1237
-
1238
- /**
1239
- * List of quantity schedule items for the subscription. Only includes the current
1240
- * quantity and future quantity changes.
1241
- */
1242
- quantity_schedule: Array<Subscription.QuantitySchedule>;
1243
-
1244
- starting_at: string;
1245
-
1246
- subscription_rate: Subscription.SubscriptionRate;
1247
-
1248
- id?: string;
1249
-
1250
- custom_fields?: { [key: string]: string };
1251
-
1252
- description?: string;
1253
-
1254
- ending_before?: string;
1255
-
1256
- fiat_credit_type_id?: string;
1257
-
1258
- name?: string;
1259
- }
1260
-
1261
- export namespace Subscription {
1262
- export interface Proration {
1263
- invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
1264
-
1265
- is_prorated: boolean;
1266
- }
1267
-
1268
- export interface QuantitySchedule {
1269
- quantity: number;
525
+ * },
526
+ * ],
527
+ * });
528
+ * ```
529
+ */
530
+ scheduleProServicesInvoice(
531
+ body: ContractScheduleProServicesInvoiceParams,
532
+ options?: RequestOptions,
533
+ ): APIPromise<ContractScheduleProServicesInvoiceResponse> {
534
+ return this._client.post('/v1/contracts/scheduleProServicesInvoice', { body, ...options });
535
+ }
1270
536
 
1271
- starting_at: string;
537
+ /**
538
+ * If a customer has multiple contracts with overlapping rates, the usage filter
539
+ * routes usage to the appropriate contract based on a predefined group key.
540
+ *
541
+ * As an example, imagine you have a customer associated with two projects. Each
542
+ * project is associated with its own contract. You can create a usage filter with
543
+ * group key `project_id` on each contract, and route usage for `project_1` to the
544
+ * first contract and `project_2` to the second contract.
545
+ *
546
+ * ### Use this endpoint to:
547
+ *
548
+ * - Support enterprise contracting scenarios where multiple contracts are
549
+ * associated to the same customer with the same rates.
550
+ * - Update the usage filter associated with the contract over time.
551
+ *
552
+ * ### Usage guidelines:
553
+ *
554
+ * To use usage filters, the `group_key` must be defined on the billable metrics
555
+ * underlying the rate card on the contracts.
556
+ *
557
+ * @example
558
+ * ```ts
559
+ * await client.v1.contracts.setUsageFilter({
560
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
561
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
562
+ * group_key: 'business_subscription_id',
563
+ * group_values: ['ID-1', 'ID-2'],
564
+ * starting_at: '2020-01-01T00:00:00.000Z',
565
+ * });
566
+ * ```
567
+ */
568
+ setUsageFilter(body: ContractSetUsageFilterParams, options?: RequestOptions): APIPromise<void> {
569
+ return this._client.post('/v1/contracts/setUsageFilter', {
570
+ body,
571
+ ...options,
572
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
573
+ });
574
+ }
1272
575
 
1273
- ending_before?: string;
1274
- }
576
+ /**
577
+ * Update or and an end date to a contract. Ending a contract early will impact
578
+ * draft usage statements, truncate any terms, and remove upcoming scheduled
579
+ * invoices. Moving the date into the future will only extend the contract length.
580
+ * Terms and scheduled invoices are not extended. Use this if a contract's end date
581
+ * has changed or if a perpetual contract ends.
582
+ *
583
+ * @example
584
+ * ```ts
585
+ * const response = await client.v1.contracts.updateEndDate({
586
+ * contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
587
+ * customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
588
+ * ending_before: '2020-01-01T00:00:00.000Z',
589
+ * });
590
+ * ```
591
+ */
592
+ updateEndDate(
593
+ body: ContractUpdateEndDateParams,
594
+ options?: RequestOptions,
595
+ ): APIPromise<ContractUpdateEndDateResponse> {
596
+ return this._client.post('/v1/contracts/updateEndDate', { body, ...options });
597
+ }
598
+ }
1275
599
 
1276
- export interface SubscriptionRate {
1277
- billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
600
+ export type ContractListBalancesResponsesBodyCursorPage = BodyCursorPage<ContractListBalancesResponse>;
1278
601
 
1279
- product: SubscriptionRate.Product;
1280
- }
602
+ export interface ContractCreateResponse {
603
+ data: Shared.ID;
604
+ }
1281
605
 
1282
- export namespace SubscriptionRate {
1283
- export interface Product {
1284
- id: string;
606
+ export interface ContractRetrieveResponse {
607
+ data: Shared.Contract;
608
+ }
1285
609
 
1286
- name: string;
1287
- }
1288
- }
1289
- }
1290
- }
610
+ export interface ContractListResponse {
611
+ data: Array<Shared.Contract>;
1291
612
  }
1292
613
 
1293
614
  export interface ContractAmendResponse {
@@ -1302,11 +623,7 @@ export interface ContractCreateHistoricalInvoicesResponse {
1302
623
  data: Array<InvoicesAPI.Invoice>;
1303
624
  }
1304
625
 
1305
- export interface ContractListBalancesResponse {
1306
- data: Array<Shared.Commit | Shared.Credit>;
1307
-
1308
- next_page: string | null;
1309
- }
626
+ export type ContractListBalancesResponse = Shared.Commit | Shared.Credit;
1310
627
 
1311
628
  export interface ContractRetrieveRateScheduleResponse {
1312
629
  data: Array<ContractRetrieveRateScheduleResponse.Data>;
@@ -1320,6 +637,9 @@ export namespace ContractRetrieveRateScheduleResponse {
1320
637
 
1321
638
  list_rate: Shared.Rate;
1322
639
 
640
+ /**
641
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
642
+ */
1323
643
  product_custom_fields: { [key: string]: string };
1324
644
 
1325
645
  product_id: string;
@@ -1338,7 +658,7 @@ export namespace ContractRetrieveRateScheduleResponse {
1338
658
  * A distinct rate on the rate card. You can choose to use this rate rather than
1339
659
  * list rate when consuming a credit or commit.
1340
660
  */
1341
- commit_rate?: Data.CommitRate;
661
+ commit_rate?: Shared.CommitRate;
1342
662
 
1343
663
  ending_before?: string;
1344
664
 
@@ -1346,26 +666,6 @@ export namespace ContractRetrieveRateScheduleResponse {
1346
666
 
1347
667
  pricing_group_values?: { [key: string]: string };
1348
668
  }
1349
-
1350
- export namespace Data {
1351
- /**
1352
- * A distinct rate on the rate card. You can choose to use this rate rather than
1353
- * list rate when consuming a credit or commit.
1354
- */
1355
- export interface CommitRate {
1356
- rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'CUSTOM';
1357
-
1358
- /**
1359
- * Commit rate price. For FLAT rate_type, this must be >=0.
1360
- */
1361
- price?: number;
1362
-
1363
- /**
1364
- * Only set for TIERED rate_type.
1365
- */
1366
- tiers?: Array<Shared.Tier>;
1367
- }
1368
- }
1369
669
  }
1370
670
 
1371
671
  export interface ContractRetrieveSubscriptionQuantityHistoryResponse {
@@ -1426,6 +726,9 @@ export interface ContractCreateParams {
1426
726
 
1427
727
  credits?: Array<ContractCreateParams.Credit>;
1428
728
 
729
+ /**
730
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
731
+ */
1429
732
  custom_fields?: { [key: string]: string };
1430
733
 
1431
734
  /**
@@ -1459,7 +762,7 @@ export interface ContractCreateParams {
1459
762
 
1460
763
  overrides?: Array<ContractCreateParams.Override>;
1461
764
 
1462
- prepaid_balance_threshold_configuration?: ContractCreateParams.PrepaidBalanceThresholdConfiguration;
765
+ prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfiguration;
1463
766
 
1464
767
  /**
1465
768
  * Priority of the contract.
@@ -1504,7 +807,7 @@ export interface ContractCreateParams {
1504
807
  */
1505
808
  scheduled_charges_on_usage_invoices?: 'ALL';
1506
809
 
1507
- spend_threshold_configuration?: ContractCreateParams.SpendThresholdConfiguration;
810
+ spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
1508
811
 
1509
812
  /**
1510
813
  * Optional list of
@@ -1587,6 +890,9 @@ export namespace ContractCreateParams {
1587
890
  */
1588
891
  applicable_product_tags?: Array<string>;
1589
892
 
893
+ /**
894
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
895
+ */
1590
896
  custom_fields?: { [key: string]: string };
1591
897
 
1592
898
  /**
@@ -1597,7 +903,7 @@ export namespace ContractCreateParams {
1597
903
  /**
1598
904
  * Optional configuration for commit hierarchy access control
1599
905
  */
1600
- hierarchy_configuration?: Commit.HierarchyConfiguration;
906
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1601
907
 
1602
908
  /**
1603
909
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
@@ -1641,7 +947,7 @@ export namespace ContractCreateParams {
1641
947
  * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1642
948
  * be used together with `applicable_product_ids` or `applicable_product_tags`.
1643
949
  */
1644
- specifiers?: Array<Commit.Specifier>;
950
+ specifiers?: Array<Shared.CommitSpecifierInput>;
1645
951
 
1646
952
  /**
1647
953
  * A temporary ID for the commit that can be used to reference the commit for
@@ -1681,32 +987,6 @@ export namespace ContractCreateParams {
1681
987
  }
1682
988
  }
1683
989
 
1684
- /**
1685
- * Optional configuration for commit hierarchy access control
1686
- */
1687
- export interface HierarchyConfiguration {
1688
- child_access:
1689
- | HierarchyConfiguration.CommitHierarchyChildAccessAll
1690
- | HierarchyConfiguration.CommitHierarchyChildAccessNone
1691
- | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1692
- }
1693
-
1694
- export namespace HierarchyConfiguration {
1695
- export interface CommitHierarchyChildAccessAll {
1696
- type: 'ALL';
1697
- }
1698
-
1699
- export interface CommitHierarchyChildAccessNone {
1700
- type: 'NONE';
1701
- }
1702
-
1703
- export interface CommitHierarchyChildAccessContractIDs {
1704
- contract_ids: Array<string>;
1705
-
1706
- type: 'CONTRACT_IDS';
1707
- }
1708
- }
1709
-
1710
990
  /**
1711
991
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
1712
992
  * time and only one schedule item is allowed; the total must match access_schedule
@@ -1719,6 +999,12 @@ export namespace ContractCreateParams {
1719
999
  */
1720
1000
  credit_type_id?: string;
1721
1001
 
1002
+ /**
1003
+ * This field is only applicable to commit invoice schedules. If true, this
1004
+ * schedule will not generate an invoice.
1005
+ */
1006
+ do_not_invoice?: boolean;
1007
+
1722
1008
  /**
1723
1009
  * Enter the unit price and quantity for the charge or instead only send the
1724
1010
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -1866,24 +1152,19 @@ export namespace ContractCreateParams {
1866
1152
  * your payment type.
1867
1153
  */
1868
1154
  invoice_metadata?: { [key: string]: string };
1869
- }
1870
- }
1871
-
1872
- export interface Specifier {
1873
- presentation_group_values?: { [key: string]: string };
1874
-
1875
- pricing_group_values?: { [key: string]: string };
1876
-
1877
- /**
1878
- * If provided, the specifier will only apply to the product with the specified ID.
1879
- */
1880
- product_id?: string;
1881
1155
 
1882
- /**
1883
- * If provided, the specifier will only apply to products with all the specified
1884
- * tags.
1885
- */
1886
- product_tags?: Array<string>;
1156
+ /**
1157
+ * If true, the payment will be made assuming the customer is present (i.e. on
1158
+ * session).
1159
+ *
1160
+ * If false, the payment will be made assuming the customer is not present (i.e.
1161
+ * off session). For cardholders from a country with an e-mandate requirement (e.g.
1162
+ * India), the payment may be declined.
1163
+ *
1164
+ * If left blank, will default to false.
1165
+ */
1166
+ on_session_payment?: boolean;
1167
+ }
1887
1168
  }
1888
1169
  }
1889
1170
 
@@ -1907,6 +1188,9 @@ export namespace ContractCreateParams {
1907
1188
  */
1908
1189
  applicable_product_tags?: Array<string>;
1909
1190
 
1191
+ /**
1192
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1193
+ */
1910
1194
  custom_fields?: { [key: string]: string };
1911
1195
 
1912
1196
  /**
@@ -1917,7 +1201,7 @@ export namespace ContractCreateParams {
1917
1201
  /**
1918
1202
  * Optional configuration for credit hierarchy access control
1919
1203
  */
1920
- hierarchy_configuration?: Credit.HierarchyConfiguration;
1204
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
1921
1205
 
1922
1206
  /**
1923
1207
  * displayed on invoices
@@ -1943,7 +1227,7 @@ export namespace ContractCreateParams {
1943
1227
  * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1944
1228
  * be used together with `applicable_product_ids` or `applicable_product_tags`.
1945
1229
  */
1946
- specifiers?: Array<Credit.Specifier>;
1230
+ specifiers?: Array<Shared.CommitSpecifierInput>;
1947
1231
  }
1948
1232
 
1949
1233
  export namespace Credit {
@@ -1974,49 +1258,6 @@ export namespace ContractCreateParams {
1974
1258
  starting_at: string;
1975
1259
  }
1976
1260
  }
1977
-
1978
- /**
1979
- * Optional configuration for credit hierarchy access control
1980
- */
1981
- export interface HierarchyConfiguration {
1982
- child_access:
1983
- | HierarchyConfiguration.CommitHierarchyChildAccessAll
1984
- | HierarchyConfiguration.CommitHierarchyChildAccessNone
1985
- | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
1986
- }
1987
-
1988
- export namespace HierarchyConfiguration {
1989
- export interface CommitHierarchyChildAccessAll {
1990
- type: 'ALL';
1991
- }
1992
-
1993
- export interface CommitHierarchyChildAccessNone {
1994
- type: 'NONE';
1995
- }
1996
-
1997
- export interface CommitHierarchyChildAccessContractIDs {
1998
- contract_ids: Array<string>;
1999
-
2000
- type: 'CONTRACT_IDS';
2001
- }
2002
- }
2003
-
2004
- export interface Specifier {
2005
- presentation_group_values?: { [key: string]: string };
2006
-
2007
- pricing_group_values?: { [key: string]: string };
2008
-
2009
- /**
2010
- * If provided, the specifier will only apply to the product with the specified ID.
2011
- */
2012
- product_id?: string;
2013
-
2014
- /**
2015
- * If provided, the specifier will only apply to products with all the specified
2016
- * tags.
2017
- */
2018
- product_tags?: Array<string>;
2019
- }
2020
1261
  }
2021
1262
 
2022
1263
  export interface Discount {
@@ -2027,6 +1268,9 @@ export namespace ContractCreateParams {
2027
1268
  */
2028
1269
  schedule: Discount.Schedule;
2029
1270
 
1271
+ /**
1272
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1273
+ */
2030
1274
  custom_fields?: { [key: string]: string };
2031
1275
 
2032
1276
  /**
@@ -2050,6 +1294,12 @@ export namespace ContractCreateParams {
2050
1294
  */
2051
1295
  credit_type_id?: string;
2052
1296
 
1297
+ /**
1298
+ * This field is only applicable to commit invoice schedules. If true, this
1299
+ * schedule will not generate an invoice.
1300
+ */
1301
+ do_not_invoice?: boolean;
1302
+
2053
1303
  /**
2054
1304
  * Enter the unit price and quantity for the charge or instead only send the
2055
1305
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -2229,8 +1479,8 @@ export namespace ContractCreateParams {
2229
1479
 
2230
1480
  /**
2231
1481
  * Can only be used for commit specific overrides. Must be used in conjunction with
2232
- * one of product_id, product_tags, pricing_group_values, or
2233
- * presentation_group_values. If provided, the override will only apply to the
1482
+ * one of `product_id`, `product_tags`, `pricing_group_values`, or
1483
+ * `presentation_group_values`. If provided, the override will only apply to the
2234
1484
  * specified commits. If not provided, the override will apply to all commits.
2235
1485
  */
2236
1486
  commit_ids?: Array<string>;
@@ -2260,17 +1510,17 @@ export namespace ContractCreateParams {
2260
1510
 
2261
1511
  /**
2262
1512
  * Can only be used for commit specific overrides. Must be used in conjunction with
2263
- * one of product_id, product_tags, pricing_group_values, or
2264
- * presentation_group_values. If provided, the override will only apply to commits
2265
- * created by the specified recurring commit ids.
1513
+ * one of `product_id`, `product_tags`, `pricing_group_values`, or
1514
+ * `presentation_group_values`. If provided, the override will only apply to
1515
+ * commits created by the specified recurring commit ids.
2266
1516
  */
2267
1517
  recurring_commit_ids?: Array<string>;
2268
1518
 
2269
1519
  /**
2270
1520
  * Can only be used for commit specific overrides. Must be used in conjunction with
2271
- * one of product_id, product_tags, pricing_group_values, or
2272
- * presentation_group_values. If provided, the override will only apply to credits
2273
- * created by the specified recurring credit ids.
1521
+ * one of `product_id`, `product_tags`, `pricing_group_values`, or
1522
+ * `presentation_group_values`. If provided, the override will only apply to
1523
+ * credits created by the specified recurring credit ids.
2274
1524
  */
2275
1525
  recurring_credit_ids?: Array<string>;
2276
1526
  }
@@ -2312,161 +1562,10 @@ export namespace ContractCreateParams {
2312
1562
  tiers?: Array<Shared.Tier>;
2313
1563
  }
2314
1564
 
2315
- export interface Tier {
2316
- multiplier: number;
2317
-
2318
- size?: number;
2319
- }
2320
- }
2321
-
2322
- export interface PrepaidBalanceThresholdConfiguration {
2323
- commit: PrepaidBalanceThresholdConfiguration.Commit;
2324
-
2325
- /**
2326
- * When set to false, the contract will not be evaluated against the
2327
- * threshold_amount. Toggling to true will result an immediate evaluation,
2328
- * regardless of prior state.
2329
- */
2330
- is_enabled: boolean;
2331
-
2332
- payment_gate_config: PrepaidBalanceThresholdConfiguration.PaymentGateConfig;
2333
-
2334
- /**
2335
- * Specify the amount the balance should be recharged to.
2336
- */
2337
- recharge_to_amount: number;
2338
-
2339
- /**
2340
- * Specify the threshold amount for the contract. Each time the contract's prepaid
2341
- * balance lowers to this amount, a threshold charge will be initiated.
2342
- */
2343
- threshold_amount: number;
2344
-
2345
- /**
2346
- * If provided, the threshold, recharge-to amount, and the resulting threshold
2347
- * commit amount will be in terms of this credit type instead of the fiat currency.
2348
- */
2349
- custom_credit_type_id?: string;
2350
- }
2351
-
2352
- export namespace PrepaidBalanceThresholdConfiguration {
2353
- export interface Commit {
2354
- /**
2355
- * The commit product that will be used to generate the line item for commit
2356
- * payment.
2357
- */
2358
- product_id: string;
2359
-
2360
- /**
2361
- * Which products the threshold commit applies to. If applicable_product_ids,
2362
- * applicable_product_tags or specifiers are not provided, the commit applies to
2363
- * all products.
2364
- */
2365
- applicable_product_ids?: Array<string>;
2366
-
2367
- /**
2368
- * Which tags the threshold commit applies to. If applicable_product_ids,
2369
- * applicable_product_tags or specifiers are not provided, the commit applies to
2370
- * all products.
2371
- */
2372
- applicable_product_tags?: Array<string>;
2373
-
2374
- description?: string;
2375
-
2376
- /**
2377
- * Specify the name of the line item for the threshold charge. If left blank, it
2378
- * will default to the commit product name.
2379
- */
2380
- name?: string;
2381
-
2382
- /**
2383
- * List of filters that determine what kind of customer usage draws down a commit
2384
- * or credit. A customer's usage needs to meet the condition of at least one of the
2385
- * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2386
- * be used together with `applicable_product_ids` or `applicable_product_tags`.
2387
- */
2388
- specifiers?: Array<Commit.Specifier>;
2389
- }
2390
-
2391
- export namespace Commit {
2392
- export interface Specifier {
2393
- presentation_group_values?: { [key: string]: string };
2394
-
2395
- pricing_group_values?: { [key: string]: string };
2396
-
2397
- /**
2398
- * If provided, the specifier will only apply to the product with the specified ID.
2399
- */
2400
- product_id?: string;
2401
-
2402
- /**
2403
- * If provided, the specifier will only apply to products with all the specified
2404
- * tags.
2405
- */
2406
- product_tags?: Array<string>;
2407
- }
2408
- }
2409
-
2410
- export interface PaymentGateConfig {
2411
- /**
2412
- * Gate access to the commit balance based on successful collection of payment.
2413
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
2414
- * facilitate payment using your own payment integration. Select NONE if you do not
2415
- * wish to payment gate the commit balance.
2416
- */
2417
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
2418
-
2419
- /**
2420
- * Only applicable if using PRECALCULATED as your tax type.
2421
- */
2422
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
2423
-
2424
- /**
2425
- * Only applicable if using STRIPE as your payment gate type.
2426
- */
2427
- stripe_config?: PaymentGateConfig.StripeConfig;
2428
-
2429
- /**
2430
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
2431
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
2432
- * will default to NONE.
2433
- */
2434
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
2435
- }
2436
-
2437
- export namespace PaymentGateConfig {
2438
- /**
2439
- * Only applicable if using PRECALCULATED as your tax type.
2440
- */
2441
- export interface PrecalculatedTaxConfig {
2442
- /**
2443
- * Amount of tax to be applied. This should be in the same currency and
2444
- * denomination as the commit's invoice schedule
2445
- */
2446
- tax_amount: number;
2447
-
2448
- /**
2449
- * Name of the tax to be applied. This may be used in an invoice line item
2450
- * description.
2451
- */
2452
- tax_name?: string;
2453
- }
2454
-
2455
- /**
2456
- * Only applicable if using STRIPE as your payment gate type.
2457
- */
2458
- export interface StripeConfig {
2459
- /**
2460
- * If left blank, will default to INVOICE
2461
- */
2462
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
1565
+ export interface Tier {
1566
+ multiplier: number;
2463
1567
 
2464
- /**
2465
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
2466
- * your payment type.
2467
- */
2468
- invoice_metadata?: { [key: string]: string };
2469
- }
1568
+ size?: number;
2470
1569
  }
2471
1570
  }
2472
1571
 
@@ -2490,6 +1589,9 @@ export namespace ContractCreateParams {
2490
1589
  */
2491
1590
  unit_price: number;
2492
1591
 
1592
+ /**
1593
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1594
+ */
2493
1595
  custom_fields?: { [key: string]: string };
2494
1596
 
2495
1597
  description?: string;
@@ -2548,7 +1650,7 @@ export namespace ContractCreateParams {
2548
1650
  /**
2549
1651
  * Optional configuration for recurring commit/credit hierarchy access control
2550
1652
  */
2551
- hierarchy_configuration?: RecurringCommit.HierarchyConfiguration;
1653
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
2552
1654
 
2553
1655
  /**
2554
1656
  * The amount the customer should be billed for the commit. Not required.
@@ -2598,7 +1700,7 @@ export namespace ContractCreateParams {
2598
1700
  * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2599
1701
  * be used together with `applicable_product_ids` or `applicable_product_tags`.
2600
1702
  */
2601
- specifiers?: Array<RecurringCommit.Specifier>;
1703
+ specifiers?: Array<Shared.CommitSpecifierInput>;
2602
1704
 
2603
1705
  /**
2604
1706
  * Attach a subscription to the recurring commit/credit.
@@ -2622,8 +1724,8 @@ export namespace ContractCreateParams {
2622
1724
  unit_price: number;
2623
1725
 
2624
1726
  /**
2625
- * This field is currently required. Upcoming recurring commit/credit configuration
2626
- * options will allow it to be optional.
1727
+ * This field is required unless a subscription is attached via
1728
+ * `subscription_config`.
2627
1729
  */
2628
1730
  quantity?: number;
2629
1731
  }
@@ -2639,32 +1741,6 @@ export namespace ContractCreateParams {
2639
1741
  unit?: 'PERIODS';
2640
1742
  }
2641
1743
 
2642
- /**
2643
- * Optional configuration for recurring commit/credit hierarchy access control
2644
- */
2645
- export interface HierarchyConfiguration {
2646
- child_access:
2647
- | HierarchyConfiguration.CommitHierarchyChildAccessAll
2648
- | HierarchyConfiguration.CommitHierarchyChildAccessNone
2649
- | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
2650
- }
2651
-
2652
- export namespace HierarchyConfiguration {
2653
- export interface CommitHierarchyChildAccessAll {
2654
- type: 'ALL';
2655
- }
2656
-
2657
- export interface CommitHierarchyChildAccessNone {
2658
- type: 'NONE';
2659
- }
2660
-
2661
- export interface CommitHierarchyChildAccessContractIDs {
2662
- contract_ids: Array<string>;
2663
-
2664
- type: 'CONTRACT_IDS';
2665
- }
2666
- }
2667
-
2668
1744
  /**
2669
1745
  * The amount the customer should be billed for the commit. Not required.
2670
1746
  */
@@ -2676,23 +1752,6 @@ export namespace ContractCreateParams {
2676
1752
  unit_price: number;
2677
1753
  }
2678
1754
 
2679
- export interface Specifier {
2680
- presentation_group_values?: { [key: string]: string };
2681
-
2682
- pricing_group_values?: { [key: string]: string };
2683
-
2684
- /**
2685
- * If provided, the specifier will only apply to the product with the specified ID.
2686
- */
2687
- product_id?: string;
2688
-
2689
- /**
2690
- * If provided, the specifier will only apply to products with all the specified
2691
- * tags.
2692
- */
2693
- product_tags?: Array<string>;
2694
- }
2695
-
2696
1755
  /**
2697
1756
  * Attach a subscription to the recurring commit/credit.
2698
1757
  */
@@ -2707,7 +1766,7 @@ export namespace ContractCreateParams {
2707
1766
  /**
2708
1767
  * If set to POOLED, allocation added per seat is pooled across the account.
2709
1768
  */
2710
- allocation?: 'POOLED';
1769
+ allocation?: 'INDIVIDUAL' | 'POOLED';
2711
1770
  }
2712
1771
 
2713
1772
  export namespace SubscriptionConfig {
@@ -2768,7 +1827,7 @@ export namespace ContractCreateParams {
2768
1827
  /**
2769
1828
  * Optional configuration for recurring commit/credit hierarchy access control
2770
1829
  */
2771
- hierarchy_configuration?: RecurringCredit.HierarchyConfiguration;
1830
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
2772
1831
 
2773
1832
  /**
2774
1833
  * displayed on invoices. will be passed through to the individual commits
@@ -2813,7 +1872,7 @@ export namespace ContractCreateParams {
2813
1872
  * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2814
1873
  * be used together with `applicable_product_ids` or `applicable_product_tags`.
2815
1874
  */
2816
- specifiers?: Array<RecurringCredit.Specifier>;
1875
+ specifiers?: Array<Shared.CommitSpecifierInput>;
2817
1876
 
2818
1877
  /**
2819
1878
  * Attach a subscription to the recurring commit/credit.
@@ -2837,8 +1896,8 @@ export namespace ContractCreateParams {
2837
1896
  unit_price: number;
2838
1897
 
2839
1898
  /**
2840
- * This field is currently required. Upcoming recurring commit/credit configuration
2841
- * options will allow it to be optional.
1899
+ * This field is required unless a subscription is attached via
1900
+ * `subscription_config`.
2842
1901
  */
2843
1902
  quantity?: number;
2844
1903
  }
@@ -2854,49 +1913,6 @@ export namespace ContractCreateParams {
2854
1913
  unit?: 'PERIODS';
2855
1914
  }
2856
1915
 
2857
- /**
2858
- * Optional configuration for recurring commit/credit hierarchy access control
2859
- */
2860
- export interface HierarchyConfiguration {
2861
- child_access:
2862
- | HierarchyConfiguration.CommitHierarchyChildAccessAll
2863
- | HierarchyConfiguration.CommitHierarchyChildAccessNone
2864
- | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
2865
- }
2866
-
2867
- export namespace HierarchyConfiguration {
2868
- export interface CommitHierarchyChildAccessAll {
2869
- type: 'ALL';
2870
- }
2871
-
2872
- export interface CommitHierarchyChildAccessNone {
2873
- type: 'NONE';
2874
- }
2875
-
2876
- export interface CommitHierarchyChildAccessContractIDs {
2877
- contract_ids: Array<string>;
2878
-
2879
- type: 'CONTRACT_IDS';
2880
- }
2881
- }
2882
-
2883
- export interface Specifier {
2884
- presentation_group_values?: { [key: string]: string };
2885
-
2886
- pricing_group_values?: { [key: string]: string };
2887
-
2888
- /**
2889
- * If provided, the specifier will only apply to the product with the specified ID.
2890
- */
2891
- product_id?: string;
2892
-
2893
- /**
2894
- * If provided, the specifier will only apply to products with all the specified
2895
- * tags.
2896
- */
2897
- product_tags?: Array<string>;
2898
- }
2899
-
2900
1916
  /**
2901
1917
  * Attach a subscription to the recurring commit/credit.
2902
1918
  */
@@ -2911,7 +1927,7 @@ export namespace ContractCreateParams {
2911
1927
  /**
2912
1928
  * If set to POOLED, allocation added per seat is pooled across the account.
2913
1929
  */
2914
- allocation?: 'POOLED';
1930
+ allocation?: 'INDIVIDUAL' | 'POOLED';
2915
1931
  }
2916
1932
 
2917
1933
  export namespace SubscriptionConfig {
@@ -2976,6 +1992,11 @@ export namespace ContractCreateParams {
2976
1992
  */
2977
1993
  schedule: ScheduledCharge.Schedule;
2978
1994
 
1995
+ /**
1996
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1997
+ */
1998
+ custom_fields?: { [key: string]: string };
1999
+
2979
2000
  /**
2980
2001
  * displayed on invoices
2981
2002
  */
@@ -2997,6 +2018,12 @@ export namespace ContractCreateParams {
2997
2018
  */
2998
2019
  credit_type_id?: string;
2999
2020
 
2021
+ /**
2022
+ * This field is only applicable to commit invoice schedules. If true, this
2023
+ * schedule will not generate an invoice.
2024
+ */
2025
+ do_not_invoice?: boolean;
2026
+
3000
2027
  /**
3001
2028
  * Enter the unit price and quantity for the charge or instead only send the
3002
2029
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -3083,117 +2110,16 @@ export namespace ContractCreateParams {
3083
2110
  }
3084
2111
  }
3085
2112
 
3086
- export interface SpendThresholdConfiguration {
3087
- commit: SpendThresholdConfiguration.Commit;
3088
-
3089
- /**
3090
- * When set to false, the contract will not be evaluated against the
3091
- * threshold_amount. Toggling to true will result an immediate evaluation,
3092
- * regardless of prior state.
3093
- */
3094
- is_enabled: boolean;
3095
-
3096
- payment_gate_config: SpendThresholdConfiguration.PaymentGateConfig;
3097
-
3098
- /**
3099
- * Specify the threshold amount for the contract. Each time the contract's usage
3100
- * hits this amount, a threshold charge will be initiated.
3101
- */
3102
- threshold_amount: number;
3103
- }
3104
-
3105
- export namespace SpendThresholdConfiguration {
3106
- export interface Commit {
3107
- /**
3108
- * The commit product that will be used to generate the line item for commit
3109
- * payment.
3110
- */
3111
- product_id: string;
3112
-
3113
- description?: string;
3114
-
3115
- /**
3116
- * Specify the name of the line item for the threshold charge. If left blank, it
3117
- * will default to the commit product name.
3118
- */
3119
- name?: string;
3120
- }
3121
-
3122
- export interface PaymentGateConfig {
3123
- /**
3124
- * Gate access to the commit balance based on successful collection of payment.
3125
- * Select STRIPE for Metronome to facilitate payment via Stripe. Select EXTERNAL to
3126
- * facilitate payment using your own payment integration. Select NONE if you do not
3127
- * wish to payment gate the commit balance.
3128
- */
3129
- payment_gate_type: 'NONE' | 'STRIPE' | 'EXTERNAL';
3130
-
3131
- /**
3132
- * Only applicable if using PRECALCULATED as your tax type.
3133
- */
3134
- precalculated_tax_config?: PaymentGateConfig.PrecalculatedTaxConfig;
3135
-
3136
- /**
3137
- * Only applicable if using STRIPE as your payment gate type.
3138
- */
3139
- stripe_config?: PaymentGateConfig.StripeConfig;
3140
-
3141
- /**
3142
- * Stripe tax is only supported for Stripe payment gateway. Select NONE if you do
3143
- * not wish Metronome to calculate tax on your behalf. Leaving this field blank
3144
- * will default to NONE.
3145
- */
3146
- tax_type?: 'NONE' | 'STRIPE' | 'ANROK' | 'PRECALCULATED';
3147
- }
3148
-
3149
- export namespace PaymentGateConfig {
3150
- /**
3151
- * Only applicable if using PRECALCULATED as your tax type.
3152
- */
3153
- export interface PrecalculatedTaxConfig {
3154
- /**
3155
- * Amount of tax to be applied. This should be in the same currency and
3156
- * denomination as the commit's invoice schedule
3157
- */
3158
- tax_amount: number;
3159
-
3160
- /**
3161
- * Name of the tax to be applied. This may be used in an invoice line item
3162
- * description.
3163
- */
3164
- tax_name?: string;
3165
- }
3166
-
3167
- /**
3168
- * Only applicable if using STRIPE as your payment gate type.
3169
- */
3170
- export interface StripeConfig {
3171
- /**
3172
- * If left blank, will default to INVOICE
3173
- */
3174
- payment_type: 'INVOICE' | 'PAYMENT_INTENT';
3175
-
3176
- /**
3177
- * Metadata to be added to the Stripe invoice. Only applicable if using INVOICE as
3178
- * your payment type.
3179
- */
3180
- invoice_metadata?: { [key: string]: string };
3181
- }
3182
- }
3183
- }
3184
-
3185
2113
  export interface Subscription {
3186
2114
  collection_schedule: 'ADVANCE' | 'ARREARS';
3187
2115
 
3188
- /**
3189
- * The initial quantity for the subscription. It must be non-negative value.
3190
- */
3191
- initial_quantity: number;
3192
-
3193
2116
  proration: Subscription.Proration;
3194
2117
 
3195
2118
  subscription_rate: Subscription.SubscriptionRate;
3196
2119
 
2120
+ /**
2121
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2122
+ */
3197
2123
  custom_fields?: { [key: string]: string };
3198
2124
 
3199
2125
  description?: string;
@@ -3204,8 +2130,22 @@ export namespace ContractCreateParams {
3204
2130
  */
3205
2131
  ending_before?: string;
3206
2132
 
2133
+ /**
2134
+ * The initial quantity for the subscription. It must be non-negative value.
2135
+ * Required if quantity_management_mode is QUANTITY_ONLY.
2136
+ */
2137
+ initial_quantity?: number;
2138
+
3207
2139
  name?: string;
3208
2140
 
2141
+ /**
2142
+ * Determines how the subscription's quantity is controlled. Defaults to
2143
+ * QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
2144
+ * directly on the subscription. `initial_quantity` must be provided with this
2145
+ * option. Compatible with recurring commits/credits that use POOLED allocation.
2146
+ */
2147
+ quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY';
2148
+
3209
2149
  /**
3210
2150
  * Inclusive start time for the subscription. If not provided, defaults to contract
3211
2151
  * start date
@@ -3409,6 +2349,9 @@ export interface ContractAmendParams {
3409
2349
 
3410
2350
  credits?: Array<ContractAmendParams.Credit>;
3411
2351
 
2352
+ /**
2353
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2354
+ */
3412
2355
  custom_fields?: { [key: string]: string };
3413
2356
 
3414
2357
  /**
@@ -3478,6 +2421,9 @@ export namespace ContractAmendParams {
3478
2421
  */
3479
2422
  applicable_product_tags?: Array<string>;
3480
2423
 
2424
+ /**
2425
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2426
+ */
3481
2427
  custom_fields?: { [key: string]: string };
3482
2428
 
3483
2429
  /**
@@ -3488,7 +2434,7 @@ export namespace ContractAmendParams {
3488
2434
  /**
3489
2435
  * Optional configuration for commit hierarchy access control
3490
2436
  */
3491
- hierarchy_configuration?: Commit.HierarchyConfiguration;
2437
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
3492
2438
 
3493
2439
  /**
3494
2440
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
@@ -3532,7 +2478,7 @@ export namespace ContractAmendParams {
3532
2478
  * specifiers to contribute to a commit's or credit's drawdown. This field cannot
3533
2479
  * be used together with `applicable_product_ids` or `applicable_product_tags`.
3534
2480
  */
3535
- specifiers?: Array<Commit.Specifier>;
2481
+ specifiers?: Array<Shared.CommitSpecifierInput>;
3536
2482
 
3537
2483
  /**
3538
2484
  * A temporary ID for the commit that can be used to reference the commit for
@@ -3572,32 +2518,6 @@ export namespace ContractAmendParams {
3572
2518
  }
3573
2519
  }
3574
2520
 
3575
- /**
3576
- * Optional configuration for commit hierarchy access control
3577
- */
3578
- export interface HierarchyConfiguration {
3579
- child_access:
3580
- | HierarchyConfiguration.CommitHierarchyChildAccessAll
3581
- | HierarchyConfiguration.CommitHierarchyChildAccessNone
3582
- | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
3583
- }
3584
-
3585
- export namespace HierarchyConfiguration {
3586
- export interface CommitHierarchyChildAccessAll {
3587
- type: 'ALL';
3588
- }
3589
-
3590
- export interface CommitHierarchyChildAccessNone {
3591
- type: 'NONE';
3592
- }
3593
-
3594
- export interface CommitHierarchyChildAccessContractIDs {
3595
- contract_ids: Array<string>;
3596
-
3597
- type: 'CONTRACT_IDS';
3598
- }
3599
- }
3600
-
3601
2521
  /**
3602
2522
  * Required for "POSTPAID" commits: the true up invoice will be generated at this
3603
2523
  * time and only one schedule item is allowed; the total must match access_schedule
@@ -3610,6 +2530,12 @@ export namespace ContractAmendParams {
3610
2530
  */
3611
2531
  credit_type_id?: string;
3612
2532
 
2533
+ /**
2534
+ * This field is only applicable to commit invoice schedules. If true, this
2535
+ * schedule will not generate an invoice.
2536
+ */
2537
+ do_not_invoice?: boolean;
2538
+
3613
2539
  /**
3614
2540
  * Enter the unit price and quantity for the charge or instead only send the
3615
2541
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -3757,24 +2683,19 @@ export namespace ContractAmendParams {
3757
2683
  * your payment type.
3758
2684
  */
3759
2685
  invoice_metadata?: { [key: string]: string };
3760
- }
3761
- }
3762
-
3763
- export interface Specifier {
3764
- presentation_group_values?: { [key: string]: string };
3765
-
3766
- pricing_group_values?: { [key: string]: string };
3767
2686
 
3768
- /**
3769
- * If provided, the specifier will only apply to the product with the specified ID.
3770
- */
3771
- product_id?: string;
3772
-
3773
- /**
3774
- * If provided, the specifier will only apply to products with all the specified
3775
- * tags.
3776
- */
3777
- product_tags?: Array<string>;
2687
+ /**
2688
+ * If true, the payment will be made assuming the customer is present (i.e. on
2689
+ * session).
2690
+ *
2691
+ * If false, the payment will be made assuming the customer is not present (i.e.
2692
+ * off session). For cardholders from a country with an e-mandate requirement (e.g.
2693
+ * India), the payment may be declined.
2694
+ *
2695
+ * If left blank, will default to false.
2696
+ */
2697
+ on_session_payment?: boolean;
2698
+ }
3778
2699
  }
3779
2700
  }
3780
2701
 
@@ -3798,6 +2719,9 @@ export namespace ContractAmendParams {
3798
2719
  */
3799
2720
  applicable_product_tags?: Array<string>;
3800
2721
 
2722
+ /**
2723
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2724
+ */
3801
2725
  custom_fields?: { [key: string]: string };
3802
2726
 
3803
2727
  /**
@@ -3808,7 +2732,7 @@ export namespace ContractAmendParams {
3808
2732
  /**
3809
2733
  * Optional configuration for credit hierarchy access control
3810
2734
  */
3811
- hierarchy_configuration?: Credit.HierarchyConfiguration;
2735
+ hierarchy_configuration?: Shared.CommitHierarchyConfiguration;
3812
2736
 
3813
2737
  /**
3814
2738
  * displayed on invoices
@@ -3834,7 +2758,7 @@ export namespace ContractAmendParams {
3834
2758
  * specifiers to contribute to a commit's or credit's drawdown. This field cannot
3835
2759
  * be used together with `applicable_product_ids` or `applicable_product_tags`.
3836
2760
  */
3837
- specifiers?: Array<Credit.Specifier>;
2761
+ specifiers?: Array<Shared.CommitSpecifierInput>;
3838
2762
  }
3839
2763
 
3840
2764
  export namespace Credit {
@@ -3865,49 +2789,6 @@ export namespace ContractAmendParams {
3865
2789
  starting_at: string;
3866
2790
  }
3867
2791
  }
3868
-
3869
- /**
3870
- * Optional configuration for credit hierarchy access control
3871
- */
3872
- export interface HierarchyConfiguration {
3873
- child_access:
3874
- | HierarchyConfiguration.CommitHierarchyChildAccessAll
3875
- | HierarchyConfiguration.CommitHierarchyChildAccessNone
3876
- | HierarchyConfiguration.CommitHierarchyChildAccessContractIDs;
3877
- }
3878
-
3879
- export namespace HierarchyConfiguration {
3880
- export interface CommitHierarchyChildAccessAll {
3881
- type: 'ALL';
3882
- }
3883
-
3884
- export interface CommitHierarchyChildAccessNone {
3885
- type: 'NONE';
3886
- }
3887
-
3888
- export interface CommitHierarchyChildAccessContractIDs {
3889
- contract_ids: Array<string>;
3890
-
3891
- type: 'CONTRACT_IDS';
3892
- }
3893
- }
3894
-
3895
- export interface Specifier {
3896
- presentation_group_values?: { [key: string]: string };
3897
-
3898
- pricing_group_values?: { [key: string]: string };
3899
-
3900
- /**
3901
- * If provided, the specifier will only apply to the product with the specified ID.
3902
- */
3903
- product_id?: string;
3904
-
3905
- /**
3906
- * If provided, the specifier will only apply to products with all the specified
3907
- * tags.
3908
- */
3909
- product_tags?: Array<string>;
3910
- }
3911
2792
  }
3912
2793
 
3913
2794
  export interface Discount {
@@ -3918,6 +2799,9 @@ export namespace ContractAmendParams {
3918
2799
  */
3919
2800
  schedule: Discount.Schedule;
3920
2801
 
2802
+ /**
2803
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2804
+ */
3921
2805
  custom_fields?: { [key: string]: string };
3922
2806
 
3923
2807
  /**
@@ -3941,6 +2825,12 @@ export namespace ContractAmendParams {
3941
2825
  */
3942
2826
  credit_type_id?: string;
3943
2827
 
2828
+ /**
2829
+ * This field is only applicable to commit invoice schedules. If true, this
2830
+ * schedule will not generate an invoice.
2831
+ */
2832
+ do_not_invoice?: boolean;
2833
+
3944
2834
  /**
3945
2835
  * Enter the unit price and quantity for the charge or instead only send the
3946
2836
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -4108,8 +2998,8 @@ export namespace ContractAmendParams {
4108
2998
 
4109
2999
  /**
4110
3000
  * Can only be used for commit specific overrides. Must be used in conjunction with
4111
- * one of product_id, product_tags, pricing_group_values, or
4112
- * presentation_group_values. If provided, the override will only apply to the
3001
+ * one of `product_id`, `product_tags`, `pricing_group_values`, or
3002
+ * `presentation_group_values`. If provided, the override will only apply to the
4113
3003
  * specified commits. If not provided, the override will apply to all commits.
4114
3004
  */
4115
3005
  commit_ids?: Array<string>;
@@ -4139,17 +3029,17 @@ export namespace ContractAmendParams {
4139
3029
 
4140
3030
  /**
4141
3031
  * Can only be used for commit specific overrides. Must be used in conjunction with
4142
- * one of product_id, product_tags, pricing_group_values, or
4143
- * presentation_group_values. If provided, the override will only apply to commits
4144
- * created by the specified recurring commit ids.
3032
+ * one of `product_id`, `product_tags`, `pricing_group_values`, or
3033
+ * `presentation_group_values`. If provided, the override will only apply to
3034
+ * commits created by the specified recurring commit ids.
4145
3035
  */
4146
3036
  recurring_commit_ids?: Array<string>;
4147
3037
 
4148
3038
  /**
4149
3039
  * Can only be used for commit specific overrides. Must be used in conjunction with
4150
- * one of product_id, product_tags, pricing_group_values, or
4151
- * presentation_group_values. If provided, the override will only apply to credits
4152
- * created by the specified recurring credit ids.
3040
+ * one of `product_id`, `product_tags`, `pricing_group_values`, or
3041
+ * `presentation_group_values`. If provided, the override will only apply to
3042
+ * credits created by the specified recurring credit ids.
4153
3043
  */
4154
3044
  recurring_credit_ids?: Array<string>;
4155
3045
  }
@@ -4218,6 +3108,9 @@ export namespace ContractAmendParams {
4218
3108
  */
4219
3109
  unit_price: number;
4220
3110
 
3111
+ /**
3112
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
3113
+ */
4221
3114
  custom_fields?: { [key: string]: string };
4222
3115
 
4223
3116
  description?: string;
@@ -4283,6 +3176,11 @@ export namespace ContractAmendParams {
4283
3176
  */
4284
3177
  schedule: ScheduledCharge.Schedule;
4285
3178
 
3179
+ /**
3180
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
3181
+ */
3182
+ custom_fields?: { [key: string]: string };
3183
+
4286
3184
  /**
4287
3185
  * displayed on invoices
4288
3186
  */
@@ -4304,6 +3202,12 @@ export namespace ContractAmendParams {
4304
3202
  */
4305
3203
  credit_type_id?: string;
4306
3204
 
3205
+ /**
3206
+ * This field is only applicable to commit invoice schedules. If true, this
3207
+ * schedule will not generate an invoice.
3208
+ */
3209
+ do_not_invoice?: boolean;
3210
+
4307
3211
  /**
4308
3212
  * Enter the unit price and quantity for the charge or instead only send the
4309
3213
  * amount. If amount is sent, the unit price is assumed to be the amount and
@@ -4438,6 +3342,9 @@ export namespace ContractCreateHistoricalInvoicesParams {
4438
3342
 
4439
3343
  breakdown_granularity?: 'HOUR' | 'DAY';
4440
3344
 
3345
+ /**
3346
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
3347
+ */
4441
3348
  custom_fields?: { [key: string]: string };
4442
3349
  }
4443
3350
 
@@ -4470,7 +3377,7 @@ export namespace ContractCreateHistoricalInvoicesParams {
4470
3377
  }
4471
3378
  }
4472
3379
 
4473
- export interface ContractListBalancesParams {
3380
+ export interface ContractListBalancesParams extends BodyCursorPageParams {
4474
3381
  customer_id: string;
4475
3382
 
4476
3383
  id?: string;
@@ -4507,16 +3414,6 @@ export interface ContractListBalancesParams {
4507
3414
  */
4508
3415
  include_ledgers?: boolean;
4509
3416
 
4510
- /**
4511
- * The maximum number of commits to return. Defaults to 25.
4512
- */
4513
- limit?: number;
4514
-
4515
- /**
4516
- * The next page token from a previous response.
4517
- */
4518
- next_page?: string;
4519
-
4520
3417
  /**
4521
3418
  * Include only balances that have any access on or after the provided date
4522
3419
  */
@@ -4710,9 +3607,7 @@ export interface ContractUpdateEndDateParams {
4710
3607
  }
4711
3608
 
4712
3609
  Contracts.Products = Products;
4713
- Contracts.ProductListResponsesCursorPage = ProductListResponsesCursorPage;
4714
3610
  Contracts.RateCards = RateCards;
4715
- Contracts.RateCardListResponsesCursorPage = RateCardListResponsesCursorPage;
4716
3611
  Contracts.NamedSchedules = NamedSchedules;
4717
3612
 
4718
3613
  export declare namespace Contracts {
@@ -4728,6 +3623,7 @@ export declare namespace Contracts {
4728
3623
  type ContractRetrieveSubscriptionQuantityHistoryResponse as ContractRetrieveSubscriptionQuantityHistoryResponse,
4729
3624
  type ContractScheduleProServicesInvoiceResponse as ContractScheduleProServicesInvoiceResponse,
4730
3625
  type ContractUpdateEndDateResponse as ContractUpdateEndDateResponse,
3626
+ type ContractListBalancesResponsesBodyCursorPage as ContractListBalancesResponsesBodyCursorPage,
4731
3627
  type ContractCreateParams as ContractCreateParams,
4732
3628
  type ContractRetrieveParams as ContractRetrieveParams,
4733
3629
  type ContractListParams as ContractListParams,
@@ -4753,7 +3649,7 @@ export declare namespace Contracts {
4753
3649
  type ProductUpdateResponse as ProductUpdateResponse,
4754
3650
  type ProductListResponse as ProductListResponse,
4755
3651
  type ProductArchiveResponse as ProductArchiveResponse,
4756
- ProductListResponsesCursorPage as ProductListResponsesCursorPage,
3652
+ type ProductListResponsesCursorPage as ProductListResponsesCursorPage,
4757
3653
  type ProductCreateParams as ProductCreateParams,
4758
3654
  type ProductRetrieveParams as ProductRetrieveParams,
4759
3655
  type ProductUpdateParams as ProductUpdateParams,
@@ -4769,7 +3665,7 @@ export declare namespace Contracts {
4769
3665
  type RateCardListResponse as RateCardListResponse,
4770
3666
  type RateCardArchiveResponse as RateCardArchiveResponse,
4771
3667
  type RateCardRetrieveRateScheduleResponse as RateCardRetrieveRateScheduleResponse,
4772
- RateCardListResponsesCursorPage as RateCardListResponsesCursorPage,
3668
+ type RateCardListResponsesCursorPage as RateCardListResponsesCursorPage,
4773
3669
  type RateCardCreateParams as RateCardCreateParams,
4774
3670
  type RateCardRetrieveParams as RateCardRetrieveParams,
4775
3671
  type RateCardUpdateParams as RateCardUpdateParams,