@metronome/sdk 2.2.0 → 3.4.1

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 (353) hide show
  1. package/CHANGELOG.md +188 -0
  2. package/LICENSE +1 -1
  3. package/README.md +26 -4
  4. package/client.d.mts +5 -3
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +5 -3
  7. package/client.d.ts.map +1 -1
  8. package/client.js +26 -10
  9. package/client.js.map +1 -1
  10. package/client.mjs +26 -10
  11. package/client.mjs.map +1 -1
  12. package/internal/parse.d.mts.map +1 -1
  13. package/internal/parse.d.ts.map +1 -1
  14. package/internal/parse.js +5 -0
  15. package/internal/parse.js.map +1 -1
  16. package/internal/parse.mjs +5 -0
  17. package/internal/parse.mjs.map +1 -1
  18. package/internal/tslib.js +17 -17
  19. package/internal/utils/query.d.mts +2 -0
  20. package/internal/utils/query.d.mts.map +1 -0
  21. package/internal/utils/query.d.ts +2 -0
  22. package/internal/utils/query.d.ts.map +1 -0
  23. package/internal/utils/query.js +10 -0
  24. package/internal/utils/query.js.map +1 -0
  25. package/internal/utils/query.mjs +6 -0
  26. package/internal/utils/query.mjs.map +1 -0
  27. package/internal/utils.d.mts +1 -0
  28. package/internal/utils.d.ts +1 -0
  29. package/internal/utils.js +1 -0
  30. package/internal/utils.js.map +1 -1
  31. package/internal/utils.mjs +1 -0
  32. package/package.json +12 -1
  33. package/resources/shared.d.mts +111 -30
  34. package/resources/shared.d.mts.map +1 -1
  35. package/resources/shared.d.ts +111 -30
  36. package/resources/shared.d.ts.map +1 -1
  37. package/resources/v1/alerts.d.mts +3 -0
  38. package/resources/v1/alerts.d.mts.map +1 -1
  39. package/resources/v1/alerts.d.ts +3 -0
  40. package/resources/v1/alerts.d.ts.map +1 -1
  41. package/resources/v1/alerts.js +3 -0
  42. package/resources/v1/alerts.js.map +1 -1
  43. package/resources/v1/alerts.mjs +3 -0
  44. package/resources/v1/alerts.mjs.map +1 -1
  45. package/resources/v1/audit-logs.d.mts +3 -0
  46. package/resources/v1/audit-logs.d.mts.map +1 -1
  47. package/resources/v1/audit-logs.d.ts +3 -0
  48. package/resources/v1/audit-logs.d.ts.map +1 -1
  49. package/resources/v1/audit-logs.js +3 -0
  50. package/resources/v1/audit-logs.js.map +1 -1
  51. package/resources/v1/audit-logs.mjs +3 -0
  52. package/resources/v1/audit-logs.mjs.map +1 -1
  53. package/resources/v1/billable-metrics.d.mts +3 -0
  54. package/resources/v1/billable-metrics.d.mts.map +1 -1
  55. package/resources/v1/billable-metrics.d.ts +3 -0
  56. package/resources/v1/billable-metrics.d.ts.map +1 -1
  57. package/resources/v1/billable-metrics.js +3 -0
  58. package/resources/v1/billable-metrics.js.map +1 -1
  59. package/resources/v1/billable-metrics.mjs +3 -0
  60. package/resources/v1/billable-metrics.mjs.map +1 -1
  61. package/resources/v1/contracts/contracts.d.mts +134 -14
  62. package/resources/v1/contracts/contracts.d.mts.map +1 -1
  63. package/resources/v1/contracts/contracts.d.ts +134 -14
  64. package/resources/v1/contracts/contracts.d.ts.map +1 -1
  65. package/resources/v1/contracts/contracts.js +69 -0
  66. package/resources/v1/contracts/contracts.js.map +1 -1
  67. package/resources/v1/contracts/contracts.mjs +69 -0
  68. package/resources/v1/contracts/contracts.mjs.map +1 -1
  69. package/resources/v1/contracts/index.d.mts +1 -1
  70. package/resources/v1/contracts/index.d.mts.map +1 -1
  71. package/resources/v1/contracts/index.d.ts +1 -1
  72. package/resources/v1/contracts/index.d.ts.map +1 -1
  73. package/resources/v1/contracts/index.js.map +1 -1
  74. package/resources/v1/contracts/index.mjs.map +1 -1
  75. package/resources/v1/contracts/named-schedules.d.mts +3 -0
  76. package/resources/v1/contracts/named-schedules.d.mts.map +1 -1
  77. package/resources/v1/contracts/named-schedules.d.ts +3 -0
  78. package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
  79. package/resources/v1/contracts/named-schedules.js +3 -0
  80. package/resources/v1/contracts/named-schedules.js.map +1 -1
  81. package/resources/v1/contracts/named-schedules.mjs +3 -0
  82. package/resources/v1/contracts/named-schedules.mjs.map +1 -1
  83. package/resources/v1/contracts/products.d.mts +3 -0
  84. package/resources/v1/contracts/products.d.mts.map +1 -1
  85. package/resources/v1/contracts/products.d.ts +3 -0
  86. package/resources/v1/contracts/products.d.ts.map +1 -1
  87. package/resources/v1/contracts/products.js +3 -0
  88. package/resources/v1/contracts/products.js.map +1 -1
  89. package/resources/v1/contracts/products.mjs +3 -0
  90. package/resources/v1/contracts/products.mjs.map +1 -1
  91. package/resources/v1/contracts/rate-cards/named-schedules.d.mts +3 -0
  92. package/resources/v1/contracts/rate-cards/named-schedules.d.mts.map +1 -1
  93. package/resources/v1/contracts/rate-cards/named-schedules.d.ts +3 -0
  94. package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
  95. package/resources/v1/contracts/rate-cards/named-schedules.js +3 -0
  96. package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
  97. package/resources/v1/contracts/rate-cards/named-schedules.mjs +3 -0
  98. package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
  99. package/resources/v1/contracts/rate-cards/product-orders.d.mts +3 -0
  100. package/resources/v1/contracts/rate-cards/product-orders.d.mts.map +1 -1
  101. package/resources/v1/contracts/rate-cards/product-orders.d.ts +3 -0
  102. package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
  103. package/resources/v1/contracts/rate-cards/product-orders.js +3 -0
  104. package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
  105. package/resources/v1/contracts/rate-cards/product-orders.mjs +3 -0
  106. package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
  107. package/resources/v1/contracts/rate-cards/rate-cards.d.mts +4 -1
  108. package/resources/v1/contracts/rate-cards/rate-cards.d.mts.map +1 -1
  109. package/resources/v1/contracts/rate-cards/rate-cards.d.ts +4 -1
  110. package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
  111. package/resources/v1/contracts/rate-cards/rate-cards.js +3 -0
  112. package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
  113. package/resources/v1/contracts/rate-cards/rate-cards.mjs +3 -0
  114. package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
  115. package/resources/v1/contracts/rate-cards/rates.d.mts +6 -21
  116. package/resources/v1/contracts/rate-cards/rates.d.mts.map +1 -1
  117. package/resources/v1/contracts/rate-cards/rates.d.ts +6 -21
  118. package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
  119. package/resources/v1/contracts/rate-cards/rates.js +3 -0
  120. package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
  121. package/resources/v1/contracts/rate-cards/rates.mjs +3 -0
  122. package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
  123. package/resources/v1/credit-grants.d.mts +3 -0
  124. package/resources/v1/credit-grants.d.mts.map +1 -1
  125. package/resources/v1/credit-grants.d.ts +3 -0
  126. package/resources/v1/credit-grants.d.ts.map +1 -1
  127. package/resources/v1/credit-grants.js +3 -0
  128. package/resources/v1/credit-grants.js.map +1 -1
  129. package/resources/v1/credit-grants.mjs +3 -0
  130. package/resources/v1/credit-grants.mjs.map +1 -1
  131. package/resources/v1/custom-fields.d.mts +9 -6
  132. package/resources/v1/custom-fields.d.mts.map +1 -1
  133. package/resources/v1/custom-fields.d.ts +9 -6
  134. package/resources/v1/custom-fields.d.ts.map +1 -1
  135. package/resources/v1/custom-fields.js +3 -0
  136. package/resources/v1/custom-fields.js.map +1 -1
  137. package/resources/v1/custom-fields.mjs +3 -0
  138. package/resources/v1/custom-fields.mjs.map +1 -1
  139. package/resources/v1/customers/alerts.d.mts +3 -0
  140. package/resources/v1/customers/alerts.d.mts.map +1 -1
  141. package/resources/v1/customers/alerts.d.ts +3 -0
  142. package/resources/v1/customers/alerts.d.ts.map +1 -1
  143. package/resources/v1/customers/alerts.js +3 -0
  144. package/resources/v1/customers/alerts.js.map +1 -1
  145. package/resources/v1/customers/alerts.mjs +3 -0
  146. package/resources/v1/customers/alerts.mjs.map +1 -1
  147. package/resources/v1/customers/billing-config.d.mts +8 -5
  148. package/resources/v1/customers/billing-config.d.mts.map +1 -1
  149. package/resources/v1/customers/billing-config.d.ts +8 -5
  150. package/resources/v1/customers/billing-config.d.ts.map +1 -1
  151. package/resources/v1/customers/billing-config.js +3 -0
  152. package/resources/v1/customers/billing-config.js.map +1 -1
  153. package/resources/v1/customers/billing-config.mjs +3 -0
  154. package/resources/v1/customers/billing-config.mjs.map +1 -1
  155. package/resources/v1/customers/commits.d.mts +3 -0
  156. package/resources/v1/customers/commits.d.mts.map +1 -1
  157. package/resources/v1/customers/commits.d.ts +3 -0
  158. package/resources/v1/customers/commits.d.ts.map +1 -1
  159. package/resources/v1/customers/commits.js +3 -0
  160. package/resources/v1/customers/commits.js.map +1 -1
  161. package/resources/v1/customers/commits.mjs +3 -0
  162. package/resources/v1/customers/commits.mjs.map +1 -1
  163. package/resources/v1/customers/credits.d.mts +3 -0
  164. package/resources/v1/customers/credits.d.mts.map +1 -1
  165. package/resources/v1/customers/credits.d.ts +3 -0
  166. package/resources/v1/customers/credits.d.ts.map +1 -1
  167. package/resources/v1/customers/credits.js +3 -0
  168. package/resources/v1/customers/credits.js.map +1 -1
  169. package/resources/v1/customers/credits.mjs +3 -0
  170. package/resources/v1/customers/credits.mjs.map +1 -1
  171. package/resources/v1/customers/customers.d.mts +84 -8
  172. package/resources/v1/customers/customers.d.mts.map +1 -1
  173. package/resources/v1/customers/customers.d.ts +84 -8
  174. package/resources/v1/customers/customers.d.ts.map +1 -1
  175. package/resources/v1/customers/customers.js +53 -0
  176. package/resources/v1/customers/customers.js.map +1 -1
  177. package/resources/v1/customers/customers.mjs +53 -0
  178. package/resources/v1/customers/customers.mjs.map +1 -1
  179. package/resources/v1/customers/index.d.mts +1 -1
  180. package/resources/v1/customers/index.d.mts.map +1 -1
  181. package/resources/v1/customers/index.d.ts +1 -1
  182. package/resources/v1/customers/index.d.ts.map +1 -1
  183. package/resources/v1/customers/index.js.map +1 -1
  184. package/resources/v1/customers/index.mjs.map +1 -1
  185. package/resources/v1/customers/invoices.d.mts +38 -19
  186. package/resources/v1/customers/invoices.d.mts.map +1 -1
  187. package/resources/v1/customers/invoices.d.ts +38 -19
  188. package/resources/v1/customers/invoices.d.ts.map +1 -1
  189. package/resources/v1/customers/invoices.js +3 -0
  190. package/resources/v1/customers/invoices.js.map +1 -1
  191. package/resources/v1/customers/invoices.mjs +3 -0
  192. package/resources/v1/customers/invoices.mjs.map +1 -1
  193. package/resources/v1/customers/named-schedules.d.mts +3 -0
  194. package/resources/v1/customers/named-schedules.d.mts.map +1 -1
  195. package/resources/v1/customers/named-schedules.d.ts +3 -0
  196. package/resources/v1/customers/named-schedules.d.ts.map +1 -1
  197. package/resources/v1/customers/named-schedules.js +3 -0
  198. package/resources/v1/customers/named-schedules.js.map +1 -1
  199. package/resources/v1/customers/named-schedules.mjs +3 -0
  200. package/resources/v1/customers/named-schedules.mjs.map +1 -1
  201. package/resources/v1/customers/plans.d.mts +8 -5
  202. package/resources/v1/customers/plans.d.mts.map +1 -1
  203. package/resources/v1/customers/plans.d.ts +8 -5
  204. package/resources/v1/customers/plans.d.ts.map +1 -1
  205. package/resources/v1/customers/plans.js +3 -0
  206. package/resources/v1/customers/plans.js.map +1 -1
  207. package/resources/v1/customers/plans.mjs +3 -0
  208. package/resources/v1/customers/plans.mjs.map +1 -1
  209. package/resources/v1/dashboards.d.mts +3 -0
  210. package/resources/v1/dashboards.d.mts.map +1 -1
  211. package/resources/v1/dashboards.d.ts +3 -0
  212. package/resources/v1/dashboards.d.ts.map +1 -1
  213. package/resources/v1/dashboards.js +3 -0
  214. package/resources/v1/dashboards.js.map +1 -1
  215. package/resources/v1/dashboards.mjs +3 -0
  216. package/resources/v1/dashboards.mjs.map +1 -1
  217. package/resources/v1/index.d.mts +3 -2
  218. package/resources/v1/index.d.mts.map +1 -1
  219. package/resources/v1/index.d.ts +3 -2
  220. package/resources/v1/index.d.ts.map +1 -1
  221. package/resources/v1/index.js +3 -1
  222. package/resources/v1/index.js.map +1 -1
  223. package/resources/v1/index.mjs +1 -0
  224. package/resources/v1/index.mjs.map +1 -1
  225. package/resources/v1/invoices.d.mts +3 -0
  226. package/resources/v1/invoices.d.mts.map +1 -1
  227. package/resources/v1/invoices.d.ts +3 -0
  228. package/resources/v1/invoices.d.ts.map +1 -1
  229. package/resources/v1/invoices.js +3 -0
  230. package/resources/v1/invoices.js.map +1 -1
  231. package/resources/v1/invoices.mjs +3 -0
  232. package/resources/v1/invoices.mjs.map +1 -1
  233. package/resources/v1/packages.d.mts +2352 -0
  234. package/resources/v1/packages.d.mts.map +1 -0
  235. package/resources/v1/packages.d.ts +2352 -0
  236. package/resources/v1/packages.d.ts.map +1 -0
  237. package/resources/v1/packages.js +160 -0
  238. package/resources/v1/packages.js.map +1 -0
  239. package/resources/v1/packages.mjs +156 -0
  240. package/resources/v1/packages.mjs.map +1 -0
  241. package/resources/v1/payments.d.mts +10 -0
  242. package/resources/v1/payments.d.mts.map +1 -1
  243. package/resources/v1/payments.d.ts +10 -0
  244. package/resources/v1/payments.d.ts.map +1 -1
  245. package/resources/v1/plans.d.mts +5 -2
  246. package/resources/v1/plans.d.mts.map +1 -1
  247. package/resources/v1/plans.d.ts +5 -2
  248. package/resources/v1/plans.d.ts.map +1 -1
  249. package/resources/v1/plans.js +3 -0
  250. package/resources/v1/plans.js.map +1 -1
  251. package/resources/v1/plans.mjs +3 -0
  252. package/resources/v1/plans.mjs.map +1 -1
  253. package/resources/v1/pricing-units.d.mts +3 -0
  254. package/resources/v1/pricing-units.d.mts.map +1 -1
  255. package/resources/v1/pricing-units.d.ts +3 -0
  256. package/resources/v1/pricing-units.d.ts.map +1 -1
  257. package/resources/v1/pricing-units.js +3 -0
  258. package/resources/v1/pricing-units.js.map +1 -1
  259. package/resources/v1/pricing-units.mjs +3 -0
  260. package/resources/v1/pricing-units.mjs.map +1 -1
  261. package/resources/v1/services.d.mts +3 -0
  262. package/resources/v1/services.d.mts.map +1 -1
  263. package/resources/v1/services.d.ts +3 -0
  264. package/resources/v1/services.d.ts.map +1 -1
  265. package/resources/v1/services.js +3 -0
  266. package/resources/v1/services.js.map +1 -1
  267. package/resources/v1/services.mjs +3 -0
  268. package/resources/v1/services.mjs.map +1 -1
  269. package/resources/v1/settings/billing-providers.d.mts +3 -0
  270. package/resources/v1/settings/billing-providers.d.mts.map +1 -1
  271. package/resources/v1/settings/billing-providers.d.ts +3 -0
  272. package/resources/v1/settings/billing-providers.d.ts.map +1 -1
  273. package/resources/v1/settings/billing-providers.js +3 -0
  274. package/resources/v1/settings/billing-providers.js.map +1 -1
  275. package/resources/v1/settings/billing-providers.mjs +3 -0
  276. package/resources/v1/settings/billing-providers.mjs.map +1 -1
  277. package/resources/v1/settings/settings.d.mts +3 -0
  278. package/resources/v1/settings/settings.d.mts.map +1 -1
  279. package/resources/v1/settings/settings.d.ts +3 -0
  280. package/resources/v1/settings/settings.d.ts.map +1 -1
  281. package/resources/v1/settings/settings.js +3 -0
  282. package/resources/v1/settings/settings.js.map +1 -1
  283. package/resources/v1/settings/settings.mjs +3 -0
  284. package/resources/v1/settings/settings.mjs.map +1 -1
  285. package/resources/v1/usage.d.mts +87 -18
  286. package/resources/v1/usage.d.mts.map +1 -1
  287. package/resources/v1/usage.d.ts +87 -18
  288. package/resources/v1/usage.d.ts.map +1 -1
  289. package/resources/v1/usage.js +37 -11
  290. package/resources/v1/usage.js.map +1 -1
  291. package/resources/v1/usage.mjs +37 -11
  292. package/resources/v1/usage.mjs.map +1 -1
  293. package/resources/v1/v1.d.mts +8 -4
  294. package/resources/v1/v1.d.mts.map +1 -1
  295. package/resources/v1/v1.d.ts +8 -4
  296. package/resources/v1/v1.d.ts.map +1 -1
  297. package/resources/v1/v1.js +4 -0
  298. package/resources/v1/v1.js.map +1 -1
  299. package/resources/v1/v1.mjs +4 -0
  300. package/resources/v1/v1.mjs.map +1 -1
  301. package/resources/v2/contracts.d.mts +45 -7
  302. package/resources/v2/contracts.d.mts.map +1 -1
  303. package/resources/v2/contracts.d.ts +45 -7
  304. package/resources/v2/contracts.d.ts.map +1 -1
  305. package/resources/v2/contracts.js +1 -4
  306. package/resources/v2/contracts.js.map +1 -1
  307. package/resources/v2/contracts.mjs +1 -4
  308. package/resources/v2/contracts.mjs.map +1 -1
  309. package/src/client.ts +37 -15
  310. package/src/internal/parse.ts +6 -0
  311. package/src/internal/utils/query.ts +7 -0
  312. package/src/internal/utils.ts +1 -0
  313. package/src/resources/shared.ts +127 -32
  314. package/src/resources/v1/alerts.ts +3 -0
  315. package/src/resources/v1/audit-logs.ts +3 -0
  316. package/src/resources/v1/billable-metrics.ts +3 -0
  317. package/src/resources/v1/contracts/contracts.ts +151 -13
  318. package/src/resources/v1/contracts/index.ts +2 -0
  319. package/src/resources/v1/contracts/named-schedules.ts +3 -0
  320. package/src/resources/v1/contracts/products.ts +3 -0
  321. package/src/resources/v1/contracts/rate-cards/named-schedules.ts +3 -0
  322. package/src/resources/v1/contracts/rate-cards/product-orders.ts +3 -0
  323. package/src/resources/v1/contracts/rate-cards/rate-cards.ts +4 -1
  324. package/src/resources/v1/contracts/rate-cards/rates.ts +6 -24
  325. package/src/resources/v1/credit-grants.ts +3 -0
  326. package/src/resources/v1/custom-fields.ts +32 -5
  327. package/src/resources/v1/customers/alerts.ts +3 -0
  328. package/src/resources/v1/customers/billing-config.ts +8 -5
  329. package/src/resources/v1/customers/commits.ts +3 -0
  330. package/src/resources/v1/customers/credits.ts +3 -0
  331. package/src/resources/v1/customers/customers.ts +96 -7
  332. package/src/resources/v1/customers/index.ts +2 -0
  333. package/src/resources/v1/customers/invoices.ts +45 -19
  334. package/src/resources/v1/customers/named-schedules.ts +3 -0
  335. package/src/resources/v1/customers/plans.ts +8 -5
  336. package/src/resources/v1/dashboards.ts +3 -0
  337. package/src/resources/v1/index.ts +19 -0
  338. package/src/resources/v1/invoices.ts +3 -0
  339. package/src/resources/v1/packages.ts +3057 -0
  340. package/src/resources/v1/payments.ts +15 -0
  341. package/src/resources/v1/plans.ts +5 -2
  342. package/src/resources/v1/pricing-units.ts +3 -0
  343. package/src/resources/v1/services.ts +3 -0
  344. package/src/resources/v1/settings/billing-providers.ts +3 -0
  345. package/src/resources/v1/settings/settings.ts +3 -0
  346. package/src/resources/v1/usage.ts +86 -18
  347. package/src/resources/v1/v1.ts +42 -0
  348. package/src/resources/v2/contracts.ts +55 -7
  349. package/src/version.ts +1 -1
  350. package/version.d.mts +1 -1
  351. package/version.d.ts +1 -1
  352. package/version.js +1 -1
  353. package/version.mjs +1 -1
@@ -0,0 +1,2352 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import * as Shared from "../shared.mjs";
3
+ import { APIPromise } from "../../core/api-promise.mjs";
4
+ import { CursorPage, type CursorPageParams, PagePromise } from "../../core/pagination.mjs";
5
+ import { RequestOptions } from "../../internal/request-options.mjs";
6
+ export declare class Packages extends APIResource {
7
+ /**
8
+ * Create a package that defines a set of reusable, time-relative contract terms
9
+ * that can be used across cohorts of customers. Packages provide an abstraction
10
+ * layer on top of rate cards to provide an easy way to provision customers with
11
+ * standard pricing.
12
+ *
13
+ * ### **Use this endpoint to:**
14
+ *
15
+ * - Model standard pay-as-you-go pricing packages that can be easily reused across
16
+ * customers
17
+ * - Define standardized contract terms and discounting for sales-led motions
18
+ * - Set aliases for the package to facilitate easy package transition. Aliases are
19
+ * human-readable names that you can use in the place of the id of the package
20
+ * when provisioning a customer’s contract. By using an alias, you can easily
21
+ * create a contract and provision a customer by choosing the “Starter Plan”
22
+ * package, without storing the package ID in your internal systems. This is
23
+ * helpful when launching terms for a package, as you can create a new package
24
+ * with the “Starter Plan” alias scheduled to be assigned without updating your
25
+ * provisioning code.
26
+ *
27
+ * ### Key input fields:
28
+ *
29
+ * - `starting_at_offset`: Starting date relative to contract start. Generates the
30
+ * `starting_at` date when a contract is provisioned using a package.
31
+ * - `duration`: Duration starting from `starting_at_offset`. Generates the
32
+ * `ending_before` date when a contract is provisioned using a package.
33
+ * - `date_offset`: Date relative to contract start. Used for point-in-time dates
34
+ * without a duration.
35
+ * - `aliases`: Human-readable name to use when provisioning contracts with a
36
+ * package.
37
+ *
38
+ * ### Usage guidelines:
39
+ *
40
+ * - Use packages for standard self-serve use cases where customers have consistent
41
+ * terms. For customers with negotiated custom contract terms, use the
42
+ * `createContract` endpoint for maximum flexibility.
43
+ * - Billing provider configuration can be set when creating a package by using
44
+ * `billing_provider` and `delivery_method`. To provision a customer successfully
45
+ * with a package, the customer must have one and only one billing provider
46
+ * configuration that matches the billing provider configuration set on the
47
+ * package.
48
+ * - A package alias can only be used by one package at a time. If you create a new
49
+ * package with an alias that is already in use by another package, the original
50
+ * package’s alias schedule will be updated. The alias will reference the package
51
+ * to which it was most recently assigned.
52
+ * - Terms can only be specified using times relative to the contract start date.
53
+ * Supported granularities are: `days`, `weeks`, `months`, `years`
54
+ * - Packages cannot be edited once created. Use the rate card to easily add new
55
+ * rates across all of your customers or make direct edits to a contract after
56
+ * provisioning with a package. Edited contracts will still be associated with
57
+ * the package used during provisioning.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * const _package = await client.v1.packages.create({
62
+ * name: 'My package',
63
+ * billing_provider: 'stripe',
64
+ * delivery_method: 'direct_to_billing_provider',
65
+ * rate_card_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
66
+ * });
67
+ * ```
68
+ */
69
+ create(body: PackageCreateParams, options?: RequestOptions): APIPromise<PackageCreateResponse>;
70
+ /**
71
+ * Gets the details for a specific package, including name, aliases, duration, and
72
+ * terms. Use this endpoint to understand a package’s alias schedule, or display a
73
+ * specific package’s details to end customers.
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * const _package = await client.v1.packages.retrieve({
78
+ * package_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
79
+ * });
80
+ * ```
81
+ */
82
+ retrieve(body: PackageRetrieveParams, options?: RequestOptions): APIPromise<PackageRetrieveResponse>;
83
+ /**
84
+ * Lists all packages with details including name, aliases, duration, and terms. To
85
+ * view contracts on a specific package, use the `listContractsOnPackage` endpoint.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * // Automatically fetches more pages as needed.
90
+ * for await (const packageListResponse of client.v1.packages.list()) {
91
+ * // ...
92
+ * }
93
+ * ```
94
+ */
95
+ list(params?: PackageListParams | null | undefined, options?: RequestOptions): PagePromise<PackageListResponsesCursorPage, PackageListResponse>;
96
+ /**
97
+ * Archive a package. Archived packages cannot be used to create new contracts.
98
+ * However, existing contracts associated with the package will continue to
99
+ * function as normal. Once you archive a package, you can still retrieve it in the
100
+ * UI and API, but you cannot unarchive it.
101
+ *
102
+ * @example
103
+ * ```ts
104
+ * const response = await client.v1.packages.archive({
105
+ * package_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
106
+ * });
107
+ * ```
108
+ */
109
+ archive(body: PackageArchiveParams, options?: RequestOptions): APIPromise<PackageArchiveResponse>;
110
+ /**
111
+ * For a given package, returns all contract IDs and customer IDs associated with
112
+ * the package over a specific time period.
113
+ *
114
+ * ### Use this endpoint to:
115
+ *
116
+ * - Understand which customers are provisioned on a package at any given time for
117
+ * internal cohort management
118
+ * - Manage customer migrations to a new package. For example, to migrate all
119
+ * active customers to a new package, call this endpoint, end contracts, and
120
+ * provision customers on a new package.
121
+ *
122
+ * ### **Usage guidelines:**
123
+ *
124
+ * Use the **`starting_at`**, **`covering_date`**,
125
+ * and **`include_archived`** parameters to filter the list of returned contracts.
126
+ * For example, to list only currently active contracts,
127
+ * pass **`covering_date`** equal to the current time.
128
+ *
129
+ * @example
130
+ * ```ts
131
+ * // Automatically fetches more pages as needed.
132
+ * for await (const packageListContractsOnPackageResponse of client.v1.packages.listContractsOnPackage(
133
+ * { package_id: '13117714-3f05-48e5-a6e9-a66093f13b4d' },
134
+ * )) {
135
+ * // ...
136
+ * }
137
+ * ```
138
+ */
139
+ listContractsOnPackage(params: PackageListContractsOnPackageParams, options?: RequestOptions): PagePromise<PackageListContractsOnPackageResponsesCursorPage, PackageListContractsOnPackageResponse>;
140
+ }
141
+ export type PackageListResponsesCursorPage = CursorPage<PackageListResponse>;
142
+ export type PackageListContractsOnPackageResponsesCursorPage = CursorPage<PackageListContractsOnPackageResponse>;
143
+ export interface PackageCreateResponse {
144
+ data: Shared.ID;
145
+ }
146
+ export interface PackageRetrieveResponse {
147
+ data: PackageRetrieveResponse.Data;
148
+ }
149
+ export declare namespace PackageRetrieveResponse {
150
+ interface Data {
151
+ id: string;
152
+ commits: Array<Data.Commit>;
153
+ created_at: string;
154
+ created_by: string;
155
+ overrides: Array<Data.Override>;
156
+ scheduled_charges: Array<Data.ScheduledCharge>;
157
+ usage_statement_schedule: Data.UsageStatementSchedule;
158
+ aliases?: Array<Data.Alias>;
159
+ archived_at?: string;
160
+ billing_provider?: 'aws_marketplace' | 'stripe' | 'netsuite' | 'custom' | 'azure_marketplace' | 'quickbooks_online' | 'workday' | 'gcp_marketplace' | 'metronome';
161
+ credits?: Array<Data.Credit>;
162
+ delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
163
+ duration?: Data.Duration;
164
+ /**
165
+ * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
166
+ * prices automatically. EXPLICIT prioritization requires specifying priorities for
167
+ * each multiplier; the one with the lowest priority value will be prioritized
168
+ * first.
169
+ */
170
+ multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';
171
+ name?: string;
172
+ net_payment_terms_days?: number;
173
+ prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfiguration;
174
+ rate_card_id?: string;
175
+ recurring_commits?: Array<Data.RecurringCommit>;
176
+ recurring_credits?: Array<Data.RecurringCredit>;
177
+ /**
178
+ * Determines which scheduled and commit charges to consolidate onto the Contract's
179
+ * usage invoice. The charge's `timestamp` must match the usage invoice's
180
+ * `ending_before` date for consolidation to occur. This field cannot be modified
181
+ * after a Contract has been created. If this field is omitted, charges will appear
182
+ * on a separate invoice from usage charges.
183
+ */
184
+ scheduled_charges_on_usage_invoices?: 'ALL';
185
+ spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
186
+ subscriptions?: Array<Data.Subscription>;
187
+ /**
188
+ * Prevents the creation of duplicates. If a request to create a record is made
189
+ * with a previously used uniqueness key, a new record will not be created and the
190
+ * request will fail with a 409 error.
191
+ */
192
+ uniqueness_key?: string;
193
+ }
194
+ namespace Data {
195
+ interface Commit {
196
+ id: string;
197
+ product: Commit.Product;
198
+ type: 'PREPAID' | 'POSTPAID';
199
+ /**
200
+ * The schedule that the customer will gain access to the credits purposed with
201
+ * this commit.
202
+ */
203
+ access_schedule?: Commit.AccessSchedule;
204
+ applicable_product_ids?: Array<string>;
205
+ applicable_product_tags?: Array<string>;
206
+ /**
207
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
208
+ */
209
+ custom_fields?: {
210
+ [key: string]: string;
211
+ };
212
+ description?: string;
213
+ /**
214
+ * The schedule that the customer will be invoiced for this commit.
215
+ */
216
+ invoice_schedule?: Commit.InvoiceSchedule;
217
+ name?: string;
218
+ /**
219
+ * If multiple credits or commits are applicable, the one with the lower priority
220
+ * will apply first.
221
+ */
222
+ priority?: number;
223
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
224
+ rollover_fraction?: number;
225
+ /**
226
+ * List of filters that determine what kind of customer usage draws down a commit
227
+ * or credit. A customer's usage needs to meet the condition of at least one of the
228
+ * specifiers to contribute to a commit's or credit's drawdown.
229
+ */
230
+ specifiers?: Array<Shared.CommitSpecifier>;
231
+ }
232
+ namespace Commit {
233
+ interface Product {
234
+ id: string;
235
+ name: string;
236
+ }
237
+ /**
238
+ * The schedule that the customer will gain access to the credits purposed with
239
+ * this commit.
240
+ */
241
+ interface AccessSchedule {
242
+ credit_type: Shared.CreditTypeData;
243
+ schedule_items: Array<AccessSchedule.ScheduleItem>;
244
+ }
245
+ namespace AccessSchedule {
246
+ interface ScheduleItem {
247
+ id: string;
248
+ amount: number;
249
+ duration: ScheduleItem.Duration;
250
+ starting_at_offset: ScheduleItem.StartingAtOffset;
251
+ }
252
+ namespace ScheduleItem {
253
+ interface Duration {
254
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
255
+ value: number;
256
+ }
257
+ interface StartingAtOffset {
258
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
259
+ value: number;
260
+ }
261
+ }
262
+ }
263
+ /**
264
+ * The schedule that the customer will be invoiced for this commit.
265
+ */
266
+ interface InvoiceSchedule {
267
+ credit_type: Shared.CreditTypeData;
268
+ /**
269
+ * If true, this schedule will not generate an invoice.
270
+ */
271
+ do_not_invoice: boolean;
272
+ schedule_items: Array<InvoiceSchedule.ScheduleItem>;
273
+ }
274
+ namespace InvoiceSchedule {
275
+ interface ScheduleItem {
276
+ id: string;
277
+ date_offset: ScheduleItem.DateOffset;
278
+ quantity: number;
279
+ unit_price: number;
280
+ }
281
+ namespace ScheduleItem {
282
+ interface DateOffset {
283
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
284
+ value: number;
285
+ }
286
+ }
287
+ }
288
+ }
289
+ interface Override {
290
+ id: string;
291
+ override_specifiers: Array<Override.OverrideSpecifier>;
292
+ starting_at_offset: Override.StartingAtOffset;
293
+ applicable_product_tags?: Array<string>;
294
+ duration?: Override.Duration;
295
+ entitled?: boolean;
296
+ is_commit_specific?: boolean;
297
+ multiplier?: number;
298
+ override_tiers?: Array<Shared.OverrideTier>;
299
+ overwrite_rate?: Shared.OverwriteRate;
300
+ priority?: number;
301
+ product?: Override.Product;
302
+ target?: 'COMMIT_RATE' | 'LIST_RATE';
303
+ type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
304
+ }
305
+ namespace Override {
306
+ interface OverrideSpecifier {
307
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
308
+ commit_template_ids?: Array<string>;
309
+ presentation_group_values?: {
310
+ [key: string]: string | null;
311
+ };
312
+ pricing_group_values?: {
313
+ [key: string]: string;
314
+ };
315
+ product_id?: string;
316
+ product_tags?: Array<string>;
317
+ recurring_commit_template_ids?: Array<string>;
318
+ recurring_credit_template_ids?: Array<string>;
319
+ }
320
+ interface StartingAtOffset {
321
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
322
+ value: number;
323
+ }
324
+ interface Duration {
325
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
326
+ value: number;
327
+ }
328
+ interface Product {
329
+ id: string;
330
+ name: string;
331
+ }
332
+ }
333
+ interface ScheduledCharge {
334
+ id: string;
335
+ product: ScheduledCharge.Product;
336
+ schedule: ScheduledCharge.Schedule;
337
+ /**
338
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
339
+ */
340
+ custom_fields?: {
341
+ [key: string]: string;
342
+ };
343
+ description?: string;
344
+ name?: string;
345
+ }
346
+ namespace ScheduledCharge {
347
+ interface Product {
348
+ id: string;
349
+ name: string;
350
+ }
351
+ interface Schedule {
352
+ credit_type: Shared.CreditTypeData;
353
+ schedule_items: Array<Schedule.ScheduleItem>;
354
+ }
355
+ namespace Schedule {
356
+ interface ScheduleItem {
357
+ id: string;
358
+ date_offset: ScheduleItem.DateOffset;
359
+ quantity: number;
360
+ unit_price: number;
361
+ }
362
+ namespace ScheduleItem {
363
+ interface DateOffset {
364
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
365
+ value: number;
366
+ }
367
+ }
368
+ }
369
+ }
370
+ interface UsageStatementSchedule {
371
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
372
+ }
373
+ interface Alias {
374
+ name: string;
375
+ ending_before?: string;
376
+ starting_at?: string;
377
+ }
378
+ interface Credit {
379
+ id: string;
380
+ product: Credit.Product;
381
+ access_schedule?: Credit.AccessSchedule;
382
+ applicable_product_ids?: Array<string>;
383
+ applicable_product_tags?: Array<string>;
384
+ /**
385
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
386
+ */
387
+ custom_fields?: {
388
+ [key: string]: string;
389
+ };
390
+ description?: string;
391
+ name?: string;
392
+ priority?: number;
393
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
394
+ /**
395
+ * List of filters that determine what kind of customer usage draws down a commit
396
+ * or credit. A customer's usage needs to meet the condition of at least one of the
397
+ * specifiers to contribute to a commit's or credit's drawdown.
398
+ */
399
+ specifiers?: Array<Shared.CommitSpecifier>;
400
+ }
401
+ namespace Credit {
402
+ interface Product {
403
+ id: string;
404
+ name: string;
405
+ }
406
+ interface AccessSchedule {
407
+ credit_type: Shared.CreditTypeData;
408
+ schedule_items: Array<AccessSchedule.ScheduleItem>;
409
+ }
410
+ namespace AccessSchedule {
411
+ interface ScheduleItem {
412
+ id: string;
413
+ amount: number;
414
+ duration: ScheduleItem.Duration;
415
+ starting_at_offset: ScheduleItem.StartingAtOffset;
416
+ }
417
+ namespace ScheduleItem {
418
+ interface Duration {
419
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
420
+ value: number;
421
+ }
422
+ interface StartingAtOffset {
423
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
424
+ value: number;
425
+ }
426
+ }
427
+ }
428
+ }
429
+ interface Duration {
430
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
431
+ value: number;
432
+ }
433
+ interface RecurringCommit {
434
+ id: string;
435
+ /**
436
+ * The amount of commit to grant.
437
+ */
438
+ access_amount: RecurringCommit.AccessAmount;
439
+ /**
440
+ * The amount of time each of the created commits will be valid for
441
+ */
442
+ commit_duration: RecurringCommit.CommitDuration;
443
+ priority: number;
444
+ product: RecurringCommit.Product;
445
+ /**
446
+ * Whether the created commits will use the commit rate or list rate
447
+ */
448
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
449
+ /**
450
+ * Offset relative to the contract start date that determines the start time for
451
+ * the first commit
452
+ */
453
+ starting_at_offset: RecurringCommit.StartingAtOffset;
454
+ /**
455
+ * Will be passed down to the individual commits
456
+ */
457
+ applicable_product_ids?: Array<string>;
458
+ /**
459
+ * Will be passed down to the individual commits
460
+ */
461
+ applicable_product_tags?: Array<string>;
462
+ description?: string;
463
+ /**
464
+ * Offset relative to the recurring credit start that determines when the contract
465
+ * will stop creating recurring commits. optional
466
+ */
467
+ duration?: RecurringCommit.Duration;
468
+ /**
469
+ * The amount the customer should be billed for the commit.
470
+ */
471
+ invoice_amount?: RecurringCommit.InvoiceAmount;
472
+ name?: string;
473
+ /**
474
+ * Determines whether the first and last commit will be prorated. If not provided,
475
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
476
+ */
477
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
478
+ /**
479
+ * The frequency at which the recurring commits will be created. If not provided: -
480
+ * The commits will be created on the usage invoice frequency. If provided: - The
481
+ * period defined in the duration will correspond to this frequency. - Commits will
482
+ * be created aligned with the recurring commit's starting_at rather than the usage
483
+ * invoice dates.
484
+ */
485
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
486
+ /**
487
+ * Will be passed down to the individual commits. This controls how much of an
488
+ * individual unexpired commit will roll over upon contract transition. Must be
489
+ * between 0 and 1.
490
+ */
491
+ rollover_fraction?: number;
492
+ /**
493
+ * List of filters that determine what kind of customer usage draws down a commit
494
+ * or credit. A customer's usage needs to meet the condition of at least one of the
495
+ * specifiers to contribute to a commit's or credit's drawdown.
496
+ */
497
+ specifiers?: Array<Shared.CommitSpecifier>;
498
+ /**
499
+ * Attach a subscription to the recurring commit/credit.
500
+ */
501
+ subscription_config?: RecurringCommit.SubscriptionConfig;
502
+ }
503
+ namespace RecurringCommit {
504
+ /**
505
+ * The amount of commit to grant.
506
+ */
507
+ interface AccessAmount {
508
+ credit_type_id: string;
509
+ unit_price: number;
510
+ quantity?: number;
511
+ }
512
+ /**
513
+ * The amount of time each of the created commits will be valid for
514
+ */
515
+ interface CommitDuration {
516
+ value: number;
517
+ unit?: 'PERIODS';
518
+ }
519
+ interface Product {
520
+ id: string;
521
+ name: string;
522
+ }
523
+ /**
524
+ * Offset relative to the contract start date that determines the start time for
525
+ * the first commit
526
+ */
527
+ interface StartingAtOffset {
528
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
529
+ value: number;
530
+ }
531
+ /**
532
+ * Offset relative to the recurring credit start that determines when the contract
533
+ * will stop creating recurring commits. optional
534
+ */
535
+ interface Duration {
536
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
537
+ value: number;
538
+ }
539
+ /**
540
+ * The amount the customer should be billed for the commit.
541
+ */
542
+ interface InvoiceAmount {
543
+ credit_type_id: string;
544
+ quantity: number;
545
+ unit_price: number;
546
+ }
547
+ /**
548
+ * Attach a subscription to the recurring commit/credit.
549
+ */
550
+ interface SubscriptionConfig {
551
+ allocation: 'INDIVIDUAL' | 'POOLED';
552
+ apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
553
+ subscription_template_id: string;
554
+ }
555
+ namespace SubscriptionConfig {
556
+ interface ApplySeatIncreaseConfig {
557
+ /**
558
+ * Indicates whether a mid-period seat increase should be prorated.
559
+ */
560
+ is_prorated: boolean;
561
+ }
562
+ }
563
+ }
564
+ interface RecurringCredit {
565
+ id: string;
566
+ /**
567
+ * The amount of commit to grant.
568
+ */
569
+ access_amount: RecurringCredit.AccessAmount;
570
+ /**
571
+ * The amount of time each of the created commits will be valid for
572
+ */
573
+ commit_duration: RecurringCredit.CommitDuration;
574
+ priority: number;
575
+ product: RecurringCredit.Product;
576
+ /**
577
+ * Whether the created commits will use the commit rate or list rate
578
+ */
579
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
580
+ /**
581
+ * Offset relative to the contract start date that determines the start time for
582
+ * the first commit
583
+ */
584
+ starting_at_offset: RecurringCredit.StartingAtOffset;
585
+ /**
586
+ * Will be passed down to the individual commits
587
+ */
588
+ applicable_product_ids?: Array<string>;
589
+ /**
590
+ * Will be passed down to the individual commits
591
+ */
592
+ applicable_product_tags?: Array<string>;
593
+ description?: string;
594
+ /**
595
+ * Offset relative to the recurring credit start that determines when the contract
596
+ * will stop creating recurring commits. optional
597
+ */
598
+ duration?: RecurringCredit.Duration;
599
+ name?: string;
600
+ /**
601
+ * Determines whether the first and last commit will be prorated. If not provided,
602
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
603
+ */
604
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
605
+ /**
606
+ * The frequency at which the recurring commits will be created. If not provided: -
607
+ * The commits will be created on the usage invoice frequency. If provided: - The
608
+ * period defined in the duration will correspond to this frequency. - Commits will
609
+ * be created aligned with the recurring commit's starting_at rather than the usage
610
+ * invoice dates.
611
+ */
612
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
613
+ /**
614
+ * Will be passed down to the individual commits. This controls how much of an
615
+ * individual unexpired commit will roll over upon contract transition. Must be
616
+ * between 0 and 1.
617
+ */
618
+ rollover_fraction?: number;
619
+ /**
620
+ * List of filters that determine what kind of customer usage draws down a commit
621
+ * or credit. A customer's usage needs to meet the condition of at least one of the
622
+ * specifiers to contribute to a commit's or credit's drawdown.
623
+ */
624
+ specifiers?: Array<Shared.CommitSpecifier>;
625
+ /**
626
+ * Attach a subscription to the recurring commit/credit.
627
+ */
628
+ subscription_config?: RecurringCredit.SubscriptionConfig;
629
+ }
630
+ namespace RecurringCredit {
631
+ /**
632
+ * The amount of commit to grant.
633
+ */
634
+ interface AccessAmount {
635
+ credit_type_id: string;
636
+ unit_price: number;
637
+ quantity?: number;
638
+ }
639
+ /**
640
+ * The amount of time each of the created commits will be valid for
641
+ */
642
+ interface CommitDuration {
643
+ value: number;
644
+ unit?: 'PERIODS';
645
+ }
646
+ interface Product {
647
+ id: string;
648
+ name: string;
649
+ }
650
+ /**
651
+ * Offset relative to the contract start date that determines the start time for
652
+ * the first commit
653
+ */
654
+ interface StartingAtOffset {
655
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
656
+ value: number;
657
+ }
658
+ /**
659
+ * Offset relative to the recurring credit start that determines when the contract
660
+ * will stop creating recurring commits. optional
661
+ */
662
+ interface Duration {
663
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
664
+ value: number;
665
+ }
666
+ /**
667
+ * Attach a subscription to the recurring commit/credit.
668
+ */
669
+ interface SubscriptionConfig {
670
+ allocation: 'INDIVIDUAL' | 'POOLED';
671
+ apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
672
+ subscription_template_id: string;
673
+ }
674
+ namespace SubscriptionConfig {
675
+ interface ApplySeatIncreaseConfig {
676
+ /**
677
+ * Indicates whether a mid-period seat increase should be prorated.
678
+ */
679
+ is_prorated: boolean;
680
+ }
681
+ }
682
+ }
683
+ interface Subscription {
684
+ collection_schedule: 'ADVANCE' | 'ARREARS';
685
+ proration: Subscription.Proration;
686
+ subscription_rate: Subscription.SubscriptionRate;
687
+ id?: string;
688
+ /**
689
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
690
+ */
691
+ custom_fields?: {
692
+ [key: string]: string;
693
+ };
694
+ description?: string;
695
+ duration?: Subscription.Duration;
696
+ fiat_credit_type_id?: string;
697
+ initial_quantity?: number;
698
+ name?: string;
699
+ /**
700
+ * Determines how the subscription's quantity is controlled. Defaults to
701
+ * QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
702
+ * directly on the subscription. `initial_quantity` must be provided with this
703
+ * option. Compatible with recurring commits/credits that use POOLED allocation.
704
+ * **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
705
+ * user_123) to increment and decrement a subscription quantity, rather than
706
+ * directly providing the quantity. You must use a SEAT_BASED subscription to use a
707
+ * linked recurring credit with an allocation per seat. `seat_config` must be
708
+ * provided with this option.
709
+ */
710
+ quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY';
711
+ seat_config?: Subscription.SeatConfig;
712
+ starting_at_offset?: Subscription.StartingAtOffset;
713
+ }
714
+ namespace Subscription {
715
+ interface Proration {
716
+ invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
717
+ is_prorated: boolean;
718
+ }
719
+ interface SubscriptionRate {
720
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
721
+ product: SubscriptionRate.Product;
722
+ }
723
+ namespace SubscriptionRate {
724
+ interface Product {
725
+ id: string;
726
+ name: string;
727
+ }
728
+ }
729
+ interface Duration {
730
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
731
+ value: number;
732
+ }
733
+ interface SeatConfig {
734
+ /**
735
+ * The property name, sent on usage events, that identifies the seat ID associated
736
+ * with the usage event. For example, the property name might be seat_id or
737
+ * user_id. The property must be set as a group key on billable metrics and a
738
+ * presentation/pricing group key on contract products. This allows linked
739
+ * recurring credits with an allocation per seat to be consumed by only one seat's
740
+ * usage.
741
+ */
742
+ seat_group_key: string;
743
+ }
744
+ interface StartingAtOffset {
745
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
746
+ value: number;
747
+ }
748
+ }
749
+ }
750
+ }
751
+ export interface PackageListResponse {
752
+ id: string;
753
+ commits: Array<PackageListResponse.Commit>;
754
+ created_at: string;
755
+ created_by: string;
756
+ overrides: Array<PackageListResponse.Override>;
757
+ scheduled_charges: Array<PackageListResponse.ScheduledCharge>;
758
+ usage_statement_schedule: PackageListResponse.UsageStatementSchedule;
759
+ aliases?: Array<PackageListResponse.Alias>;
760
+ archived_at?: string;
761
+ billing_provider?: 'aws_marketplace' | 'stripe' | 'netsuite' | 'custom' | 'azure_marketplace' | 'quickbooks_online' | 'workday' | 'gcp_marketplace' | 'metronome';
762
+ credits?: Array<PackageListResponse.Credit>;
763
+ delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
764
+ duration?: PackageListResponse.Duration;
765
+ /**
766
+ * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
767
+ * prices automatically. EXPLICIT prioritization requires specifying priorities for
768
+ * each multiplier; the one with the lowest priority value will be prioritized
769
+ * first.
770
+ */
771
+ multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';
772
+ name?: string;
773
+ net_payment_terms_days?: number;
774
+ prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfiguration;
775
+ rate_card_id?: string;
776
+ recurring_commits?: Array<PackageListResponse.RecurringCommit>;
777
+ recurring_credits?: Array<PackageListResponse.RecurringCredit>;
778
+ /**
779
+ * Determines which scheduled and commit charges to consolidate onto the Contract's
780
+ * usage invoice. The charge's `timestamp` must match the usage invoice's
781
+ * `ending_before` date for consolidation to occur. This field cannot be modified
782
+ * after a Contract has been created. If this field is omitted, charges will appear
783
+ * on a separate invoice from usage charges.
784
+ */
785
+ scheduled_charges_on_usage_invoices?: 'ALL';
786
+ spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
787
+ subscriptions?: Array<PackageListResponse.Subscription>;
788
+ /**
789
+ * Prevents the creation of duplicates. If a request to create a record is made
790
+ * with a previously used uniqueness key, a new record will not be created and the
791
+ * request will fail with a 409 error.
792
+ */
793
+ uniqueness_key?: string;
794
+ }
795
+ export declare namespace PackageListResponse {
796
+ interface Commit {
797
+ id: string;
798
+ product: Commit.Product;
799
+ type: 'PREPAID' | 'POSTPAID';
800
+ /**
801
+ * The schedule that the customer will gain access to the credits purposed with
802
+ * this commit.
803
+ */
804
+ access_schedule?: Commit.AccessSchedule;
805
+ applicable_product_ids?: Array<string>;
806
+ applicable_product_tags?: Array<string>;
807
+ /**
808
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
809
+ */
810
+ custom_fields?: {
811
+ [key: string]: string;
812
+ };
813
+ description?: string;
814
+ /**
815
+ * The schedule that the customer will be invoiced for this commit.
816
+ */
817
+ invoice_schedule?: Commit.InvoiceSchedule;
818
+ name?: string;
819
+ /**
820
+ * If multiple credits or commits are applicable, the one with the lower priority
821
+ * will apply first.
822
+ */
823
+ priority?: number;
824
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
825
+ rollover_fraction?: number;
826
+ /**
827
+ * List of filters that determine what kind of customer usage draws down a commit
828
+ * or credit. A customer's usage needs to meet the condition of at least one of the
829
+ * specifiers to contribute to a commit's or credit's drawdown.
830
+ */
831
+ specifiers?: Array<Shared.CommitSpecifier>;
832
+ }
833
+ namespace Commit {
834
+ interface Product {
835
+ id: string;
836
+ name: string;
837
+ }
838
+ /**
839
+ * The schedule that the customer will gain access to the credits purposed with
840
+ * this commit.
841
+ */
842
+ interface AccessSchedule {
843
+ credit_type: Shared.CreditTypeData;
844
+ schedule_items: Array<AccessSchedule.ScheduleItem>;
845
+ }
846
+ namespace AccessSchedule {
847
+ interface ScheduleItem {
848
+ id: string;
849
+ amount: number;
850
+ duration: ScheduleItem.Duration;
851
+ starting_at_offset: ScheduleItem.StartingAtOffset;
852
+ }
853
+ namespace ScheduleItem {
854
+ interface Duration {
855
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
856
+ value: number;
857
+ }
858
+ interface StartingAtOffset {
859
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
860
+ value: number;
861
+ }
862
+ }
863
+ }
864
+ /**
865
+ * The schedule that the customer will be invoiced for this commit.
866
+ */
867
+ interface InvoiceSchedule {
868
+ credit_type: Shared.CreditTypeData;
869
+ /**
870
+ * If true, this schedule will not generate an invoice.
871
+ */
872
+ do_not_invoice: boolean;
873
+ schedule_items: Array<InvoiceSchedule.ScheduleItem>;
874
+ }
875
+ namespace InvoiceSchedule {
876
+ interface ScheduleItem {
877
+ id: string;
878
+ date_offset: ScheduleItem.DateOffset;
879
+ quantity: number;
880
+ unit_price: number;
881
+ }
882
+ namespace ScheduleItem {
883
+ interface DateOffset {
884
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
885
+ value: number;
886
+ }
887
+ }
888
+ }
889
+ }
890
+ interface Override {
891
+ id: string;
892
+ override_specifiers: Array<Override.OverrideSpecifier>;
893
+ starting_at_offset: Override.StartingAtOffset;
894
+ applicable_product_tags?: Array<string>;
895
+ duration?: Override.Duration;
896
+ entitled?: boolean;
897
+ is_commit_specific?: boolean;
898
+ multiplier?: number;
899
+ override_tiers?: Array<Shared.OverrideTier>;
900
+ overwrite_rate?: Shared.OverwriteRate;
901
+ priority?: number;
902
+ product?: Override.Product;
903
+ target?: 'COMMIT_RATE' | 'LIST_RATE';
904
+ type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
905
+ }
906
+ namespace Override {
907
+ interface OverrideSpecifier {
908
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
909
+ commit_template_ids?: Array<string>;
910
+ presentation_group_values?: {
911
+ [key: string]: string | null;
912
+ };
913
+ pricing_group_values?: {
914
+ [key: string]: string;
915
+ };
916
+ product_id?: string;
917
+ product_tags?: Array<string>;
918
+ recurring_commit_template_ids?: Array<string>;
919
+ recurring_credit_template_ids?: Array<string>;
920
+ }
921
+ interface StartingAtOffset {
922
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
923
+ value: number;
924
+ }
925
+ interface Duration {
926
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
927
+ value: number;
928
+ }
929
+ interface Product {
930
+ id: string;
931
+ name: string;
932
+ }
933
+ }
934
+ interface ScheduledCharge {
935
+ id: string;
936
+ product: ScheduledCharge.Product;
937
+ schedule: ScheduledCharge.Schedule;
938
+ /**
939
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
940
+ */
941
+ custom_fields?: {
942
+ [key: string]: string;
943
+ };
944
+ description?: string;
945
+ name?: string;
946
+ }
947
+ namespace ScheduledCharge {
948
+ interface Product {
949
+ id: string;
950
+ name: string;
951
+ }
952
+ interface Schedule {
953
+ credit_type: Shared.CreditTypeData;
954
+ schedule_items: Array<Schedule.ScheduleItem>;
955
+ }
956
+ namespace Schedule {
957
+ interface ScheduleItem {
958
+ id: string;
959
+ date_offset: ScheduleItem.DateOffset;
960
+ quantity: number;
961
+ unit_price: number;
962
+ }
963
+ namespace ScheduleItem {
964
+ interface DateOffset {
965
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
966
+ value: number;
967
+ }
968
+ }
969
+ }
970
+ }
971
+ interface UsageStatementSchedule {
972
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
973
+ }
974
+ interface Alias {
975
+ name: string;
976
+ ending_before?: string;
977
+ starting_at?: string;
978
+ }
979
+ interface Credit {
980
+ id: string;
981
+ product: Credit.Product;
982
+ access_schedule?: Credit.AccessSchedule;
983
+ applicable_product_ids?: Array<string>;
984
+ applicable_product_tags?: Array<string>;
985
+ /**
986
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
987
+ */
988
+ custom_fields?: {
989
+ [key: string]: string;
990
+ };
991
+ description?: string;
992
+ name?: string;
993
+ priority?: number;
994
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
995
+ /**
996
+ * List of filters that determine what kind of customer usage draws down a commit
997
+ * or credit. A customer's usage needs to meet the condition of at least one of the
998
+ * specifiers to contribute to a commit's or credit's drawdown.
999
+ */
1000
+ specifiers?: Array<Shared.CommitSpecifier>;
1001
+ }
1002
+ namespace Credit {
1003
+ interface Product {
1004
+ id: string;
1005
+ name: string;
1006
+ }
1007
+ interface AccessSchedule {
1008
+ credit_type: Shared.CreditTypeData;
1009
+ schedule_items: Array<AccessSchedule.ScheduleItem>;
1010
+ }
1011
+ namespace AccessSchedule {
1012
+ interface ScheduleItem {
1013
+ id: string;
1014
+ amount: number;
1015
+ duration: ScheduleItem.Duration;
1016
+ starting_at_offset: ScheduleItem.StartingAtOffset;
1017
+ }
1018
+ namespace ScheduleItem {
1019
+ interface Duration {
1020
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1021
+ value: number;
1022
+ }
1023
+ interface StartingAtOffset {
1024
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1025
+ value: number;
1026
+ }
1027
+ }
1028
+ }
1029
+ }
1030
+ interface Duration {
1031
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1032
+ value: number;
1033
+ }
1034
+ interface RecurringCommit {
1035
+ id: string;
1036
+ /**
1037
+ * The amount of commit to grant.
1038
+ */
1039
+ access_amount: RecurringCommit.AccessAmount;
1040
+ /**
1041
+ * The amount of time each of the created commits will be valid for
1042
+ */
1043
+ commit_duration: RecurringCommit.CommitDuration;
1044
+ priority: number;
1045
+ product: RecurringCommit.Product;
1046
+ /**
1047
+ * Whether the created commits will use the commit rate or list rate
1048
+ */
1049
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
1050
+ /**
1051
+ * Offset relative to the contract start date that determines the start time for
1052
+ * the first commit
1053
+ */
1054
+ starting_at_offset: RecurringCommit.StartingAtOffset;
1055
+ /**
1056
+ * Will be passed down to the individual commits
1057
+ */
1058
+ applicable_product_ids?: Array<string>;
1059
+ /**
1060
+ * Will be passed down to the individual commits
1061
+ */
1062
+ applicable_product_tags?: Array<string>;
1063
+ description?: string;
1064
+ /**
1065
+ * Offset relative to the recurring credit start that determines when the contract
1066
+ * will stop creating recurring commits. optional
1067
+ */
1068
+ duration?: RecurringCommit.Duration;
1069
+ /**
1070
+ * The amount the customer should be billed for the commit.
1071
+ */
1072
+ invoice_amount?: RecurringCommit.InvoiceAmount;
1073
+ name?: string;
1074
+ /**
1075
+ * Determines whether the first and last commit will be prorated. If not provided,
1076
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1077
+ */
1078
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1079
+ /**
1080
+ * The frequency at which the recurring commits will be created. If not provided: -
1081
+ * The commits will be created on the usage invoice frequency. If provided: - The
1082
+ * period defined in the duration will correspond to this frequency. - Commits will
1083
+ * be created aligned with the recurring commit's starting_at rather than the usage
1084
+ * invoice dates.
1085
+ */
1086
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1087
+ /**
1088
+ * Will be passed down to the individual commits. This controls how much of an
1089
+ * individual unexpired commit will roll over upon contract transition. Must be
1090
+ * between 0 and 1.
1091
+ */
1092
+ rollover_fraction?: number;
1093
+ /**
1094
+ * List of filters that determine what kind of customer usage draws down a commit
1095
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1096
+ * specifiers to contribute to a commit's or credit's drawdown.
1097
+ */
1098
+ specifiers?: Array<Shared.CommitSpecifier>;
1099
+ /**
1100
+ * Attach a subscription to the recurring commit/credit.
1101
+ */
1102
+ subscription_config?: RecurringCommit.SubscriptionConfig;
1103
+ }
1104
+ namespace RecurringCommit {
1105
+ /**
1106
+ * The amount of commit to grant.
1107
+ */
1108
+ interface AccessAmount {
1109
+ credit_type_id: string;
1110
+ unit_price: number;
1111
+ quantity?: number;
1112
+ }
1113
+ /**
1114
+ * The amount of time each of the created commits will be valid for
1115
+ */
1116
+ interface CommitDuration {
1117
+ value: number;
1118
+ unit?: 'PERIODS';
1119
+ }
1120
+ interface Product {
1121
+ id: string;
1122
+ name: string;
1123
+ }
1124
+ /**
1125
+ * Offset relative to the contract start date that determines the start time for
1126
+ * the first commit
1127
+ */
1128
+ interface StartingAtOffset {
1129
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1130
+ value: number;
1131
+ }
1132
+ /**
1133
+ * Offset relative to the recurring credit start that determines when the contract
1134
+ * will stop creating recurring commits. optional
1135
+ */
1136
+ interface Duration {
1137
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1138
+ value: number;
1139
+ }
1140
+ /**
1141
+ * The amount the customer should be billed for the commit.
1142
+ */
1143
+ interface InvoiceAmount {
1144
+ credit_type_id: string;
1145
+ quantity: number;
1146
+ unit_price: number;
1147
+ }
1148
+ /**
1149
+ * Attach a subscription to the recurring commit/credit.
1150
+ */
1151
+ interface SubscriptionConfig {
1152
+ allocation: 'INDIVIDUAL' | 'POOLED';
1153
+ apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
1154
+ subscription_template_id: string;
1155
+ }
1156
+ namespace SubscriptionConfig {
1157
+ interface ApplySeatIncreaseConfig {
1158
+ /**
1159
+ * Indicates whether a mid-period seat increase should be prorated.
1160
+ */
1161
+ is_prorated: boolean;
1162
+ }
1163
+ }
1164
+ }
1165
+ interface RecurringCredit {
1166
+ id: string;
1167
+ /**
1168
+ * The amount of commit to grant.
1169
+ */
1170
+ access_amount: RecurringCredit.AccessAmount;
1171
+ /**
1172
+ * The amount of time each of the created commits will be valid for
1173
+ */
1174
+ commit_duration: RecurringCredit.CommitDuration;
1175
+ priority: number;
1176
+ product: RecurringCredit.Product;
1177
+ /**
1178
+ * Whether the created commits will use the commit rate or list rate
1179
+ */
1180
+ rate_type: 'COMMIT_RATE' | 'LIST_RATE';
1181
+ /**
1182
+ * Offset relative to the contract start date that determines the start time for
1183
+ * the first commit
1184
+ */
1185
+ starting_at_offset: RecurringCredit.StartingAtOffset;
1186
+ /**
1187
+ * Will be passed down to the individual commits
1188
+ */
1189
+ applicable_product_ids?: Array<string>;
1190
+ /**
1191
+ * Will be passed down to the individual commits
1192
+ */
1193
+ applicable_product_tags?: Array<string>;
1194
+ description?: string;
1195
+ /**
1196
+ * Offset relative to the recurring credit start that determines when the contract
1197
+ * will stop creating recurring commits. optional
1198
+ */
1199
+ duration?: RecurringCredit.Duration;
1200
+ name?: string;
1201
+ /**
1202
+ * Determines whether the first and last commit will be prorated. If not provided,
1203
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1204
+ */
1205
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1206
+ /**
1207
+ * The frequency at which the recurring commits will be created. If not provided: -
1208
+ * The commits will be created on the usage invoice frequency. If provided: - The
1209
+ * period defined in the duration will correspond to this frequency. - Commits will
1210
+ * be created aligned with the recurring commit's starting_at rather than the usage
1211
+ * invoice dates.
1212
+ */
1213
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1214
+ /**
1215
+ * Will be passed down to the individual commits. This controls how much of an
1216
+ * individual unexpired commit will roll over upon contract transition. Must be
1217
+ * between 0 and 1.
1218
+ */
1219
+ rollover_fraction?: number;
1220
+ /**
1221
+ * List of filters that determine what kind of customer usage draws down a commit
1222
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1223
+ * specifiers to contribute to a commit's or credit's drawdown.
1224
+ */
1225
+ specifiers?: Array<Shared.CommitSpecifier>;
1226
+ /**
1227
+ * Attach a subscription to the recurring commit/credit.
1228
+ */
1229
+ subscription_config?: RecurringCredit.SubscriptionConfig;
1230
+ }
1231
+ namespace RecurringCredit {
1232
+ /**
1233
+ * The amount of commit to grant.
1234
+ */
1235
+ interface AccessAmount {
1236
+ credit_type_id: string;
1237
+ unit_price: number;
1238
+ quantity?: number;
1239
+ }
1240
+ /**
1241
+ * The amount of time each of the created commits will be valid for
1242
+ */
1243
+ interface CommitDuration {
1244
+ value: number;
1245
+ unit?: 'PERIODS';
1246
+ }
1247
+ interface Product {
1248
+ id: string;
1249
+ name: string;
1250
+ }
1251
+ /**
1252
+ * Offset relative to the contract start date that determines the start time for
1253
+ * the first commit
1254
+ */
1255
+ interface StartingAtOffset {
1256
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1257
+ value: number;
1258
+ }
1259
+ /**
1260
+ * Offset relative to the recurring credit start that determines when the contract
1261
+ * will stop creating recurring commits. optional
1262
+ */
1263
+ interface Duration {
1264
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1265
+ value: number;
1266
+ }
1267
+ /**
1268
+ * Attach a subscription to the recurring commit/credit.
1269
+ */
1270
+ interface SubscriptionConfig {
1271
+ allocation: 'INDIVIDUAL' | 'POOLED';
1272
+ apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
1273
+ subscription_template_id: string;
1274
+ }
1275
+ namespace SubscriptionConfig {
1276
+ interface ApplySeatIncreaseConfig {
1277
+ /**
1278
+ * Indicates whether a mid-period seat increase should be prorated.
1279
+ */
1280
+ is_prorated: boolean;
1281
+ }
1282
+ }
1283
+ }
1284
+ interface Subscription {
1285
+ collection_schedule: 'ADVANCE' | 'ARREARS';
1286
+ proration: Subscription.Proration;
1287
+ subscription_rate: Subscription.SubscriptionRate;
1288
+ id?: string;
1289
+ /**
1290
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1291
+ */
1292
+ custom_fields?: {
1293
+ [key: string]: string;
1294
+ };
1295
+ description?: string;
1296
+ duration?: Subscription.Duration;
1297
+ fiat_credit_type_id?: string;
1298
+ initial_quantity?: number;
1299
+ name?: string;
1300
+ /**
1301
+ * Determines how the subscription's quantity is controlled. Defaults to
1302
+ * QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
1303
+ * directly on the subscription. `initial_quantity` must be provided with this
1304
+ * option. Compatible with recurring commits/credits that use POOLED allocation.
1305
+ * **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
1306
+ * user_123) to increment and decrement a subscription quantity, rather than
1307
+ * directly providing the quantity. You must use a SEAT_BASED subscription to use a
1308
+ * linked recurring credit with an allocation per seat. `seat_config` must be
1309
+ * provided with this option.
1310
+ */
1311
+ quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY';
1312
+ seat_config?: Subscription.SeatConfig;
1313
+ starting_at_offset?: Subscription.StartingAtOffset;
1314
+ }
1315
+ namespace Subscription {
1316
+ interface Proration {
1317
+ invoice_behavior: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
1318
+ is_prorated: boolean;
1319
+ }
1320
+ interface SubscriptionRate {
1321
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1322
+ product: SubscriptionRate.Product;
1323
+ }
1324
+ namespace SubscriptionRate {
1325
+ interface Product {
1326
+ id: string;
1327
+ name: string;
1328
+ }
1329
+ }
1330
+ interface Duration {
1331
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1332
+ value: number;
1333
+ }
1334
+ interface SeatConfig {
1335
+ /**
1336
+ * The property name, sent on usage events, that identifies the seat ID associated
1337
+ * with the usage event. For example, the property name might be seat_id or
1338
+ * user_id. The property must be set as a group key on billable metrics and a
1339
+ * presentation/pricing group key on contract products. This allows linked
1340
+ * recurring credits with an allocation per seat to be consumed by only one seat's
1341
+ * usage.
1342
+ */
1343
+ seat_group_key: string;
1344
+ }
1345
+ interface StartingAtOffset {
1346
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1347
+ value: number;
1348
+ }
1349
+ }
1350
+ }
1351
+ export interface PackageArchiveResponse {
1352
+ data: Shared.ID;
1353
+ }
1354
+ export interface PackageListContractsOnPackageResponse {
1355
+ contract_id: string;
1356
+ customer_id: string;
1357
+ starting_at: string;
1358
+ archived_at?: string;
1359
+ ending_before?: string;
1360
+ }
1361
+ export interface PackageCreateParams {
1362
+ name: string;
1363
+ /**
1364
+ * Reference this alias when creating a contract. If the same alias is assigned to
1365
+ * multiple packages, it will reference the package to which it was most recently
1366
+ * assigned. It is not exposed to end customers.
1367
+ */
1368
+ aliases?: Array<PackageCreateParams.Alias>;
1369
+ billing_anchor_date?: 'contract_start_date' | 'first_billing_period';
1370
+ billing_provider?: 'aws_marketplace' | 'azure_marketplace' | 'gcp_marketplace' | 'stripe' | 'netsuite';
1371
+ commits?: Array<PackageCreateParams.Commit>;
1372
+ contract_name?: string;
1373
+ credits?: Array<PackageCreateParams.Credit>;
1374
+ delivery_method?: 'direct_to_billing_provider' | 'aws_sqs' | 'tackle' | 'aws_sns';
1375
+ duration?: PackageCreateParams.Duration;
1376
+ /**
1377
+ * Defaults to LOWEST_MULTIPLIER, which applies the greatest discount to list
1378
+ * prices automatically. EXPLICIT prioritization requires specifying priorities for
1379
+ * each multiplier; the one with the lowest priority value will be prioritized
1380
+ * first. If tiered overrides are used, prioritization must be explicit.
1381
+ */
1382
+ multiplier_override_prioritization?: 'LOWEST_MULTIPLIER' | 'EXPLICIT';
1383
+ net_payment_terms_days?: number;
1384
+ overrides?: Array<PackageCreateParams.Override>;
1385
+ prepaid_balance_threshold_configuration?: Shared.PrepaidBalanceThresholdConfiguration;
1386
+ /**
1387
+ * Selects the rate card linked to the specified alias as of the contract's start
1388
+ * date.
1389
+ */
1390
+ rate_card_alias?: string;
1391
+ rate_card_id?: string;
1392
+ recurring_commits?: Array<PackageCreateParams.RecurringCommit>;
1393
+ recurring_credits?: Array<PackageCreateParams.RecurringCredit>;
1394
+ scheduled_charges?: Array<PackageCreateParams.ScheduledCharge>;
1395
+ /**
1396
+ * Determines which scheduled and commit charges to consolidate onto the Contract's
1397
+ * usage invoice. The charge's `timestamp` must match the usage invoice's
1398
+ * `ending_before` date for consolidation to occur. This field cannot be modified
1399
+ * after a Contract has been created. If this field is omitted, charges will appear
1400
+ * on a separate invoice from usage charges.
1401
+ */
1402
+ scheduled_charges_on_usage_invoices?: 'ALL';
1403
+ spend_threshold_configuration?: Shared.SpendThresholdConfiguration;
1404
+ subscriptions?: Array<PackageCreateParams.Subscription>;
1405
+ /**
1406
+ * Prevents the creation of duplicates. If a request to create a record is made
1407
+ * with a previously used uniqueness key, a new record will not be created and the
1408
+ * request will fail with a 409 error.
1409
+ */
1410
+ uniqueness_key?: string;
1411
+ usage_statement_schedule?: PackageCreateParams.UsageStatementSchedule;
1412
+ }
1413
+ export declare namespace PackageCreateParams {
1414
+ interface Alias {
1415
+ name: string;
1416
+ ending_before?: string;
1417
+ starting_at?: string;
1418
+ }
1419
+ interface Commit {
1420
+ /**
1421
+ * Required: Schedule for distributing the commit to the customer. For "POSTPAID"
1422
+ * commits only one schedule item is allowed and amount must match invoice_schedule
1423
+ * total.
1424
+ */
1425
+ access_schedule: Commit.AccessSchedule;
1426
+ product_id: string;
1427
+ type: 'PREPAID' | 'POSTPAID';
1428
+ /**
1429
+ * Which products the commit applies to. If applicable_product_ids,
1430
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1431
+ * all products.
1432
+ */
1433
+ applicable_product_ids?: Array<string>;
1434
+ /**
1435
+ * Which tags the commit applies to. If applicable_product_ids,
1436
+ * applicable_product_tags or specifiers are not provided, the commit applies to
1437
+ * all products.
1438
+ */
1439
+ applicable_product_tags?: Array<string>;
1440
+ /**
1441
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1442
+ */
1443
+ custom_fields?: {
1444
+ [key: string]: string;
1445
+ };
1446
+ /**
1447
+ * Used only in UI/API. It is not exposed to end customers.
1448
+ */
1449
+ description?: string;
1450
+ /**
1451
+ * Required for "POSTPAID" commits: the true up invoice will be generated at this
1452
+ * time and only one schedule item is allowed; the total must match access_schedule
1453
+ * amount. Optional for "PREPAID" commits: if not provided, this will be a
1454
+ * "complimentary" commit with no invoice.
1455
+ */
1456
+ invoice_schedule?: Commit.InvoiceSchedule;
1457
+ /**
1458
+ * displayed on invoices
1459
+ */
1460
+ name?: string;
1461
+ /**
1462
+ * If multiple commits are applicable, the one with the lower priority will apply
1463
+ * first.
1464
+ */
1465
+ priority?: number;
1466
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
1467
+ /**
1468
+ * Fraction of unused segments that will be rolled over. Must be between 0 and 1.
1469
+ */
1470
+ rollover_fraction?: number;
1471
+ /**
1472
+ * List of filters that determine what kind of customer usage draws down a commit
1473
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1474
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1475
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1476
+ */
1477
+ specifiers?: Array<Shared.CommitSpecifierInput>;
1478
+ /**
1479
+ * A temporary ID for the commit that can be used to reference the commit for
1480
+ * commit specific overrides.
1481
+ */
1482
+ temporary_id?: string;
1483
+ }
1484
+ namespace Commit {
1485
+ /**
1486
+ * Required: Schedule for distributing the commit to the customer. For "POSTPAID"
1487
+ * commits only one schedule item is allowed and amount must match invoice_schedule
1488
+ * total.
1489
+ */
1490
+ interface AccessSchedule {
1491
+ schedule_items: Array<AccessSchedule.ScheduleItem>;
1492
+ /**
1493
+ * Defaults to USD (cents) if not passed
1494
+ */
1495
+ credit_type_id?: string;
1496
+ }
1497
+ namespace AccessSchedule {
1498
+ interface ScheduleItem {
1499
+ amount: number;
1500
+ /**
1501
+ * Offset relative to the start of this segment indicating when it should end.
1502
+ */
1503
+ duration: ScheduleItem.Duration;
1504
+ /**
1505
+ * Date relative to the contract start date indicating the start of this schedule
1506
+ * segment.
1507
+ */
1508
+ starting_at_offset: ScheduleItem.StartingAtOffset;
1509
+ }
1510
+ namespace ScheduleItem {
1511
+ /**
1512
+ * Offset relative to the start of this segment indicating when it should end.
1513
+ */
1514
+ interface Duration {
1515
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1516
+ value: number;
1517
+ }
1518
+ /**
1519
+ * Date relative to the contract start date indicating the start of this schedule
1520
+ * segment.
1521
+ */
1522
+ interface StartingAtOffset {
1523
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1524
+ value: number;
1525
+ }
1526
+ }
1527
+ }
1528
+ /**
1529
+ * Required for "POSTPAID" commits: the true up invoice will be generated at this
1530
+ * time and only one schedule item is allowed; the total must match access_schedule
1531
+ * amount. Optional for "PREPAID" commits: if not provided, this will be a
1532
+ * "complimentary" commit with no invoice.
1533
+ */
1534
+ interface InvoiceSchedule {
1535
+ /**
1536
+ * Either provide amount or provide both unit_price and quantity.
1537
+ */
1538
+ schedule_items: Array<InvoiceSchedule.ScheduleItem>;
1539
+ /**
1540
+ * Defaults to USD (cents) if not passed.
1541
+ */
1542
+ credit_type_id?: string;
1543
+ /**
1544
+ * If true, this schedule will not generate an invoice.
1545
+ */
1546
+ do_not_invoice?: boolean;
1547
+ }
1548
+ namespace InvoiceSchedule {
1549
+ interface ScheduleItem {
1550
+ /**
1551
+ * Date relative to the contract start date.
1552
+ */
1553
+ date_offset: ScheduleItem.DateOffset;
1554
+ /**
1555
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
1556
+ * amount.
1557
+ */
1558
+ quantity: number;
1559
+ /**
1560
+ * Unit price for the charge. Will be multiplied by quantity to determine the
1561
+ * amount.
1562
+ */
1563
+ unit_price: number;
1564
+ }
1565
+ namespace ScheduleItem {
1566
+ /**
1567
+ * Date relative to the contract start date.
1568
+ */
1569
+ interface DateOffset {
1570
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1571
+ value: number;
1572
+ }
1573
+ }
1574
+ }
1575
+ }
1576
+ interface Credit {
1577
+ /**
1578
+ * Schedule for distributing the credit to the customer.
1579
+ */
1580
+ access_schedule: Credit.AccessSchedule;
1581
+ product_id: string;
1582
+ /**
1583
+ * Which products the credit applies to. If both applicable_product_ids and
1584
+ * applicable_product_tags are not provided, the credit applies to all products.
1585
+ */
1586
+ applicable_product_ids?: Array<string>;
1587
+ /**
1588
+ * Which tags the credit applies to. If both applicable_product_ids and
1589
+ * applicable_product_tags are not provided, the credit applies to all products.
1590
+ */
1591
+ applicable_product_tags?: Array<string>;
1592
+ /**
1593
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
1594
+ */
1595
+ custom_fields?: {
1596
+ [key: string]: string;
1597
+ };
1598
+ /**
1599
+ * Used only in UI/API. It is not exposed to end customers.
1600
+ */
1601
+ description?: string;
1602
+ /**
1603
+ * displayed on invoices
1604
+ */
1605
+ name?: string;
1606
+ /**
1607
+ * If multiple credits are applicable, the one with the lower priority will apply
1608
+ * first.
1609
+ */
1610
+ priority?: number;
1611
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
1612
+ /**
1613
+ * List of filters that determine what kind of customer usage draws down a commit
1614
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1615
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1616
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1617
+ */
1618
+ specifiers?: Array<Shared.CommitSpecifierInput>;
1619
+ }
1620
+ namespace Credit {
1621
+ /**
1622
+ * Schedule for distributing the credit to the customer.
1623
+ */
1624
+ interface AccessSchedule {
1625
+ schedule_items: Array<AccessSchedule.ScheduleItem>;
1626
+ /**
1627
+ * Defaults to USD (cents) if not passed
1628
+ */
1629
+ credit_type_id?: string;
1630
+ }
1631
+ namespace AccessSchedule {
1632
+ interface ScheduleItem {
1633
+ amount: number;
1634
+ /**
1635
+ * Offset relative to the start of this segment indicating when it should end.
1636
+ */
1637
+ duration: ScheduleItem.Duration;
1638
+ /**
1639
+ * Date relative to the contract start date indicating the start of this schedule
1640
+ * segment.
1641
+ */
1642
+ starting_at_offset: ScheduleItem.StartingAtOffset;
1643
+ }
1644
+ namespace ScheduleItem {
1645
+ /**
1646
+ * Offset relative to the start of this segment indicating when it should end.
1647
+ */
1648
+ interface Duration {
1649
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1650
+ value: number;
1651
+ }
1652
+ /**
1653
+ * Date relative to the contract start date indicating the start of this schedule
1654
+ * segment.
1655
+ */
1656
+ interface StartingAtOffset {
1657
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1658
+ value: number;
1659
+ }
1660
+ }
1661
+ }
1662
+ }
1663
+ interface Duration {
1664
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1665
+ value: number;
1666
+ }
1667
+ interface Override {
1668
+ /**
1669
+ * Specifies which products the override will apply to.
1670
+ */
1671
+ override_specifiers: Array<Override.OverrideSpecifier>;
1672
+ /**
1673
+ * Offset relative to contract start date indicating when the override will start
1674
+ * applying (inclusive)
1675
+ */
1676
+ starting_at_offset: Override.StartingAtOffset;
1677
+ /**
1678
+ * Offset relative to override start indicating when the override will stop
1679
+ * applying (exclusive)
1680
+ */
1681
+ duration?: Override.Duration;
1682
+ entitled?: boolean;
1683
+ /**
1684
+ * Indicates whether the override should only apply to commits. Defaults to
1685
+ * `false`. If `true`, you can specify relevant commits in `override_specifiers` by
1686
+ * passing `commit_ids`. if you do not specify `commit_ids`, then the override will
1687
+ * apply when consuming any prepaid or postpaid commit.
1688
+ */
1689
+ is_commit_specific?: boolean;
1690
+ /**
1691
+ * Required for MULTIPLIER type. Must be >=0.
1692
+ */
1693
+ multiplier?: number;
1694
+ /**
1695
+ * Required for OVERWRITE type.
1696
+ */
1697
+ overwrite_rate?: Override.OverwriteRate;
1698
+ /**
1699
+ * Required for EXPLICIT multiplier prioritization scheme and all TIERED overrides.
1700
+ * Under EXPLICIT prioritization, overwrites are prioritized first, and then tiered
1701
+ * and multiplier overrides are prioritized by their priority value (lowest first).
1702
+ * Must be > 0.
1703
+ */
1704
+ priority?: number;
1705
+ /**
1706
+ * Indicates whether the override applies to commit rates or list rates. Can only
1707
+ * be used for overrides that have `is_commit_specific` set to `true`. Defaults to
1708
+ * `"LIST_RATE"`.
1709
+ */
1710
+ target?: 'COMMIT_RATE' | 'LIST_RATE';
1711
+ /**
1712
+ * Required for TIERED type. Must have at least one tier.
1713
+ */
1714
+ tiers?: Array<Override.Tier>;
1715
+ /**
1716
+ * Overwrites are prioritized over multipliers and tiered overrides.
1717
+ */
1718
+ type?: 'OVERWRITE' | 'MULTIPLIER' | 'TIERED';
1719
+ }
1720
+ namespace Override {
1721
+ interface OverrideSpecifier {
1722
+ billing_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1723
+ /**
1724
+ * Can only be used for commit specific overrides. Must be used in conjunction with
1725
+ * one of `product_id`, `product_tags`, `pricing_group_values`, or
1726
+ * `presentation_group_values`. If provided, the override will only apply to the
1727
+ * specified commits. If not provided, the override will apply to all commits.
1728
+ */
1729
+ commit_ids?: Array<string>;
1730
+ /**
1731
+ * A map of group names to values. The override will only apply to line items with
1732
+ * the specified presentation group values.
1733
+ */
1734
+ presentation_group_values?: {
1735
+ [key: string]: string;
1736
+ };
1737
+ /**
1738
+ * A map of pricing group names to values. The override will only apply to products
1739
+ * with the specified pricing group values.
1740
+ */
1741
+ pricing_group_values?: {
1742
+ [key: string]: string;
1743
+ };
1744
+ /**
1745
+ * If provided, the override will only apply to the product with the specified ID.
1746
+ */
1747
+ product_id?: string;
1748
+ /**
1749
+ * If provided, the override will only apply to products with all the specified
1750
+ * tags.
1751
+ */
1752
+ product_tags?: Array<string>;
1753
+ /**
1754
+ * Can only be used for commit specific overrides. Must be used in conjunction with
1755
+ * one of `product_id`, `product_tags`, `pricing_group_values`, or
1756
+ * `presentation_group_values`. If provided, the override will only apply to
1757
+ * commits created by the specified recurring commit ids.
1758
+ */
1759
+ recurring_commit_ids?: Array<string>;
1760
+ /**
1761
+ * Can only be used for commit specific overrides. Must be used in conjunction with
1762
+ * one of `product_id`, `product_tags`, `pricing_group_values`, or
1763
+ * `presentation_group_values`. If provided, the override will only apply to
1764
+ * credits created by the specified recurring credit ids.
1765
+ */
1766
+ recurring_credit_ids?: Array<string>;
1767
+ }
1768
+ /**
1769
+ * Offset relative to contract start date indicating when the override will start
1770
+ * applying (inclusive)
1771
+ */
1772
+ interface StartingAtOffset {
1773
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1774
+ value: number;
1775
+ }
1776
+ /**
1777
+ * Offset relative to override start indicating when the override will stop
1778
+ * applying (exclusive)
1779
+ */
1780
+ interface Duration {
1781
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1782
+ value: number;
1783
+ }
1784
+ /**
1785
+ * Required for OVERWRITE type.
1786
+ */
1787
+ interface OverwriteRate {
1788
+ rate_type: 'FLAT' | 'PERCENTAGE' | 'SUBSCRIPTION' | 'TIERED' | 'TIERED_PERCENTAGE' | 'CUSTOM';
1789
+ credit_type_id?: string;
1790
+ /**
1791
+ * Only set for CUSTOM rate_type. This field is interpreted by custom rate
1792
+ * processors.
1793
+ */
1794
+ custom_rate?: {
1795
+ [key: string]: unknown;
1796
+ };
1797
+ /**
1798
+ * Default proration configuration. Only valid for SUBSCRIPTION rate_type. Must be
1799
+ * set to true.
1800
+ */
1801
+ is_prorated?: boolean;
1802
+ /**
1803
+ * Default price. For FLAT rate_type, this must be >=0. For PERCENTAGE rate_type,
1804
+ * this is a decimal fraction, e.g. use 0.1 for 10%; this must be >=0 and <=1.
1805
+ */
1806
+ price?: number;
1807
+ /**
1808
+ * Default quantity. For SUBSCRIPTION rate_type, this must be >=0.
1809
+ */
1810
+ quantity?: number;
1811
+ /**
1812
+ * Only set for TIERED rate_type.
1813
+ */
1814
+ tiers?: Array<Shared.Tier>;
1815
+ }
1816
+ interface Tier {
1817
+ multiplier: number;
1818
+ size?: number;
1819
+ }
1820
+ }
1821
+ interface RecurringCommit {
1822
+ /**
1823
+ * The amount of commit to grant.
1824
+ */
1825
+ access_amount: RecurringCommit.AccessAmount;
1826
+ /**
1827
+ * Defines the length of the access schedule for each created commit/credit. The
1828
+ * value represents the number of units. Unit defaults to "PERIODS", where the
1829
+ * length of a period is determined by the recurrence_frequency.
1830
+ */
1831
+ commit_duration: RecurringCommit.CommitDuration;
1832
+ /**
1833
+ * Will be passed down to the individual commits
1834
+ */
1835
+ priority: number;
1836
+ product_id: string;
1837
+ /**
1838
+ * Offset relative to the contract start date that determines the start time for
1839
+ * the first commit
1840
+ */
1841
+ starting_at_offset: RecurringCommit.StartingAtOffset;
1842
+ /**
1843
+ * Will be passed down to the individual commits
1844
+ */
1845
+ applicable_product_ids?: Array<string>;
1846
+ /**
1847
+ * Will be passed down to the individual commits
1848
+ */
1849
+ applicable_product_tags?: Array<string>;
1850
+ /**
1851
+ * Will be passed down to the individual commits
1852
+ */
1853
+ description?: string;
1854
+ /**
1855
+ * Offset relative to the recurring credit start that determines when the contract
1856
+ * will stop creating recurring commits. optional
1857
+ */
1858
+ duration?: RecurringCommit.Duration;
1859
+ /**
1860
+ * The amount the customer should be billed for the commit. Not required.
1861
+ */
1862
+ invoice_amount?: RecurringCommit.InvoiceAmount;
1863
+ /**
1864
+ * displayed on invoices. will be passed through to the individual commits
1865
+ */
1866
+ name?: string;
1867
+ /**
1868
+ * Determines whether the first and last commit will be prorated. If not provided,
1869
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
1870
+ */
1871
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
1872
+ /**
1873
+ * Whether the created commits will use the commit rate or list rate
1874
+ */
1875
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
1876
+ /**
1877
+ * The frequency at which the recurring commits will be created. If not provided: -
1878
+ * The commits will be created on the usage invoice frequency. If provided: - The
1879
+ * period defined in the duration will correspond to this frequency. - Commits will
1880
+ * be created aligned with the recurring commit's starting_at rather than the usage
1881
+ * invoice dates.
1882
+ */
1883
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
1884
+ /**
1885
+ * Will be passed down to the individual commits. This controls how much of an
1886
+ * individual unexpired commit will roll over upon contract transition. Must be
1887
+ * between 0 and 1.
1888
+ */
1889
+ rollover_fraction?: number;
1890
+ /**
1891
+ * List of filters that determine what kind of customer usage draws down a commit
1892
+ * or credit. A customer's usage needs to meet the condition of at least one of the
1893
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
1894
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
1895
+ */
1896
+ specifiers?: Array<Shared.CommitSpecifierInput>;
1897
+ /**
1898
+ * Attach a subscription to the recurring commit/credit.
1899
+ */
1900
+ subscription_config?: RecurringCommit.SubscriptionConfig;
1901
+ /**
1902
+ * A temporary ID that can be used to reference the recurring commit for commit
1903
+ * specific overrides.
1904
+ */
1905
+ temporary_id?: string;
1906
+ }
1907
+ namespace RecurringCommit {
1908
+ /**
1909
+ * The amount of commit to grant.
1910
+ */
1911
+ interface AccessAmount {
1912
+ credit_type_id: string;
1913
+ unit_price: number;
1914
+ /**
1915
+ * This field is required unless a subscription is attached via
1916
+ * `subscription_config`.
1917
+ */
1918
+ quantity?: number;
1919
+ }
1920
+ /**
1921
+ * Defines the length of the access schedule for each created commit/credit. The
1922
+ * value represents the number of units. Unit defaults to "PERIODS", where the
1923
+ * length of a period is determined by the recurrence_frequency.
1924
+ */
1925
+ interface CommitDuration {
1926
+ value: number;
1927
+ unit?: 'PERIODS';
1928
+ }
1929
+ /**
1930
+ * Offset relative to the contract start date that determines the start time for
1931
+ * the first commit
1932
+ */
1933
+ interface StartingAtOffset {
1934
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1935
+ value: number;
1936
+ }
1937
+ /**
1938
+ * Offset relative to the recurring credit start that determines when the contract
1939
+ * will stop creating recurring commits. optional
1940
+ */
1941
+ interface Duration {
1942
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
1943
+ value: number;
1944
+ }
1945
+ /**
1946
+ * The amount the customer should be billed for the commit. Not required.
1947
+ */
1948
+ interface InvoiceAmount {
1949
+ credit_type_id: string;
1950
+ quantity: number;
1951
+ unit_price: number;
1952
+ }
1953
+ /**
1954
+ * Attach a subscription to the recurring commit/credit.
1955
+ */
1956
+ interface SubscriptionConfig {
1957
+ apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
1958
+ /**
1959
+ * ID of the subscription to configure on the recurring commit/credit.
1960
+ */
1961
+ subscription_id: string;
1962
+ /**
1963
+ * If set to POOLED, allocation added per seat is pooled across the account. If set
1964
+ * to INDIVIDUAL, each seat in the subscription will have its own allocation.
1965
+ */
1966
+ allocation?: 'INDIVIDUAL' | 'POOLED';
1967
+ }
1968
+ namespace SubscriptionConfig {
1969
+ interface ApplySeatIncreaseConfig {
1970
+ /**
1971
+ * Indicates whether a mid-period seat increase should be prorated.
1972
+ */
1973
+ is_prorated: boolean;
1974
+ }
1975
+ }
1976
+ }
1977
+ interface RecurringCredit {
1978
+ /**
1979
+ * The amount of commit to grant.
1980
+ */
1981
+ access_amount: RecurringCredit.AccessAmount;
1982
+ /**
1983
+ * Defines the length of the access schedule for each created commit/credit. The
1984
+ * value represents the number of units. Unit defaults to "PERIODS", where the
1985
+ * length of a period is determined by the recurrence_frequency.
1986
+ */
1987
+ commit_duration: RecurringCredit.CommitDuration;
1988
+ /**
1989
+ * Will be passed down to the individual commits
1990
+ */
1991
+ priority: number;
1992
+ product_id: string;
1993
+ /**
1994
+ * Offset relative to the contract start date that determines the start time for
1995
+ * the first commit
1996
+ */
1997
+ starting_at_offset: RecurringCredit.StartingAtOffset;
1998
+ /**
1999
+ * Will be passed down to the individual commits
2000
+ */
2001
+ applicable_product_ids?: Array<string>;
2002
+ /**
2003
+ * Will be passed down to the individual commits
2004
+ */
2005
+ applicable_product_tags?: Array<string>;
2006
+ /**
2007
+ * Will be passed down to the individual commits
2008
+ */
2009
+ description?: string;
2010
+ /**
2011
+ * Offset relative to the recurring credit start that determines when the contract
2012
+ * will stop creating recurring commits. optional
2013
+ */
2014
+ duration?: RecurringCredit.Duration;
2015
+ /**
2016
+ * displayed on invoices. will be passed through to the individual commits
2017
+ */
2018
+ name?: string;
2019
+ /**
2020
+ * Determines whether the first and last commit will be prorated. If not provided,
2021
+ * the default is FIRST_AND_LAST (i.e. prorate both the first and last commits).
2022
+ */
2023
+ proration?: 'NONE' | 'FIRST' | 'LAST' | 'FIRST_AND_LAST';
2024
+ /**
2025
+ * Whether the created commits will use the commit rate or list rate
2026
+ */
2027
+ rate_type?: 'COMMIT_RATE' | 'LIST_RATE';
2028
+ /**
2029
+ * The frequency at which the recurring commits will be created. If not provided: -
2030
+ * The commits will be created on the usage invoice frequency. If provided: - The
2031
+ * period defined in the duration will correspond to this frequency. - Commits will
2032
+ * be created aligned with the recurring commit's starting_at rather than the usage
2033
+ * invoice dates.
2034
+ */
2035
+ recurrence_frequency?: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2036
+ /**
2037
+ * Will be passed down to the individual commits. This controls how much of an
2038
+ * individual unexpired commit will roll over upon contract transition. Must be
2039
+ * between 0 and 1.
2040
+ */
2041
+ rollover_fraction?: number;
2042
+ /**
2043
+ * List of filters that determine what kind of customer usage draws down a commit
2044
+ * or credit. A customer's usage needs to meet the condition of at least one of the
2045
+ * specifiers to contribute to a commit's or credit's drawdown. This field cannot
2046
+ * be used together with `applicable_product_ids` or `applicable_product_tags`.
2047
+ */
2048
+ specifiers?: Array<Shared.CommitSpecifierInput>;
2049
+ /**
2050
+ * Attach a subscription to the recurring commit/credit.
2051
+ */
2052
+ subscription_config?: RecurringCredit.SubscriptionConfig;
2053
+ /**
2054
+ * A temporary ID that can be used to reference the recurring commit for commit
2055
+ * specific overrides.
2056
+ */
2057
+ temporary_id?: string;
2058
+ }
2059
+ namespace RecurringCredit {
2060
+ /**
2061
+ * The amount of commit to grant.
2062
+ */
2063
+ interface AccessAmount {
2064
+ credit_type_id: string;
2065
+ unit_price: number;
2066
+ /**
2067
+ * This field is required unless a subscription is attached via
2068
+ * `subscription_config`.
2069
+ */
2070
+ quantity?: number;
2071
+ }
2072
+ /**
2073
+ * Defines the length of the access schedule for each created commit/credit. The
2074
+ * value represents the number of units. Unit defaults to "PERIODS", where the
2075
+ * length of a period is determined by the recurrence_frequency.
2076
+ */
2077
+ interface CommitDuration {
2078
+ value: number;
2079
+ unit?: 'PERIODS';
2080
+ }
2081
+ /**
2082
+ * Offset relative to the contract start date that determines the start time for
2083
+ * the first commit
2084
+ */
2085
+ interface StartingAtOffset {
2086
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
2087
+ value: number;
2088
+ }
2089
+ /**
2090
+ * Offset relative to the recurring credit start that determines when the contract
2091
+ * will stop creating recurring commits. optional
2092
+ */
2093
+ interface Duration {
2094
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
2095
+ value: number;
2096
+ }
2097
+ /**
2098
+ * Attach a subscription to the recurring commit/credit.
2099
+ */
2100
+ interface SubscriptionConfig {
2101
+ apply_seat_increase_config: SubscriptionConfig.ApplySeatIncreaseConfig;
2102
+ /**
2103
+ * ID of the subscription to configure on the recurring commit/credit.
2104
+ */
2105
+ subscription_id: string;
2106
+ /**
2107
+ * If set to POOLED, allocation added per seat is pooled across the account. If set
2108
+ * to INDIVIDUAL, each seat in the subscription will have its own allocation.
2109
+ */
2110
+ allocation?: 'INDIVIDUAL' | 'POOLED';
2111
+ }
2112
+ namespace SubscriptionConfig {
2113
+ interface ApplySeatIncreaseConfig {
2114
+ /**
2115
+ * Indicates whether a mid-period seat increase should be prorated.
2116
+ */
2117
+ is_prorated: boolean;
2118
+ }
2119
+ }
2120
+ }
2121
+ interface ScheduledCharge {
2122
+ product_id: string;
2123
+ /**
2124
+ * Must provide schedule_items.
2125
+ */
2126
+ schedule: ScheduledCharge.Schedule;
2127
+ /**
2128
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2129
+ */
2130
+ custom_fields?: {
2131
+ [key: string]: string;
2132
+ };
2133
+ /**
2134
+ * displayed on invoices
2135
+ */
2136
+ name?: string;
2137
+ }
2138
+ namespace ScheduledCharge {
2139
+ /**
2140
+ * Must provide schedule_items.
2141
+ */
2142
+ interface Schedule {
2143
+ /**
2144
+ * Either provide amount or provide both unit_price and quantity.
2145
+ */
2146
+ schedule_items: Array<Schedule.ScheduleItem>;
2147
+ /**
2148
+ * Defaults to USD (cents) if not passed.
2149
+ */
2150
+ credit_type_id?: string;
2151
+ }
2152
+ namespace Schedule {
2153
+ interface ScheduleItem {
2154
+ /**
2155
+ * Date relative to the contract start date.
2156
+ */
2157
+ date_offset: ScheduleItem.DateOffset;
2158
+ /**
2159
+ * Quantity for the charge. Will be multiplied by unit_price to determine the
2160
+ * amount.
2161
+ */
2162
+ quantity: number;
2163
+ /**
2164
+ * Unit price for the charge. Will be multiplied by quantity to determine the
2165
+ * amount.
2166
+ */
2167
+ unit_price: number;
2168
+ }
2169
+ namespace ScheduleItem {
2170
+ /**
2171
+ * Date relative to the contract start date.
2172
+ */
2173
+ interface DateOffset {
2174
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
2175
+ value: number;
2176
+ }
2177
+ }
2178
+ }
2179
+ }
2180
+ interface Subscription {
2181
+ collection_schedule: 'ADVANCE' | 'ARREARS';
2182
+ proration: Subscription.Proration;
2183
+ subscription_rate: Subscription.SubscriptionRate;
2184
+ /**
2185
+ * Custom fields to be added eg. { "key1": "value1", "key2": "value2" }
2186
+ */
2187
+ custom_fields?: {
2188
+ [key: string]: string;
2189
+ };
2190
+ description?: string;
2191
+ /**
2192
+ * Lifetime of the subscription from its start. If not provided, subscription
2193
+ * inherits contract end date.
2194
+ */
2195
+ duration?: Subscription.Duration;
2196
+ /**
2197
+ * The initial quantity for the subscription. It must be non-negative value.
2198
+ * Required if quantity_management_mode is QUANTITY_ONLY.
2199
+ */
2200
+ initial_quantity?: number;
2201
+ name?: string;
2202
+ /**
2203
+ * Determines how the subscription's quantity is controlled. Defaults to
2204
+ * QUANTITY_ONLY. **QUANTITY_ONLY**: The subscription quantity is specified
2205
+ * directly on the subscription. `initial_quantity` must be provided with this
2206
+ * option. Compatible with recurring commits/credits that use POOLED allocation.
2207
+ * **SEAT_BASED**: Use when you want to pass specific seat identifiers (e.g. add
2208
+ * user_123) to increment and decrement a subscription quantity, rather than
2209
+ * directly providing the quantity. You must use a **SEAT_BASED** subscription to
2210
+ * use a linked recurring credit with an allocation per seat. `seat_config` must be
2211
+ * provided with this option.
2212
+ */
2213
+ quantity_management_mode?: 'SEAT_BASED' | 'QUANTITY_ONLY';
2214
+ seat_config?: Subscription.SeatConfig;
2215
+ /**
2216
+ * Relative date from contract start date corresponding to the inclusive start time
2217
+ * for the subscription. If not provided, defaults to contract start date
2218
+ */
2219
+ starting_at_offset?: Subscription.StartingAtOffset;
2220
+ /**
2221
+ * A temporary ID used to reference the subscription in recurring commit/credit
2222
+ * subscription configs created within the same payload.
2223
+ */
2224
+ temporary_id?: string;
2225
+ }
2226
+ namespace Subscription {
2227
+ interface Proration {
2228
+ /**
2229
+ * Indicates how mid-period quantity adjustments are invoiced.
2230
+ * **BILL_IMMEDIATELY**: Only available when collection schedule is `ADVANCE`. The
2231
+ * quantity increase will be billed immediately on the scheduled date.
2232
+ * **BILL_ON_NEXT_COLLECTION_DATE**: The quantity increase will be billed for
2233
+ * in-arrears at the end of the period.
2234
+ */
2235
+ invoice_behavior?: 'BILL_IMMEDIATELY' | 'BILL_ON_NEXT_COLLECTION_DATE';
2236
+ /**
2237
+ * Indicates if the partial period will be prorated or charged a full amount.
2238
+ */
2239
+ is_prorated?: boolean;
2240
+ }
2241
+ interface SubscriptionRate {
2242
+ /**
2243
+ * Frequency to bill subscription with. Together with product_id, must match
2244
+ * existing rate on the rate card.
2245
+ */
2246
+ billing_frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2247
+ /**
2248
+ * Must be subscription type product
2249
+ */
2250
+ product_id: string;
2251
+ }
2252
+ /**
2253
+ * Lifetime of the subscription from its start. If not provided, subscription
2254
+ * inherits contract end date.
2255
+ */
2256
+ interface Duration {
2257
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
2258
+ value: number;
2259
+ }
2260
+ interface SeatConfig {
2261
+ /**
2262
+ * The property name, sent on usage events, that identifies the seat ID associated
2263
+ * with the usage event. For example, the property name might be seat_id or
2264
+ * user_id. The property must be set as a group key on billable metrics and a
2265
+ * presentation/pricing group key on contract products. This allows linked
2266
+ * recurring credits with an allocation per seat to be consumed by only one seat's
2267
+ * usage.
2268
+ */
2269
+ seat_group_key: string;
2270
+ /**
2271
+ * The initial amount of unassigned seats on this subscription.
2272
+ */
2273
+ initial_unassigned_seats?: number;
2274
+ }
2275
+ /**
2276
+ * Relative date from contract start date corresponding to the inclusive start time
2277
+ * for the subscription. If not provided, defaults to contract start date
2278
+ */
2279
+ interface StartingAtOffset {
2280
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
2281
+ value: number;
2282
+ }
2283
+ }
2284
+ interface UsageStatementSchedule {
2285
+ frequency: 'MONTHLY' | 'QUARTERLY' | 'ANNUAL' | 'WEEKLY';
2286
+ /**
2287
+ * If not provided, defaults to the first day of the month.
2288
+ */
2289
+ day?: 'FIRST_OF_MONTH' | 'CONTRACT_START';
2290
+ /**
2291
+ * The offset at which Metronome should start generating usage invoices, relative
2292
+ * to the contract start date. If unspecified, contract start date will be used.
2293
+ * This is useful to set if you want to import historical invoices via our 'Create
2294
+ * Historical Invoices' API rather than having Metronome automatically generate
2295
+ * them.
2296
+ */
2297
+ invoice_generation_starting_at_offset?: UsageStatementSchedule.InvoiceGenerationStartingAtOffset;
2298
+ }
2299
+ namespace UsageStatementSchedule {
2300
+ /**
2301
+ * The offset at which Metronome should start generating usage invoices, relative
2302
+ * to the contract start date. If unspecified, contract start date will be used.
2303
+ * This is useful to set if you want to import historical invoices via our 'Create
2304
+ * Historical Invoices' API rather than having Metronome automatically generate
2305
+ * them.
2306
+ */
2307
+ interface InvoiceGenerationStartingAtOffset {
2308
+ unit: 'DAYS' | 'WEEKS' | 'MONTHS' | 'YEARS';
2309
+ value: number;
2310
+ }
2311
+ }
2312
+ }
2313
+ export interface PackageRetrieveParams {
2314
+ package_id: string;
2315
+ }
2316
+ export interface PackageListParams extends CursorPageParams {
2317
+ /**
2318
+ * Body param: Filter packages by archived status. Defaults to NOT_ARCHIVED.
2319
+ */
2320
+ archive_filter?: 'ARCHIVED' | 'NOT_ARCHIVED' | 'ALL';
2321
+ }
2322
+ export interface PackageArchiveParams {
2323
+ /**
2324
+ * ID of the package to archive
2325
+ */
2326
+ package_id: string;
2327
+ }
2328
+ export interface PackageListContractsOnPackageParams extends CursorPageParams {
2329
+ /**
2330
+ * Body param
2331
+ */
2332
+ package_id: string;
2333
+ /**
2334
+ * Body param: Optional RFC 3339 timestamp. Only include contracts active on the
2335
+ * provided date. This cannot be provided if starting_at filter is provided.
2336
+ */
2337
+ covering_date?: string;
2338
+ /**
2339
+ * Body param: Default false. Determines whether to include archived contracts in
2340
+ * the results
2341
+ */
2342
+ include_archived?: boolean;
2343
+ /**
2344
+ * Body param: Optional RFC 3339 timestamp. Only include contracts that started on
2345
+ * or after this date. This cannot be provided if covering_date filter is provided.
2346
+ */
2347
+ starting_at?: string;
2348
+ }
2349
+ export declare namespace Packages {
2350
+ export { type PackageCreateResponse as PackageCreateResponse, type PackageRetrieveResponse as PackageRetrieveResponse, type PackageListResponse as PackageListResponse, type PackageArchiveResponse as PackageArchiveResponse, type PackageListContractsOnPackageResponse as PackageListContractsOnPackageResponse, type PackageListResponsesCursorPage as PackageListResponsesCursorPage, type PackageListContractsOnPackageResponsesCursorPage as PackageListContractsOnPackageResponsesCursorPage, type PackageCreateParams as PackageCreateParams, type PackageRetrieveParams as PackageRetrieveParams, type PackageListParams as PackageListParams, type PackageArchiveParams as PackageArchiveParams, type PackageListContractsOnPackageParams as PackageListContractsOnPackageParams, };
2351
+ }
2352
+ //# sourceMappingURL=packages.d.mts.map