@metronome/sdk 3.0.0 → 3.5.0

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