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