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