orb-billing 1.21.0 → 1.23.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 (1115) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/LICENSE +201 -0
  3. package/README.md +196 -192
  4. package/_shims/MultipartBody.d.ts +9 -0
  5. package/_shims/MultipartBody.d.ts.map +1 -0
  6. package/_shims/MultipartBody.js +16 -0
  7. package/_shims/MultipartBody.js.map +1 -0
  8. package/_shims/MultipartBody.mjs +12 -0
  9. package/_shims/MultipartBody.mjs.map +1 -0
  10. package/_shims/README.md +46 -0
  11. package/_shims/auto/runtime-bun.d.ts +5 -0
  12. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  13. package/_shims/auto/runtime-bun.js +21 -0
  14. package/_shims/auto/runtime-bun.js.map +1 -0
  15. package/_shims/auto/runtime-bun.mjs +2 -0
  16. package/_shims/auto/runtime-bun.mjs.map +1 -0
  17. package/_shims/auto/runtime-node.d.ts +5 -0
  18. package/_shims/auto/runtime-node.d.ts.map +1 -0
  19. package/_shims/auto/runtime-node.js +21 -0
  20. package/_shims/auto/runtime-node.js.map +1 -0
  21. package/_shims/auto/runtime-node.mjs +2 -0
  22. package/_shims/auto/runtime-node.mjs.map +1 -0
  23. package/_shims/auto/runtime.d.ts +5 -0
  24. package/_shims/auto/runtime.d.ts.map +1 -0
  25. package/_shims/auto/runtime.js +21 -0
  26. package/_shims/auto/runtime.js.map +1 -0
  27. package/_shims/auto/runtime.mjs +2 -0
  28. package/_shims/auto/runtime.mjs.map +1 -0
  29. package/_shims/auto/types-node.d.ts +5 -0
  30. package/_shims/auto/types-node.d.ts.map +1 -0
  31. package/_shims/auto/types-node.js +21 -0
  32. package/_shims/auto/types-node.js.map +1 -0
  33. package/_shims/auto/types-node.mjs +2 -0
  34. package/_shims/auto/types-node.mjs.map +1 -0
  35. package/_shims/auto/types.d.ts +101 -0
  36. package/_shims/auto/types.js +3 -0
  37. package/_shims/auto/types.mjs +3 -0
  38. package/_shims/bun-runtime.d.ts +6 -0
  39. package/_shims/bun-runtime.d.ts.map +1 -0
  40. package/_shims/bun-runtime.js +14 -0
  41. package/_shims/bun-runtime.js.map +1 -0
  42. package/_shims/bun-runtime.mjs +10 -0
  43. package/_shims/bun-runtime.mjs.map +1 -0
  44. package/_shims/index.d.ts +81 -0
  45. package/_shims/index.js +13 -0
  46. package/_shims/index.mjs +7 -0
  47. package/_shims/manual-types.d.ts +12 -0
  48. package/_shims/manual-types.js +3 -0
  49. package/_shims/manual-types.mjs +3 -0
  50. package/_shims/node-runtime.d.ts +3 -0
  51. package/_shims/node-runtime.d.ts.map +1 -0
  52. package/_shims/node-runtime.js +90 -0
  53. package/_shims/node-runtime.js.map +1 -0
  54. package/_shims/node-runtime.mjs +56 -0
  55. package/_shims/node-runtime.mjs.map +1 -0
  56. package/_shims/node-types.d.ts +42 -0
  57. package/_shims/node-types.js +3 -0
  58. package/_shims/node-types.mjs +3 -0
  59. package/_shims/registry.d.ts +37 -0
  60. package/_shims/registry.d.ts.map +1 -0
  61. package/_shims/registry.js +41 -0
  62. package/_shims/registry.js.map +1 -0
  63. package/_shims/registry.mjs +37 -0
  64. package/_shims/registry.mjs.map +1 -0
  65. package/_shims/web-runtime.d.ts +5 -0
  66. package/_shims/web-runtime.d.ts.map +1 -0
  67. package/_shims/web-runtime.js +78 -0
  68. package/_shims/web-runtime.js.map +1 -0
  69. package/_shims/web-runtime.mjs +71 -0
  70. package/_shims/web-runtime.mjs.map +1 -0
  71. package/_shims/web-types.d.ts +83 -0
  72. package/_shims/web-types.js +3 -0
  73. package/_shims/web-types.mjs +3 -0
  74. package/core.d.ts +239 -0
  75. package/core.d.ts.map +1 -0
  76. package/core.js +830 -0
  77. package/core.js.map +1 -0
  78. package/core.mjs +799 -0
  79. package/core.mjs.map +1 -0
  80. package/error.d.ts +131 -0
  81. package/error.d.ts.map +1 -0
  82. package/error.js +298 -0
  83. package/error.js.map +1 -0
  84. package/error.mjs +271 -0
  85. package/error.mjs.map +1 -0
  86. package/index.d.mts +210 -0
  87. package/index.d.ts +210 -0
  88. package/index.d.ts.map +1 -0
  89. package/index.js +153 -0
  90. package/index.js.map +1 -0
  91. package/index.mjs +125 -0
  92. package/index.mjs.map +1 -0
  93. package/package.json +90 -27
  94. package/pagination.d.ts +31 -0
  95. package/pagination.d.ts.map +1 -0
  96. package/pagination.js +34 -0
  97. package/pagination.js.map +1 -0
  98. package/pagination.mjs +30 -0
  99. package/pagination.mjs.map +1 -0
  100. package/resource.d.ts +12 -0
  101. package/resource.d.ts.map +1 -0
  102. package/resource.js +17 -0
  103. package/resource.js.map +1 -0
  104. package/resource.mjs +13 -0
  105. package/resource.mjs.map +1 -0
  106. package/resources/coupons/coupons.d.ts +114 -0
  107. package/resources/coupons/coupons.d.ts.map +1 -0
  108. package/resources/coupons/coupons.js +76 -0
  109. package/resources/coupons/coupons.js.map +1 -0
  110. package/resources/coupons/coupons.mjs +48 -0
  111. package/resources/coupons/coupons.mjs.map +1 -0
  112. package/resources/coupons/index.d.ts +3 -0
  113. package/resources/coupons/index.d.ts.map +1 -0
  114. package/resources/coupons/index.js +10 -0
  115. package/resources/coupons/index.js.map +1 -0
  116. package/resources/coupons/index.mjs +4 -0
  117. package/resources/coupons/index.mjs.map +1 -0
  118. package/resources/coupons/subscriptions.d.ts +23 -0
  119. package/resources/coupons/subscriptions.d.ts.map +1 -0
  120. package/resources/coupons/subscriptions.js +20 -0
  121. package/resources/coupons/subscriptions.js.map +1 -0
  122. package/resources/coupons/subscriptions.mjs +16 -0
  123. package/resources/coupons/subscriptions.mjs.map +1 -0
  124. package/resources/credit-notes.d.ts +136 -0
  125. package/resources/credit-notes.d.ts.map +1 -0
  126. package/resources/credit-notes.js +54 -0
  127. package/resources/credit-notes.js.map +1 -0
  128. package/resources/credit-notes.mjs +26 -0
  129. package/resources/credit-notes.mjs.map +1 -0
  130. package/resources/customers/balance-transactions.d.ts +159 -0
  131. package/resources/customers/balance-transactions.d.ts.map +1 -0
  132. package/resources/customers/balance-transactions.js +54 -0
  133. package/resources/customers/balance-transactions.js.map +1 -0
  134. package/resources/customers/balance-transactions.mjs +26 -0
  135. package/resources/customers/balance-transactions.mjs.map +1 -0
  136. package/resources/customers/costs.d.ts +915 -0
  137. package/resources/customers/costs.d.ts.map +1 -0
  138. package/resources/customers/costs.js +24 -0
  139. package/resources/customers/costs.js.map +1 -0
  140. package/resources/customers/costs.mjs +20 -0
  141. package/resources/customers/costs.mjs.map +1 -0
  142. package/resources/customers/credits/credits.d.ts +58 -0
  143. package/resources/customers/credits/credits.d.ts.map +1 -0
  144. package/resources/customers/credits/credits.js +68 -0
  145. package/resources/customers/credits/credits.js.map +1 -0
  146. package/resources/customers/credits/credits.mjs +39 -0
  147. package/resources/customers/credits/credits.mjs.map +1 -0
  148. package/resources/customers/credits/index.d.ts +3 -0
  149. package/resources/customers/credits/index.d.ts.map +1 -0
  150. package/resources/customers/credits/index.js +13 -0
  151. package/resources/customers/credits/index.js.map +1 -0
  152. package/resources/customers/credits/index.mjs +4 -0
  153. package/resources/customers/credits/index.mjs.map +1 -0
  154. package/resources/customers/credits/ledger.d.ts +1537 -0
  155. package/resources/customers/credits/ledger.d.ts.map +1 -0
  156. package/resources/customers/credits/ledger.js +291 -0
  157. package/resources/customers/credits/ledger.js.map +1 -0
  158. package/resources/customers/credits/ledger.mjs +262 -0
  159. package/resources/customers/credits/ledger.mjs.map +1 -0
  160. package/resources/customers/customers.d.ts +524 -0
  161. package/resources/customers/customers.d.ts.map +1 -0
  162. package/resources/customers/customers.js +135 -0
  163. package/resources/customers/customers.js.map +1 -0
  164. package/resources/customers/customers.mjs +107 -0
  165. package/resources/customers/customers.mjs.map +1 -0
  166. package/resources/customers/index.d.ts +6 -0
  167. package/resources/customers/index.d.ts.map +1 -0
  168. package/resources/customers/index.js +19 -0
  169. package/resources/customers/index.js.map +1 -0
  170. package/resources/customers/index.mjs +7 -0
  171. package/resources/customers/index.mjs.map +1 -0
  172. package/resources/customers/usage.d.ts +306 -0
  173. package/resources/customers/usage.d.ts.map +1 -0
  174. package/resources/customers/usage.js +223 -0
  175. package/resources/customers/usage.js.map +1 -0
  176. package/resources/customers/usage.mjs +219 -0
  177. package/resources/customers/usage.mjs.map +1 -0
  178. package/resources/events/backfills.d.ts +250 -0
  179. package/resources/events/backfills.d.ts.map +1 -0
  180. package/resources/events/backfills.js +104 -0
  181. package/resources/events/backfills.js.map +1 -0
  182. package/resources/events/backfills.mjs +76 -0
  183. package/resources/events/backfills.mjs.map +1 -0
  184. package/resources/events/events.d.ts +547 -0
  185. package/resources/events/events.d.ts.map +1 -0
  186. package/resources/events/events.js +354 -0
  187. package/resources/events/events.js.map +1 -0
  188. package/resources/events/events.mjs +327 -0
  189. package/resources/events/events.mjs.map +1 -0
  190. package/resources/events/index.d.ts +3 -0
  191. package/resources/events/index.d.ts.map +1 -0
  192. package/resources/events/index.js +10 -0
  193. package/resources/events/index.js.map +1 -0
  194. package/resources/events/index.mjs +4 -0
  195. package/resources/events/index.mjs.map +1 -0
  196. package/resources/index.d.ts +13 -0
  197. package/resources/index.d.ts.map +1 -0
  198. package/resources/index.js +39 -0
  199. package/resources/index.js.map +1 -0
  200. package/resources/index.mjs +14 -0
  201. package/resources/index.mjs.map +1 -0
  202. package/resources/invoice-line-items.d.ts +434 -0
  203. package/resources/invoice-line-items.d.ts.map +1 -0
  204. package/resources/invoice-line-items.js +18 -0
  205. package/resources/invoice-line-items.js.map +1 -0
  206. package/resources/invoice-line-items.mjs +14 -0
  207. package/resources/invoice-line-items.mjs.map +1 -0
  208. package/resources/invoices.d.ts +1541 -0
  209. package/resources/invoices.d.ts.map +1 -0
  210. package/resources/invoices.js +96 -0
  211. package/resources/invoices.js.map +1 -0
  212. package/resources/invoices.mjs +68 -0
  213. package/resources/invoices.mjs.map +1 -0
  214. package/resources/items.d.ts +61 -0
  215. package/resources/items.d.ts.map +1 -0
  216. package/resources/items.js +53 -0
  217. package/resources/items.js.map +1 -0
  218. package/resources/items.mjs +25 -0
  219. package/resources/items.mjs.map +1 -0
  220. package/resources/metrics.d.ts +176 -0
  221. package/resources/metrics.d.ts.map +1 -0
  222. package/resources/metrics.js +63 -0
  223. package/resources/metrics.js.map +1 -0
  224. package/resources/metrics.mjs +35 -0
  225. package/resources/metrics.mjs.map +1 -0
  226. package/resources/plans/external-plan-id.d.ts +50 -0
  227. package/resources/plans/external-plan-id.d.ts.map +1 -0
  228. package/resources/plans/external-plan-id.js +35 -0
  229. package/resources/plans/external-plan-id.js.map +1 -0
  230. package/resources/plans/external-plan-id.mjs +31 -0
  231. package/resources/plans/external-plan-id.mjs.map +1 -0
  232. package/resources/plans/index.d.ts +3 -0
  233. package/resources/plans/index.d.ts.map +1 -0
  234. package/resources/plans/index.js +10 -0
  235. package/resources/plans/index.js.map +1 -0
  236. package/resources/plans/index.mjs +4 -0
  237. package/resources/plans/index.mjs.map +1 -0
  238. package/resources/plans/plans.d.ts +256 -0
  239. package/resources/plans/plans.d.ts.map +1 -0
  240. package/resources/plans/plans.js +87 -0
  241. package/resources/plans/plans.js.map +1 -0
  242. package/resources/plans/plans.mjs +59 -0
  243. package/resources/plans/plans.mjs.map +1 -0
  244. package/resources/prices/external-price-id.d.ts +12 -0
  245. package/resources/prices/external-price-id.d.ts.map +1 -0
  246. package/resources/prices/external-price-id.js +17 -0
  247. package/resources/prices/external-price-id.js.map +1 -0
  248. package/resources/prices/external-price-id.mjs +13 -0
  249. package/resources/prices/external-price-id.mjs.map +1 -0
  250. package/resources/prices/index.d.ts +3 -0
  251. package/resources/prices/index.d.ts.map +1 -0
  252. package/resources/prices/index.js +10 -0
  253. package/resources/prices/index.js.map +1 -0
  254. package/resources/prices/index.mjs +4 -0
  255. package/resources/prices/index.mjs.map +1 -0
  256. package/resources/prices/prices.d.ts +1872 -0
  257. package/resources/prices/prices.d.ts.map +1 -0
  258. package/resources/prices/prices.js +74 -0
  259. package/resources/prices/prices.js.map +1 -0
  260. package/resources/prices/prices.mjs +46 -0
  261. package/resources/prices/prices.mjs.map +1 -0
  262. package/resources/subscriptions.d.ts +3752 -0
  263. package/resources/subscriptions.d.ts.map +1 -0
  264. package/resources/subscriptions.js +254 -0
  265. package/resources/subscriptions.js.map +1 -0
  266. package/resources/subscriptions.mjs +225 -0
  267. package/resources/subscriptions.mjs.map +1 -0
  268. package/resources/top-level.d.ts +21 -0
  269. package/resources/top-level.d.ts.map +1 -0
  270. package/resources/top-level.js +22 -0
  271. package/resources/top-level.js.map +1 -0
  272. package/resources/top-level.mjs +18 -0
  273. package/resources/top-level.mjs.map +1 -0
  274. package/shims/node.d.ts +29 -0
  275. package/shims/node.d.ts.map +1 -0
  276. package/shims/node.js +31 -0
  277. package/shims/node.js.map +1 -0
  278. package/shims/node.mjs +5 -0
  279. package/shims/node.mjs.map +1 -0
  280. package/shims/web.d.ts +26 -0
  281. package/shims/web.d.ts.map +1 -0
  282. package/shims/web.js +31 -0
  283. package/shims/web.js.map +1 -0
  284. package/shims/web.mjs +5 -0
  285. package/shims/web.mjs.map +1 -0
  286. package/src/_shims/MultipartBody.ts +9 -0
  287. package/src/_shims/README.md +46 -0
  288. package/src/_shims/auto/runtime-bun.ts +4 -0
  289. package/src/_shims/auto/runtime-node.ts +4 -0
  290. package/src/_shims/auto/runtime.ts +4 -0
  291. package/src/_shims/auto/types-node.ts +4 -0
  292. package/src/_shims/auto/types.d.ts +101 -0
  293. package/src/_shims/auto/types.js +3 -0
  294. package/src/_shims/auto/types.mjs +3 -0
  295. package/src/_shims/bun-runtime.ts +14 -0
  296. package/src/_shims/index.d.ts +81 -0
  297. package/src/_shims/index.js +13 -0
  298. package/src/_shims/index.mjs +7 -0
  299. package/src/_shims/manual-types.d.ts +12 -0
  300. package/src/_shims/manual-types.js +3 -0
  301. package/src/_shims/manual-types.mjs +3 -0
  302. package/src/_shims/node-runtime.ts +83 -0
  303. package/src/_shims/node-types.d.ts +42 -0
  304. package/src/_shims/node-types.js +3 -0
  305. package/src/_shims/node-types.mjs +3 -0
  306. package/src/_shims/registry.ts +67 -0
  307. package/src/_shims/web-runtime.ts +103 -0
  308. package/src/_shims/web-types.d.ts +83 -0
  309. package/src/_shims/web-types.js +3 -0
  310. package/src/_shims/web-types.mjs +3 -0
  311. package/src/core.ts +1099 -0
  312. package/src/error.ts +469 -0
  313. package/src/index.ts +305 -0
  314. package/src/pagination.ts +63 -0
  315. package/src/resource.ts +24 -0
  316. package/src/resources/coupons/coupons.ts +150 -0
  317. package/src/resources/coupons/index.ts +4 -0
  318. package/src/resources/coupons/subscriptions.ts +45 -0
  319. package/src/resources/credit-notes.ts +184 -0
  320. package/src/resources/customers/balance-transactions.ts +222 -0
  321. package/src/resources/customers/costs.ts +991 -0
  322. package/src/resources/customers/credits/credits.ts +113 -0
  323. package/src/resources/customers/credits/index.ts +24 -0
  324. package/src/resources/customers/credits/ledger.ts +2254 -0
  325. package/src/resources/customers/customers.ts +734 -0
  326. package/src/resources/customers/index.ts +42 -0
  327. package/src/resources/customers/usage.ts +350 -0
  328. package/src/resources/events/backfills.ts +324 -0
  329. package/src/resources/events/events.ts +635 -0
  330. package/src/resources/events/index.ts +23 -0
  331. package/src/resources/index.ts +72 -0
  332. package/src/resources/invoice-line-items.ts +502 -0
  333. package/src/resources/invoices.ts +1906 -0
  334. package/src/resources/items.ts +106 -0
  335. package/src/resources/metrics.ts +264 -0
  336. package/src/resources/plans/external-plan-id.ts +73 -0
  337. package/src/resources/plans/index.ts +4 -0
  338. package/src/resources/plans/plans.ts +350 -0
  339. package/src/resources/prices/external-price-id.ts +16 -0
  340. package/src/resources/prices/index.ts +4 -0
  341. package/src/resources/prices/prices.ts +2466 -0
  342. package/src/resources/subscriptions.ts +4590 -0
  343. package/src/resources/top-level.ts +27 -0
  344. package/src/shims/node.ts +50 -0
  345. package/src/shims/web.ts +50 -0
  346. package/src/tsconfig.json +11 -0
  347. package/src/uploads.ts +246 -0
  348. package/src/version.ts +1 -0
  349. package/uploads.d.ts +75 -0
  350. package/uploads.d.ts.map +1 -0
  351. package/uploads.js +162 -0
  352. package/uploads.js.map +1 -0
  353. package/uploads.mjs +149 -0
  354. package/uploads.mjs.map +1 -0
  355. package/version.d.ts +2 -0
  356. package/version.d.ts.map +1 -0
  357. package/version.js +5 -0
  358. package/version.js.map +1 -0
  359. package/version.mjs +2 -0
  360. package/version.mjs.map +1 -0
  361. package/LICENSE.md +0 -21
  362. package/dist/index.d.ts +0 -1
  363. package/dist/index.js +0 -20
  364. package/dist/internal/utils/contenttype.d.ts +0 -1
  365. package/dist/internal/utils/contenttype.js +0 -33
  366. package/dist/internal/utils/headers.d.ts +0 -4
  367. package/dist/internal/utils/headers.js +0 -92
  368. package/dist/internal/utils/index.d.ts +0 -8
  369. package/dist/internal/utils/index.js +0 -27
  370. package/dist/internal/utils/pathparams.d.ts +0 -2
  371. package/dist/internal/utils/pathparams.js +0 -53
  372. package/dist/internal/utils/queryparams.d.ts +0 -2
  373. package/dist/internal/utils/queryparams.js +0 -178
  374. package/dist/internal/utils/requestbody.d.ts +0 -2
  375. package/dist/internal/utils/requestbody.js +0 -318
  376. package/dist/internal/utils/retries.d.ts +0 -20
  377. package/dist/internal/utils/retries.js +0 -250
  378. package/dist/internal/utils/security.d.ts +0 -5
  379. package/dist/internal/utils/security.js +0 -188
  380. package/dist/internal/utils/utils.d.ts +0 -37
  381. package/dist/internal/utils/utils.js +0 -370
  382. package/dist/sdk/availability.d.ts +0 -18
  383. package/dist/sdk/availability.js +0 -186
  384. package/dist/sdk/coupon.d.ts +0 -62
  385. package/dist/sdk/coupon.js +0 -629
  386. package/dist/sdk/credit.d.ts +0 -348
  387. package/dist/sdk/credit.js +0 -1020
  388. package/dist/sdk/creditnote.d.ts +0 -29
  389. package/dist/sdk/creditnote.js +0 -293
  390. package/dist/sdk/customer.d.ts +0 -529
  391. package/dist/sdk/customer.js +0 -1882
  392. package/dist/sdk/event.d.ts +0 -353
  393. package/dist/sdk/event.js +0 -1314
  394. package/dist/sdk/index.d.ts +0 -1
  395. package/dist/sdk/index.js +0 -20
  396. package/dist/sdk/invoice.d.ts +0 -89
  397. package/dist/sdk/invoice.js +0 -945
  398. package/dist/sdk/item.d.ts +0 -27
  399. package/dist/sdk/item.js +0 -291
  400. package/dist/sdk/metric.d.ts +0 -39
  401. package/dist/sdk/metric.js +0 -418
  402. package/dist/sdk/models/errors/fivehundrederror.d.ts +0 -11
  403. package/dist/sdk/models/errors/fivehundrederror.js +0 -88
  404. package/dist/sdk/models/errors/fourhundredandoneerror.d.ts +0 -11
  405. package/dist/sdk/models/errors/fourhundredandoneerror.js +0 -88
  406. package/dist/sdk/models/errors/fourhundredandtwentynineerror.d.ts +0 -11
  407. package/dist/sdk/models/errors/fourhundredandtwentynineerror.js +0 -88
  408. package/dist/sdk/models/errors/index.d.ts +0 -4
  409. package/dist/sdk/models/errors/index.js +0 -23
  410. package/dist/sdk/models/errors/sdkerror.d.ts +0 -7
  411. package/dist/sdk/models/errors/sdkerror.js +0 -40
  412. package/dist/sdk/models/operations/addeditpriceintervals.d.ts +0 -25
  413. package/dist/sdk/models/operations/addeditpriceintervals.js +0 -95
  414. package/dist/sdk/models/operations/amendevent.d.ts +0 -25
  415. package/dist/sdk/models/operations/amendevent.js +0 -95
  416. package/dist/sdk/models/operations/amendusage.d.ts +0 -27
  417. package/dist/sdk/models/operations/amendusage.js +0 -103
  418. package/dist/sdk/models/operations/amendusageexternalcustomerid.d.ts +0 -27
  419. package/dist/sdk/models/operations/amendusageexternalcustomerid.js +0 -103
  420. package/dist/sdk/models/operations/archivecoupon.d.ts +0 -24
  421. package/dist/sdk/models/operations/archivecoupon.js +0 -91
  422. package/dist/sdk/models/operations/cancelsubscription.d.ts +0 -25
  423. package/dist/sdk/models/operations/cancelsubscription.js +0 -95
  424. package/dist/sdk/models/operations/closebackfill.d.ts +0 -24
  425. package/dist/sdk/models/operations/closebackfill.js +0 -91
  426. package/dist/sdk/models/operations/createbackfill.d.ts +0 -21
  427. package/dist/sdk/models/operations/createbackfill.js +0 -79
  428. package/dist/sdk/models/operations/createcoupon.d.ts +0 -21
  429. package/dist/sdk/models/operations/createcoupon.js +0 -79
  430. package/dist/sdk/models/operations/createcustomer.d.ts +0 -21
  431. package/dist/sdk/models/operations/createcustomer.js +0 -79
  432. package/dist/sdk/models/operations/createcustomerbalancetransaction.d.ts +0 -25
  433. package/dist/sdk/models/operations/createcustomerbalancetransaction.js +0 -95
  434. package/dist/sdk/models/operations/createinvoice.d.ts +0 -21
  435. package/dist/sdk/models/operations/createinvoice.js +0 -79
  436. package/dist/sdk/models/operations/createinvoicelineitem.d.ts +0 -21
  437. package/dist/sdk/models/operations/createinvoicelineitem.js +0 -79
  438. package/dist/sdk/models/operations/createledgerentry.d.ts +0 -24
  439. package/dist/sdk/models/operations/createledgerentry.js +0 -71
  440. package/dist/sdk/models/operations/createledgerentryexternalid.d.ts +0 -24
  441. package/dist/sdk/models/operations/createledgerentryexternalid.js +0 -71
  442. package/dist/sdk/models/operations/createmetric.d.ts +0 -21
  443. package/dist/sdk/models/operations/createmetric.js +0 -79
  444. package/dist/sdk/models/operations/createplan.d.ts +0 -21
  445. package/dist/sdk/models/operations/createplan.js +0 -79
  446. package/dist/sdk/models/operations/createprice.d.ts +0 -20
  447. package/dist/sdk/models/operations/createprice.js +0 -55
  448. package/dist/sdk/models/operations/createsubscription.d.ts +0 -21
  449. package/dist/sdk/models/operations/createsubscription.js +0 -79
  450. package/dist/sdk/models/operations/deletecustomer.d.ts +0 -24
  451. package/dist/sdk/models/operations/deletecustomer.js +0 -91
  452. package/dist/sdk/models/operations/deprecateevent.d.ts +0 -24
  453. package/dist/sdk/models/operations/deprecateevent.js +0 -91
  454. package/dist/sdk/models/operations/fetchbackfill.d.ts +0 -24
  455. package/dist/sdk/models/operations/fetchbackfill.js +0 -91
  456. package/dist/sdk/models/operations/fetchcoupon.d.ts +0 -24
  457. package/dist/sdk/models/operations/fetchcoupon.js +0 -91
  458. package/dist/sdk/models/operations/fetchcreditnote.d.ts +0 -24
  459. package/dist/sdk/models/operations/fetchcreditnote.js +0 -91
  460. package/dist/sdk/models/operations/fetchcustomer.d.ts +0 -24
  461. package/dist/sdk/models/operations/fetchcustomer.js +0 -91
  462. package/dist/sdk/models/operations/fetchcustomercosts.d.ts +0 -38
  463. package/dist/sdk/models/operations/fetchcustomercosts.js +0 -115
  464. package/dist/sdk/models/operations/fetchcustomercostsexternalid.d.ts +0 -38
  465. package/dist/sdk/models/operations/fetchcustomercostsexternalid.js +0 -115
  466. package/dist/sdk/models/operations/fetchcustomercredits.d.ts +0 -26
  467. package/dist/sdk/models/operations/fetchcustomercredits.js +0 -99
  468. package/dist/sdk/models/operations/fetchcustomercreditsexternalid.d.ts +0 -26
  469. package/dist/sdk/models/operations/fetchcustomercreditsexternalid.js +0 -99
  470. package/dist/sdk/models/operations/fetchcustomercreditsledger.d.ts +0 -47
  471. package/dist/sdk/models/operations/fetchcustomercreditsledger.js +0 -146
  472. package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.d.ts +0 -47
  473. package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.js +0 -146
  474. package/dist/sdk/models/operations/fetchcustomerexternalid.d.ts +0 -24
  475. package/dist/sdk/models/operations/fetchcustomerexternalid.js +0 -91
  476. package/dist/sdk/models/operations/fetchinvoice.d.ts +0 -24
  477. package/dist/sdk/models/operations/fetchinvoice.js +0 -91
  478. package/dist/sdk/models/operations/fetchitem.d.ts +0 -24
  479. package/dist/sdk/models/operations/fetchitem.js +0 -91
  480. package/dist/sdk/models/operations/fetchmetric.d.ts +0 -24
  481. package/dist/sdk/models/operations/fetchmetric.js +0 -91
  482. package/dist/sdk/models/operations/fetchplan.d.ts +0 -24
  483. package/dist/sdk/models/operations/fetchplan.js +0 -91
  484. package/dist/sdk/models/operations/fetchplanexternalid.d.ts +0 -24
  485. package/dist/sdk/models/operations/fetchplanexternalid.js +0 -91
  486. package/dist/sdk/models/operations/fetchprice.d.ts +0 -23
  487. package/dist/sdk/models/operations/fetchprice.js +0 -67
  488. package/dist/sdk/models/operations/fetchpriceexternalid.d.ts +0 -23
  489. package/dist/sdk/models/operations/fetchpriceexternalid.js +0 -67
  490. package/dist/sdk/models/operations/fetchsubscription.d.ts +0 -24
  491. package/dist/sdk/models/operations/fetchsubscription.js +0 -91
  492. package/dist/sdk/models/operations/fetchsubscriptioncosts.d.ts +0 -38
  493. package/dist/sdk/models/operations/fetchsubscriptioncosts.js +0 -115
  494. package/dist/sdk/models/operations/fetchsubscriptionschedule.d.ts +0 -30
  495. package/dist/sdk/models/operations/fetchsubscriptionschedule.js +0 -115
  496. package/dist/sdk/models/operations/fetchsubscriptionusage.d.ts +0 -54
  497. package/dist/sdk/models/operations/fetchsubscriptionusage.js +0 -130
  498. package/dist/sdk/models/operations/fetchupcominginvoice.d.ts +0 -24
  499. package/dist/sdk/models/operations/fetchupcominginvoice.js +0 -91
  500. package/dist/sdk/models/operations/index.d.ts +0 -73
  501. package/dist/sdk/models/operations/index.js +0 -92
  502. package/dist/sdk/models/operations/ingest.d.ts +0 -26
  503. package/dist/sdk/models/operations/ingest.js +0 -99
  504. package/dist/sdk/models/operations/issueinvoice.d.ts +0 -24
  505. package/dist/sdk/models/operations/issueinvoice.js +0 -91
  506. package/dist/sdk/models/operations/listbackfills.d.ts +0 -25
  507. package/dist/sdk/models/operations/listbackfills.js +0 -95
  508. package/dist/sdk/models/operations/listbalancetransactions.d.ts +0 -30
  509. package/dist/sdk/models/operations/listbalancetransactions.js +0 -115
  510. package/dist/sdk/models/operations/listcoupons.d.ts +0 -27
  511. package/dist/sdk/models/operations/listcoupons.js +0 -103
  512. package/dist/sdk/models/operations/listcouponsubscriptions.d.ts +0 -26
  513. package/dist/sdk/models/operations/listcouponsubscriptions.js +0 -99
  514. package/dist/sdk/models/operations/listcreditnotes.d.ts +0 -25
  515. package/dist/sdk/models/operations/listcreditnotes.js +0 -95
  516. package/dist/sdk/models/operations/listcustomers.d.ts +0 -29
  517. package/dist/sdk/models/operations/listcustomers.js +0 -111
  518. package/dist/sdk/models/operations/listinvoices.d.ts +0 -62
  519. package/dist/sdk/models/operations/listinvoices.js +0 -189
  520. package/dist/sdk/models/operations/listitems.d.ts +0 -25
  521. package/dist/sdk/models/operations/listitems.js +0 -95
  522. package/dist/sdk/models/operations/listmetrics.d.ts +0 -29
  523. package/dist/sdk/models/operations/listmetrics.js +0 -111
  524. package/dist/sdk/models/operations/listplans.d.ts +0 -41
  525. package/dist/sdk/models/operations/listplans.js +0 -124
  526. package/dist/sdk/models/operations/listprices.d.ts +0 -25
  527. package/dist/sdk/models/operations/listprices.js +0 -95
  528. package/dist/sdk/models/operations/listsubscriptions.d.ts +0 -37
  529. package/dist/sdk/models/operations/listsubscriptions.js +0 -129
  530. package/dist/sdk/models/operations/markinvoiceaspaid.d.ts +0 -25
  531. package/dist/sdk/models/operations/markinvoiceaspaid.js +0 -95
  532. package/dist/sdk/models/operations/ping.d.ts +0 -21
  533. package/dist/sdk/models/operations/ping.js +0 -79
  534. package/dist/sdk/models/operations/revertbackfill.d.ts +0 -24
  535. package/dist/sdk/models/operations/revertbackfill.js +0 -91
  536. package/dist/sdk/models/operations/scheduleplanchange.d.ts +0 -25
  537. package/dist/sdk/models/operations/scheduleplanchange.js +0 -95
  538. package/dist/sdk/models/operations/searchevents.d.ts +0 -30
  539. package/dist/sdk/models/operations/searchevents.js +0 -115
  540. package/dist/sdk/models/operations/triggerphase.d.ts +0 -25
  541. package/dist/sdk/models/operations/triggerphase.js +0 -95
  542. package/dist/sdk/models/operations/unschedulecancellation.d.ts +0 -24
  543. package/dist/sdk/models/operations/unschedulecancellation.js +0 -91
  544. package/dist/sdk/models/operations/unschedulefixedfeequantity.d.ts +0 -25
  545. package/dist/sdk/models/operations/unschedulefixedfeequantity.js +0 -95
  546. package/dist/sdk/models/operations/unscheduleplanchange.d.ts +0 -24
  547. package/dist/sdk/models/operations/unscheduleplanchange.js +0 -91
  548. package/dist/sdk/models/operations/updatecustomer.d.ts +0 -25
  549. package/dist/sdk/models/operations/updatecustomer.js +0 -95
  550. package/dist/sdk/models/operations/updatecustomerexternalid.d.ts +0 -25
  551. package/dist/sdk/models/operations/updatecustomerexternalid.js +0 -95
  552. package/dist/sdk/models/operations/updatefixedfeequantity.d.ts +0 -25
  553. package/dist/sdk/models/operations/updatefixedfeequantity.js +0 -95
  554. package/dist/sdk/models/operations/updateplan.d.ts +0 -25
  555. package/dist/sdk/models/operations/updateplan.js +0 -95
  556. package/dist/sdk/models/operations/updateplanexternal.d.ts +0 -25
  557. package/dist/sdk/models/operations/updateplanexternal.js +0 -95
  558. package/dist/sdk/models/operations/voidinvoice.d.ts +0 -24
  559. package/dist/sdk/models/operations/voidinvoice.js +0 -91
  560. package/dist/sdk/models/shared/accountingprovider.d.ts +0 -9
  561. package/dist/sdk/models/shared/accountingprovider.js +0 -55
  562. package/dist/sdk/models/shared/accountingproviderconfig.d.ts +0 -5
  563. package/dist/sdk/models/shared/accountingproviderconfig.js +0 -50
  564. package/dist/sdk/models/shared/accountingsyncconfiguration.d.ts +0 -6
  565. package/dist/sdk/models/shared/accountingsyncconfiguration.js +0 -52
  566. package/dist/sdk/models/shared/addeditpriceintervalparams.d.ts +0 -13
  567. package/dist/sdk/models/shared/addeditpriceintervalparams.js +0 -54
  568. package/dist/sdk/models/shared/addpriceintervalparams.d.ts +0 -40
  569. package/dist/sdk/models/shared/addpriceintervalparams.js +0 -87
  570. package/dist/sdk/models/shared/address.d.ts +0 -9
  571. package/dist/sdk/models/shared/address.js +0 -70
  572. package/dist/sdk/models/shared/addressinput.d.ts +0 -9
  573. package/dist/sdk/models/shared/addressinput.js +0 -70
  574. package/dist/sdk/models/shared/aggregatedcost.d.ts +0 -15
  575. package/dist/sdk/models/shared/aggregatedcost.js +0 -75
  576. package/dist/sdk/models/shared/amendedevent.d.ts +0 -28
  577. package/dist/sdk/models/shared/amendedevent.js +0 -81
  578. package/dist/sdk/models/shared/amendedusage.d.ts +0 -11
  579. package/dist/sdk/models/shared/amendedusage.js +0 -50
  580. package/dist/sdk/models/shared/amendeventresult.d.ts +0 -7
  581. package/dist/sdk/models/shared/amendeventresult.js +0 -45
  582. package/dist/sdk/models/shared/autocollection.d.ts +0 -15
  583. package/dist/sdk/models/shared/autocollection.js +0 -63
  584. package/dist/sdk/models/shared/backfill.d.ts +0 -27
  585. package/dist/sdk/models/shared/backfill.js +0 -104
  586. package/dist/sdk/models/shared/backfills.d.ts +0 -7
  587. package/dist/sdk/models/shared/backfills.js +0 -54
  588. package/dist/sdk/models/shared/backfillstatus.d.ts +0 -9
  589. package/dist/sdk/models/shared/backfillstatus.js +0 -16
  590. package/dist/sdk/models/shared/billablemetric.d.ts +0 -27
  591. package/dist/sdk/models/shared/billablemetric.js +0 -84
  592. package/dist/sdk/models/shared/billablemetrics.d.ts +0 -7
  593. package/dist/sdk/models/shared/billablemetrics.js +0 -54
  594. package/dist/sdk/models/shared/billingcyclealignment.d.ts +0 -8
  595. package/dist/sdk/models/shared/billingcyclealignment.js +0 -15
  596. package/dist/sdk/models/shared/cancelsubscriptionparams.d.ts +0 -19
  597. package/dist/sdk/models/shared/cancelsubscriptionparams.js +0 -63
  598. package/dist/sdk/models/shared/changeoption.d.ts +0 -5
  599. package/dist/sdk/models/shared/changeoption.js +0 -12
  600. package/dist/sdk/models/shared/coupon.d.ts +0 -40
  601. package/dist/sdk/models/shared/coupon.js +0 -98
  602. package/dist/sdk/models/shared/couponredemption.d.ts +0 -6
  603. package/dist/sdk/models/shared/couponredemption.js +0 -63
  604. package/dist/sdk/models/shared/coupons.d.ts +0 -7
  605. package/dist/sdk/models/shared/coupons.js +0 -54
  606. package/dist/sdk/models/shared/createinvoicelineitemparams.d.ts +0 -28
  607. package/dist/sdk/models/shared/createinvoicelineitemparams.js +0 -81
  608. package/dist/sdk/models/shared/createoneoffinvoiceparams.d.ts +0 -33
  609. package/dist/sdk/models/shared/createoneoffinvoiceparams.js +0 -86
  610. package/dist/sdk/models/shared/creditledgerentries.d.ts +0 -6
  611. package/dist/sdk/models/shared/creditledgerentries.js +0 -52
  612. package/dist/sdk/models/shared/creditnote.d.ts +0 -83
  613. package/dist/sdk/models/shared/creditnote.js +0 -171
  614. package/dist/sdk/models/shared/creditnotelineitem.d.ts +0 -40
  615. package/dist/sdk/models/shared/creditnotelineitem.js +0 -100
  616. package/dist/sdk/models/shared/creditnoteminified.d.ts +0 -7
  617. package/dist/sdk/models/shared/creditnoteminified.js +0 -45
  618. package/dist/sdk/models/shared/creditnotes.d.ts +0 -7
  619. package/dist/sdk/models/shared/creditnotes.js +0 -54
  620. package/dist/sdk/models/shared/creditnotesublineitem.d.ts +0 -6
  621. package/dist/sdk/models/shared/creditnotesublineitem.js +0 -55
  622. package/dist/sdk/models/shared/creditnotesummary.d.ts +0 -12
  623. package/dist/sdk/models/shared/creditnotesummary.js +0 -74
  624. package/dist/sdk/models/shared/customer.d.ts +0 -76
  625. package/dist/sdk/models/shared/customer.js +0 -182
  626. package/dist/sdk/models/shared/customerbalancetransaction.d.ts +0 -42
  627. package/dist/sdk/models/shared/customerbalancetransaction.js +0 -109
  628. package/dist/sdk/models/shared/customerbalancetransactions.d.ts +0 -7
  629. package/dist/sdk/models/shared/customerbalancetransactions.js +0 -54
  630. package/dist/sdk/models/shared/customercosts.d.ts +0 -5
  631. package/dist/sdk/models/shared/customercosts.js +0 -47
  632. package/dist/sdk/models/shared/customercreditbalance.d.ts +0 -7
  633. package/dist/sdk/models/shared/customercreditbalance.js +0 -64
  634. package/dist/sdk/models/shared/customercreditbalances.d.ts +0 -7
  635. package/dist/sdk/models/shared/customercreditbalances.js +0 -54
  636. package/dist/sdk/models/shared/customerminified.d.ts +0 -5
  637. package/dist/sdk/models/shared/customerminified.js +0 -50
  638. package/dist/sdk/models/shared/customers.d.ts +0 -7
  639. package/dist/sdk/models/shared/customers.js +0 -54
  640. package/dist/sdk/models/shared/customertaxid.d.ts +0 -6
  641. package/dist/sdk/models/shared/customertaxid.js +0 -55
  642. package/dist/sdk/models/shared/debug.d.ts +0 -8
  643. package/dist/sdk/models/shared/debug.js +0 -53
  644. package/dist/sdk/models/shared/deletecustomerresponse.d.ts +0 -3
  645. package/dist/sdk/models/shared/deletecustomerresponse.js +0 -30
  646. package/dist/sdk/models/shared/deprecatedeventresult.d.ts +0 -7
  647. package/dist/sdk/models/shared/deprecatedeventresult.js +0 -45
  648. package/dist/sdk/models/shared/discount.d.ts +0 -33
  649. package/dist/sdk/models/shared/discount.js +0 -80
  650. package/dist/sdk/models/shared/editcustomer.d.ts +0 -72
  651. package/dist/sdk/models/shared/editcustomer.js +0 -151
  652. package/dist/sdk/models/shared/editplan.d.ts +0 -10
  653. package/dist/sdk/models/shared/editplan.js +0 -59
  654. package/dist/sdk/models/shared/editpriceintervalparams.d.ts +0 -20
  655. package/dist/sdk/models/shared/editpriceintervalparams.js +0 -62
  656. package/dist/sdk/models/shared/event.d.ts +0 -39
  657. package/dist/sdk/models/shared/event.js +0 -93
  658. package/dist/sdk/models/shared/events.d.ts +0 -7
  659. package/dist/sdk/models/shared/events.js +0 -54
  660. package/dist/sdk/models/shared/eventsearchcriteria.d.ts +0 -11
  661. package/dist/sdk/models/shared/eventsearchcriteria.js +0 -50
  662. package/dist/sdk/models/shared/fixedfeequantitychange.d.ts +0 -25
  663. package/dist/sdk/models/shared/fixedfeequantitychange.js +0 -75
  664. package/dist/sdk/models/shared/fixedfeequantityscheduleentry.d.ts +0 -7
  665. package/dist/sdk/models/shared/fixedfeequantityscheduleentry.js +0 -68
  666. package/dist/sdk/models/shared/fixedfeequantitytransition.d.ts +0 -6
  667. package/dist/sdk/models/shared/fixedfeequantitytransition.js +0 -59
  668. package/dist/sdk/models/shared/index.d.ts +0 -109
  669. package/dist/sdk/models/shared/index.js +0 -128
  670. package/dist/sdk/models/shared/ingestevent.d.ts +0 -32
  671. package/dist/sdk/models/shared/ingestevent.js +0 -86
  672. package/dist/sdk/models/shared/ingestionresponse.d.ts +0 -13
  673. package/dist/sdk/models/shared/ingestionresponse.js +0 -54
  674. package/dist/sdk/models/shared/ingestrequestbody.d.ts +0 -5
  675. package/dist/sdk/models/shared/ingestrequestbody.js +0 -47
  676. package/dist/sdk/models/shared/invoice.d.ts +0 -138
  677. package/dist/sdk/models/shared/invoice.js +0 -329
  678. package/dist/sdk/models/shared/invoicelineitem.d.ts +0 -49
  679. package/dist/sdk/models/shared/invoicelineitem.js +0 -134
  680. package/dist/sdk/models/shared/invoicelineitemparams.d.ts +0 -26
  681. package/dist/sdk/models/shared/invoicelineitemparams.js +0 -90
  682. package/dist/sdk/models/shared/invoiceminified.d.ts +0 -7
  683. package/dist/sdk/models/shared/invoiceminified.js +0 -45
  684. package/dist/sdk/models/shared/invoices.d.ts +0 -7
  685. package/dist/sdk/models/shared/invoices.js +0 -54
  686. package/dist/sdk/models/shared/item.d.ts +0 -14
  687. package/dist/sdk/models/shared/item.js +0 -72
  688. package/dist/sdk/models/shared/itemexternalconnection.d.ts +0 -5
  689. package/dist/sdk/models/shared/itemexternalconnection.js +0 -50
  690. package/dist/sdk/models/shared/items.d.ts +0 -7
  691. package/dist/sdk/models/shared/items.js +0 -54
  692. package/dist/sdk/models/shared/markaspaidrequestparams.d.ts +0 -16
  693. package/dist/sdk/models/shared/markaspaidrequestparams.js +0 -61
  694. package/dist/sdk/models/shared/maximum.d.ts +0 -11
  695. package/dist/sdk/models/shared/maximum.js +0 -50
  696. package/dist/sdk/models/shared/maximuminterval.d.ts +0 -23
  697. package/dist/sdk/models/shared/maximuminterval.js +0 -73
  698. package/dist/sdk/models/shared/minimum.d.ts +0 -11
  699. package/dist/sdk/models/shared/minimum.js +0 -50
  700. package/dist/sdk/models/shared/minimuminterval.d.ts +0 -23
  701. package/dist/sdk/models/shared/minimuminterval.js +0 -73
  702. package/dist/sdk/models/shared/newaccountingsyncconfiguration.d.ts +0 -6
  703. package/dist/sdk/models/shared/newaccountingsyncconfiguration.js +0 -52
  704. package/dist/sdk/models/shared/newbackfill.d.ts +0 -27
  705. package/dist/sdk/models/shared/newbackfill.js +0 -82
  706. package/dist/sdk/models/shared/newbillablemetric.d.ts +0 -28
  707. package/dist/sdk/models/shared/newbillablemetric.js +0 -77
  708. package/dist/sdk/models/shared/newcoupon.d.ts +0 -18
  709. package/dist/sdk/models/shared/newcoupon.js +0 -69
  710. package/dist/sdk/models/shared/newcustomer.d.ts +0 -68
  711. package/dist/sdk/models/shared/newcustomer.js +0 -152
  712. package/dist/sdk/models/shared/newcustomerbalancetransaction.d.ts +0 -13
  713. package/dist/sdk/models/shared/newcustomerbalancetransaction.js +0 -60
  714. package/dist/sdk/models/shared/newplan.d.ts +0 -26
  715. package/dist/sdk/models/shared/newplan.js +0 -93
  716. package/dist/sdk/models/shared/newreportingconfiguration.d.ts +0 -4
  717. package/dist/sdk/models/shared/newreportingconfiguration.js +0 -45
  718. package/dist/sdk/models/shared/newsubscription.d.ts +0 -54
  719. package/dist/sdk/models/shared/newsubscription.js +0 -187
  720. package/dist/sdk/models/shared/paginationmetadata.d.ts +0 -5
  721. package/dist/sdk/models/shared/paginationmetadata.js +0 -50
  722. package/dist/sdk/models/shared/perpricecost.d.ts +0 -224
  723. package/dist/sdk/models/shared/perpricecost.js +0 -67
  724. package/dist/sdk/models/shared/phaseoverride.d.ts +0 -17
  725. package/dist/sdk/models/shared/phaseoverride.js +0 -62
  726. package/dist/sdk/models/shared/pingresponse.d.ts +0 -4
  727. package/dist/sdk/models/shared/pingresponse.js +0 -45
  728. package/dist/sdk/models/shared/plan.d.ts +0 -66
  729. package/dist/sdk/models/shared/plan.js +0 -188
  730. package/dist/sdk/models/shared/planminified.d.ts +0 -9
  731. package/dist/sdk/models/shared/planminified.js +0 -55
  732. package/dist/sdk/models/shared/planphase.d.ts +0 -28
  733. package/dist/sdk/models/shared/planphase.js +0 -106
  734. package/dist/sdk/models/shared/plans.d.ts +0 -7
  735. package/dist/sdk/models/shared/plans.js +0 -54
  736. package/dist/sdk/models/shared/pricegroup.d.ts +0 -17
  737. package/dist/sdk/models/shared/pricegroup.js +0 -65
  738. package/dist/sdk/models/shared/priceinterval.d.ts +0 -239
  739. package/dist/sdk/models/shared/priceinterval.js +0 -104
  740. package/dist/sdk/models/shared/priceintervalfixedfeequantitytransitionparams.d.ts +0 -11
  741. package/dist/sdk/models/shared/priceintervalfixedfeequantitytransitionparams.js +0 -54
  742. package/dist/sdk/models/shared/prices.d.ts +0 -6
  743. package/dist/sdk/models/shared/prices.js +0 -52
  744. package/dist/sdk/models/shared/product.d.ts +0 -6
  745. package/dist/sdk/models/shared/product.js +0 -59
  746. package/dist/sdk/models/shared/reportingconfiguration.d.ts +0 -4
  747. package/dist/sdk/models/shared/reportingconfiguration.js +0 -45
  748. package/dist/sdk/models/shared/security.d.ts +0 -4
  749. package/dist/sdk/models/shared/security.js +0 -45
  750. package/dist/sdk/models/shared/subscription.d.ts +0 -128
  751. package/dist/sdk/models/shared/subscription.js +0 -226
  752. package/dist/sdk/models/shared/subscriptioncosts.d.ts +0 -5
  753. package/dist/sdk/models/shared/subscriptioncosts.js +0 -47
  754. package/dist/sdk/models/shared/subscriptionminified.d.ts +0 -4
  755. package/dist/sdk/models/shared/subscriptionminified.js +0 -45
  756. package/dist/sdk/models/shared/subscriptionplanchange.d.ts +0 -59
  757. package/dist/sdk/models/shared/subscriptionplanchange.js +0 -126
  758. package/dist/sdk/models/shared/subscriptions.d.ts +0 -7
  759. package/dist/sdk/models/shared/subscriptions.js +0 -54
  760. package/dist/sdk/models/shared/subscriptionscheduleitem.d.ts +0 -7
  761. package/dist/sdk/models/shared/subscriptionscheduleitem.js +0 -65
  762. package/dist/sdk/models/shared/subscriptionscheduleitems.d.ts +0 -7
  763. package/dist/sdk/models/shared/subscriptionscheduleitems.js +0 -54
  764. package/dist/sdk/models/shared/subscriptiontrialinfo.d.ts +0 -4
  765. package/dist/sdk/models/shared/subscriptiontrialinfo.js +0 -49
  766. package/dist/sdk/models/shared/taxamount.d.ts +0 -15
  767. package/dist/sdk/models/shared/taxamount.js +0 -55
  768. package/dist/sdk/models/shared/trialconfig.d.ts +0 -8
  769. package/dist/sdk/models/shared/trialconfig.js +0 -54
  770. package/dist/sdk/models/shared/triggersubscriptionphaseparams.d.ts +0 -8
  771. package/dist/sdk/models/shared/triggersubscriptionphaseparams.js +0 -51
  772. package/dist/sdk/models/shared/unschedulefixedfeequantitychangeparams.d.ts +0 -7
  773. package/dist/sdk/models/shared/unschedulefixedfeequantitychangeparams.js +0 -45
  774. package/dist/sdk/models/shared/upcominginvoice.d.ts +0 -130
  775. package/dist/sdk/models/shared/upcominginvoice.js +0 -321
  776. package/dist/sdk/models/shared/updateevent.d.ts +0 -28
  777. package/dist/sdk/models/shared/updateevent.js +0 -81
  778. package/dist/sdk/models/shared/validationerror.d.ts +0 -11
  779. package/dist/sdk/models/shared/validationerror.js +0 -50
  780. package/dist/sdk/plan.d.ts +0 -90
  781. package/dist/sdk/plan.js +0 -764
  782. package/dist/sdk/price.d.ts +0 -246
  783. package/dist/sdk/price.js +0 -715
  784. package/dist/sdk/priceinterval.d.ts +0 -66
  785. package/dist/sdk/priceinterval.js +0 -263
  786. package/dist/sdk/sdk.d.ts +0 -389
  787. package/dist/sdk/sdk.js +0 -93
  788. package/dist/sdk/subscription.d.ts +0 -769
  789. package/dist/sdk/subscription.js +0 -2116
  790. package/dist/sdk/types/index.d.ts +0 -1
  791. package/dist/sdk/types/index.js +0 -20
  792. package/dist/sdk/types/rfcdate.d.ts +0 -9
  793. package/dist/sdk/types/rfcdate.js +0 -59
  794. package/docs/models/errors/fivehundrederror.md +0 -12
  795. package/docs/models/errors/fivehundrederrorheaders.md +0 -7
  796. package/docs/models/errors/fourhundredandoneerror.md +0 -12
  797. package/docs/models/errors/fourhundredandoneerrorheaders.md +0 -7
  798. package/docs/models/errors/fourhundredandtwentynineerror.md +0 -12
  799. package/docs/models/errors/fourhundredandtwentynineerrorheaders.md +0 -7
  800. package/docs/models/operations/addeditpriceintervalsrequest.md +0 -9
  801. package/docs/models/operations/addeditpriceintervalsresponse.md +0 -11
  802. package/docs/models/operations/amendeventrequest.md +0 -9
  803. package/docs/models/operations/amendeventresponse.md +0 -11
  804. package/docs/models/operations/amendusageexternalcustomeridrequest.md +0 -11
  805. package/docs/models/operations/amendusageexternalcustomeridresponse.md +0 -11
  806. package/docs/models/operations/amendusagerequest.md +0 -11
  807. package/docs/models/operations/amendusageresponse.md +0 -11
  808. package/docs/models/operations/archivecouponrequest.md +0 -8
  809. package/docs/models/operations/archivecouponresponse.md +0 -11
  810. package/docs/models/operations/cancelsubscriptionrequest.md +0 -9
  811. package/docs/models/operations/cancelsubscriptionresponse.md +0 -11
  812. package/docs/models/operations/closebackfillrequest.md +0 -8
  813. package/docs/models/operations/closebackfillresponse.md +0 -11
  814. package/docs/models/operations/createbackfillresponse.md +0 -11
  815. package/docs/models/operations/createcouponresponse.md +0 -11
  816. package/docs/models/operations/createcustomerbalancetransactionrequest.md +0 -9
  817. package/docs/models/operations/createcustomerbalancetransactionresponse.md +0 -11
  818. package/docs/models/operations/createcustomerresponse.md +0 -11
  819. package/docs/models/operations/createinvoicelineitemresponse.md +0 -11
  820. package/docs/models/operations/createinvoiceresponse.md +0 -11
  821. package/docs/models/operations/createledgerentryexternalidrequest.md +0 -9
  822. package/docs/models/operations/createledgerentryexternalidresponse.md +0 -11
  823. package/docs/models/operations/createledgerentryrequest.md +0 -9
  824. package/docs/models/operations/createledgerentryresponse.md +0 -11
  825. package/docs/models/operations/createmetricresponse.md +0 -11
  826. package/docs/models/operations/createplanresponse.md +0 -11
  827. package/docs/models/operations/createpriceresponse.md +0 -11
  828. package/docs/models/operations/createsubscriptionresponse.md +0 -11
  829. package/docs/models/operations/deletecustomerrequest.md +0 -8
  830. package/docs/models/operations/deletecustomerresponse.md +0 -11
  831. package/docs/models/operations/deprecateeventrequest.md +0 -8
  832. package/docs/models/operations/deprecateeventresponse.md +0 -11
  833. package/docs/models/operations/fetchbackfillrequest.md +0 -8
  834. package/docs/models/operations/fetchbackfillresponse.md +0 -11
  835. package/docs/models/operations/fetchcouponrequest.md +0 -8
  836. package/docs/models/operations/fetchcouponresponse.md +0 -11
  837. package/docs/models/operations/fetchcreditnoterequest.md +0 -8
  838. package/docs/models/operations/fetchcreditnoteresponse.md +0 -11
  839. package/docs/models/operations/fetchcustomercostsexternalidrequest.md +0 -12
  840. package/docs/models/operations/fetchcustomercostsexternalidresponse.md +0 -11
  841. package/docs/models/operations/fetchcustomercostsexternalidviewmodeviewmode.md +0 -11
  842. package/docs/models/operations/fetchcustomercostsrequest.md +0 -12
  843. package/docs/models/operations/fetchcustomercostsresponse.md +0 -11
  844. package/docs/models/operations/fetchcustomercostsviewmodeviewmode.md +0 -11
  845. package/docs/models/operations/fetchcustomercreditsexternalidrequest.md +0 -10
  846. package/docs/models/operations/fetchcustomercreditsexternalidresponse.md +0 -11
  847. package/docs/models/operations/fetchcustomercreditsledgerentrystatusentrystatus.md +0 -9
  848. package/docs/models/operations/fetchcustomercreditsledgerentrytypeentrytype.md +0 -14
  849. package/docs/models/operations/fetchcustomercreditsledgerexternalidentrystatusentrystatus.md +0 -9
  850. package/docs/models/operations/fetchcustomercreditsledgerexternalidentrytypeentrytype.md +0 -14
  851. package/docs/models/operations/fetchcustomercreditsledgerexternalidrequest.md +0 -18
  852. package/docs/models/operations/fetchcustomercreditsledgerexternalidresponse.md +0 -11
  853. package/docs/models/operations/fetchcustomercreditsledgerrequest.md +0 -18
  854. package/docs/models/operations/fetchcustomercreditsledgerresponse.md +0 -11
  855. package/docs/models/operations/fetchcustomercreditsrequest.md +0 -10
  856. package/docs/models/operations/fetchcustomercreditsresponse.md +0 -11
  857. package/docs/models/operations/fetchcustomerexternalidrequest.md +0 -8
  858. package/docs/models/operations/fetchcustomerexternalidresponse.md +0 -11
  859. package/docs/models/operations/fetchcustomerrequest.md +0 -8
  860. package/docs/models/operations/fetchcustomerresponse.md +0 -11
  861. package/docs/models/operations/fetchinvoicerequest.md +0 -8
  862. package/docs/models/operations/fetchinvoiceresponse.md +0 -11
  863. package/docs/models/operations/fetchitemrequest.md +0 -8
  864. package/docs/models/operations/fetchitemresponse.md +0 -11
  865. package/docs/models/operations/fetchmetricrequest.md +0 -8
  866. package/docs/models/operations/fetchmetricresponse.md +0 -11
  867. package/docs/models/operations/fetchplanexternalidrequest.md +0 -8
  868. package/docs/models/operations/fetchplanexternalidresponse.md +0 -11
  869. package/docs/models/operations/fetchplanrequest.md +0 -8
  870. package/docs/models/operations/fetchplanresponse.md +0 -11
  871. package/docs/models/operations/fetchpriceexternalidrequest.md +0 -8
  872. package/docs/models/operations/fetchpriceexternalidresponse.md +0 -11
  873. package/docs/models/operations/fetchpricerequest.md +0 -8
  874. package/docs/models/operations/fetchpriceresponse.md +0 -11
  875. package/docs/models/operations/fetchsubscriptioncostsrequest.md +0 -12
  876. package/docs/models/operations/fetchsubscriptioncostsresponse.md +0 -11
  877. package/docs/models/operations/fetchsubscriptioncostsviewmodeviewmode.md +0 -11
  878. package/docs/models/operations/fetchsubscriptionrequest.md +0 -8
  879. package/docs/models/operations/fetchsubscriptionresponse.md +0 -11
  880. package/docs/models/operations/fetchsubscriptionschedulerequest.md +0 -14
  881. package/docs/models/operations/fetchsubscriptionscheduleresponse.md +0 -11
  882. package/docs/models/operations/fetchsubscriptionusagegranularitygranularity.md +0 -10
  883. package/docs/models/operations/fetchsubscriptionusagerequest.md +0 -20
  884. package/docs/models/operations/fetchsubscriptionusageresponse.md +0 -11
  885. package/docs/models/operations/fetchsubscriptionusageviewmodeviewmode.md +0 -11
  886. package/docs/models/operations/fetchupcominginvoicerequest.md +0 -8
  887. package/docs/models/operations/fetchupcominginvoiceresponse.md +0 -11
  888. package/docs/models/operations/ingestrequest.md +0 -10
  889. package/docs/models/operations/ingestresponse.md +0 -11
  890. package/docs/models/operations/issueinvoicerequest.md +0 -8
  891. package/docs/models/operations/issueinvoiceresponse.md +0 -11
  892. package/docs/models/operations/listbackfillsrequest.md +0 -9
  893. package/docs/models/operations/listbackfillsresponse.md +0 -11
  894. package/docs/models/operations/listbalancetransactionsrequest.md +0 -14
  895. package/docs/models/operations/listbalancetransactionsresponse.md +0 -11
  896. package/docs/models/operations/listcouponsrequest.md +0 -11
  897. package/docs/models/operations/listcouponsresponse.md +0 -11
  898. package/docs/models/operations/listcouponsubscriptionsrequest.md +0 -10
  899. package/docs/models/operations/listcouponsubscriptionsresponse.md +0 -11
  900. package/docs/models/operations/listcreditnotesrequest.md +0 -9
  901. package/docs/models/operations/listcreditnotesresponse.md +0 -11
  902. package/docs/models/operations/listcustomersrequest.md +0 -13
  903. package/docs/models/operations/listcustomersresponse.md +0 -11
  904. package/docs/models/operations/listinvoicesdatetypedatetype.md +0 -9
  905. package/docs/models/operations/listinvoicesrequest.md +0 -27
  906. package/docs/models/operations/listinvoicesresponse.md +0 -11
  907. package/docs/models/operations/listinvoicesstatus.md +0 -12
  908. package/docs/models/operations/listinvoicesstatusstatus.md +0 -12
  909. package/docs/models/operations/listitemsrequest.md +0 -9
  910. package/docs/models/operations/listitemsresponse.md +0 -11
  911. package/docs/models/operations/listmetricsrequest.md +0 -13
  912. package/docs/models/operations/listmetricsresponse.md +0 -11
  913. package/docs/models/operations/listplansrequest.md +0 -14
  914. package/docs/models/operations/listplansresponse.md +0 -11
  915. package/docs/models/operations/listplansstatusstatus.md +0 -12
  916. package/docs/models/operations/listpricesrequest.md +0 -9
  917. package/docs/models/operations/listpricesresponse.md +0 -11
  918. package/docs/models/operations/listsubscriptionsrequest.md +0 -16
  919. package/docs/models/operations/listsubscriptionsresponse.md +0 -11
  920. package/docs/models/operations/listsubscriptionsstatusstatus.md +0 -10
  921. package/docs/models/operations/markinvoiceaspaidrequest.md +0 -9
  922. package/docs/models/operations/markinvoiceaspaidresponse.md +0 -11
  923. package/docs/models/operations/pingresponse.md +0 -11
  924. package/docs/models/operations/revertbackfillrequest.md +0 -8
  925. package/docs/models/operations/revertbackfillresponse.md +0 -11
  926. package/docs/models/operations/scheduleplanchangerequest.md +0 -9
  927. package/docs/models/operations/scheduleplanchangeresponse.md +0 -11
  928. package/docs/models/operations/searcheventsrequest.md +0 -14
  929. package/docs/models/operations/searcheventsresponse.md +0 -11
  930. package/docs/models/operations/triggerphaserequest.md +0 -9
  931. package/docs/models/operations/triggerphaseresponse.md +0 -11
  932. package/docs/models/operations/unschedulecancellationrequest.md +0 -8
  933. package/docs/models/operations/unschedulecancellationresponse.md +0 -11
  934. package/docs/models/operations/unschedulefixedfeequantityrequest.md +0 -9
  935. package/docs/models/operations/unschedulefixedfeequantityresponse.md +0 -11
  936. package/docs/models/operations/unscheduleplanchangerequest.md +0 -8
  937. package/docs/models/operations/unscheduleplanchangeresponse.md +0 -11
  938. package/docs/models/operations/updatecustomerexternalidrequest.md +0 -9
  939. package/docs/models/operations/updatecustomerexternalidresponse.md +0 -11
  940. package/docs/models/operations/updatecustomerrequest.md +0 -9
  941. package/docs/models/operations/updatecustomerresponse.md +0 -11
  942. package/docs/models/operations/updatefixedfeequantityrequest.md +0 -9
  943. package/docs/models/operations/updatefixedfeequantityresponse.md +0 -11
  944. package/docs/models/operations/updateplanexternalrequest.md +0 -9
  945. package/docs/models/operations/updateplanexternalresponse.md +0 -11
  946. package/docs/models/operations/updateplanrequest.md +0 -9
  947. package/docs/models/operations/updateplanresponse.md +0 -11
  948. package/docs/models/operations/voidinvoicerequest.md +0 -8
  949. package/docs/models/operations/voidinvoiceresponse.md +0 -11
  950. package/docs/models/shared/accountingprovider.md +0 -9
  951. package/docs/models/shared/accountingproviderconfig.md +0 -9
  952. package/docs/models/shared/accountingproviderprovidertype.md +0 -9
  953. package/docs/models/shared/accountingsyncconfiguration.md +0 -9
  954. package/docs/models/shared/addeditpriceintervalparams.md +0 -9
  955. package/docs/models/shared/addpriceintervalparams.md +0 -16
  956. package/docs/models/shared/address.md +0 -13
  957. package/docs/models/shared/addressinput.md +0 -13
  958. package/docs/models/shared/aggregatedcost.md +0 -12
  959. package/docs/models/shared/amendedevent.md +0 -12
  960. package/docs/models/shared/amendedeventproperties.md +0 -9
  961. package/docs/models/shared/amendedusage.md +0 -9
  962. package/docs/models/shared/amendeventresult.md +0 -8
  963. package/docs/models/shared/autocollection.md +0 -10
  964. package/docs/models/shared/backfill.md +0 -17
  965. package/docs/models/shared/backfills.md +0 -9
  966. package/docs/models/shared/backfillstatus.md +0 -13
  967. package/docs/models/shared/billablemetric.md +0 -16
  968. package/docs/models/shared/billablemetrics.md +0 -9
  969. package/docs/models/shared/billablemetricstatus.md +0 -10
  970. package/docs/models/shared/billingcyclealignment.md +0 -12
  971. package/docs/models/shared/cancelsubscriptionparams.md +0 -9
  972. package/docs/models/shared/cancelsubscriptionparamscanceloption.md +0 -12
  973. package/docs/models/shared/changeoption.md +0 -10
  974. package/docs/models/shared/coupon.md +0 -21
  975. package/docs/models/shared/coupondiscount.md +0 -7
  976. package/docs/models/shared/couponredemption.md +0 -10
  977. package/docs/models/shared/coupons.md +0 -9
  978. package/docs/models/shared/createinvoicelineitemparams.md +0 -13
  979. package/docs/models/shared/createoneoffinvoiceparams.md +0 -15
  980. package/docs/models/shared/creditledgerentries.md +0 -9
  981. package/docs/models/shared/creditnote.md +0 -26
  982. package/docs/models/shared/creditnotediscounts.md +0 -7
  983. package/docs/models/shared/creditnotelineitem.md +0 -15
  984. package/docs/models/shared/creditnotelineitemdiscounts.md +0 -7
  985. package/docs/models/shared/creditnotelineitemtaxamounts.md +0 -7
  986. package/docs/models/shared/creditnotemaximumamountadjustment.md +0 -9
  987. package/docs/models/shared/creditnoteminified.md +0 -8
  988. package/docs/models/shared/creditnotereason.md +0 -11
  989. package/docs/models/shared/creditnotes.md +0 -9
  990. package/docs/models/shared/creditnotesublineitem.md +0 -10
  991. package/docs/models/shared/creditnotesummary.md +0 -13
  992. package/docs/models/shared/creditnotetype.md +0 -9
  993. package/docs/models/shared/customer.md +0 -42
  994. package/docs/models/shared/customerbalancetransaction.md +0 -17
  995. package/docs/models/shared/customerbalancetransactionaction.md +0 -10
  996. package/docs/models/shared/customerbalancetransactions.md +0 -9
  997. package/docs/models/shared/customerbalancetransactiontype.md +0 -9
  998. package/docs/models/shared/customercosts.md +0 -8
  999. package/docs/models/shared/customercreditbalance.md +0 -11
  1000. package/docs/models/shared/customercreditbalances.md +0 -9
  1001. package/docs/models/shared/customerminified.md +0 -9
  1002. package/docs/models/shared/customerpaymentprovider.md +0 -14
  1003. package/docs/models/shared/customers.md +0 -9
  1004. package/docs/models/shared/customertaxid.md +0 -10
  1005. package/docs/models/shared/debug.md +0 -11
  1006. package/docs/models/shared/deletecustomerresponse.md +0 -7
  1007. package/docs/models/shared/deprecatedeventresult.md +0 -8
  1008. package/docs/models/shared/discount.md +0 -15
  1009. package/docs/models/shared/discountdiscounttype.md +0 -11
  1010. package/docs/models/shared/editcustomer.md +0 -22
  1011. package/docs/models/shared/editcustomermetadata.md +0 -9
  1012. package/docs/models/shared/editcustomerpaymentprovider.md +0 -16
  1013. package/docs/models/shared/editplan.md +0 -9
  1014. package/docs/models/shared/editplanmetadata.md +0 -7
  1015. package/docs/models/shared/editpriceintervalparams.md +0 -11
  1016. package/docs/models/shared/event.md +0 -17
  1017. package/docs/models/shared/eventproperties.md +0 -9
  1018. package/docs/models/shared/events.md +0 -9
  1019. package/docs/models/shared/eventsearchcriteria.md +0 -9
  1020. package/docs/models/shared/fixedfeequantitychange.md +0 -11
  1021. package/docs/models/shared/fixedfeequantitychangechangeoption.md +0 -12
  1022. package/docs/models/shared/fixedfeequantityscheduleentry.md +0 -11
  1023. package/docs/models/shared/fixedfeequantitytransition.md +0 -10
  1024. package/docs/models/shared/ingestevent.md +0 -13
  1025. package/docs/models/shared/ingesteventproperties.md +0 -9
  1026. package/docs/models/shared/ingestionresponse.md +0 -9
  1027. package/docs/models/shared/ingestrequestbody.md +0 -8
  1028. package/docs/models/shared/invoice.md +0 -51
  1029. package/docs/models/shared/invoicelineitem.md +0 -23
  1030. package/docs/models/shared/invoicelineitemparams.md +0 -14
  1031. package/docs/models/shared/invoicelineitemparamsmodeltype.md +0 -8
  1032. package/docs/models/shared/invoicemetadata.md +0 -7
  1033. package/docs/models/shared/invoiceminified.md +0 -8
  1034. package/docs/models/shared/invoices.md +0 -9
  1035. package/docs/models/shared/invoicestatus.md +0 -12
  1036. package/docs/models/shared/item.md +0 -14
  1037. package/docs/models/shared/itemexternalconnection.md +0 -9
  1038. package/docs/models/shared/items.md +0 -9
  1039. package/docs/models/shared/markaspaidrequestparams.md +0 -10
  1040. package/docs/models/shared/maximum.md +0 -9
  1041. package/docs/models/shared/maximuminterval.md +0 -12
  1042. package/docs/models/shared/minimum.md +0 -9
  1043. package/docs/models/shared/minimuminterval.md +0 -12
  1044. package/docs/models/shared/newaccountingsyncconfiguration.md +0 -9
  1045. package/docs/models/shared/newbackfill.md +0 -13
  1046. package/docs/models/shared/newbillablemetric.md +0 -12
  1047. package/docs/models/shared/newbillablemetricmetadata.md +0 -9
  1048. package/docs/models/shared/newcoupon.md +0 -11
  1049. package/docs/models/shared/newcoupondiscount.md +0 -7
  1050. package/docs/models/shared/newcustomer.md +0 -23
  1051. package/docs/models/shared/newcustomerbalancetransaction.md +0 -10
  1052. package/docs/models/shared/newcustomerbalancetransactiontype.md +0 -9
  1053. package/docs/models/shared/newcustomermetadata.md +0 -9
  1054. package/docs/models/shared/newcustomerpaymentprovider.md +0 -14
  1055. package/docs/models/shared/newplan.md +0 -14
  1056. package/docs/models/shared/newplanmetadata.md +0 -7
  1057. package/docs/models/shared/newplanprices.md +0 -7
  1058. package/docs/models/shared/newreportingconfiguration.md +0 -8
  1059. package/docs/models/shared/newsubscription.md +0 -31
  1060. package/docs/models/shared/newsubscriptionexternalmarketplace.md +0 -10
  1061. package/docs/models/shared/newsubscriptionmetadata.md +0 -7
  1062. package/docs/models/shared/paginationmetadata.md +0 -9
  1063. package/docs/models/shared/perpricecost.md +0 -12
  1064. package/docs/models/shared/phaseoverride.md +0 -11
  1065. package/docs/models/shared/pingresponse.md +0 -8
  1066. package/docs/models/shared/plan.md +0 -33
  1067. package/docs/models/shared/planmetadata.md +0 -7
  1068. package/docs/models/shared/planminified.md +0 -10
  1069. package/docs/models/shared/planphase.md +0 -18
  1070. package/docs/models/shared/planphasedurationunit.md +0 -11
  1071. package/docs/models/shared/plans.md +0 -9
  1072. package/docs/models/shared/planstatus.md +0 -10
  1073. package/docs/models/shared/pricegroup.md +0 -12
  1074. package/docs/models/shared/priceinterval.md +0 -18
  1075. package/docs/models/shared/priceintervalfixedfeequantitytransitionparams.md +0 -9
  1076. package/docs/models/shared/prices.md +0 -9
  1077. package/docs/models/shared/product.md +0 -10
  1078. package/docs/models/shared/reportingconfiguration.md +0 -8
  1079. package/docs/models/shared/security.md +0 -8
  1080. package/docs/models/shared/subscription.md +0 -44
  1081. package/docs/models/shared/subscriptioncosts.md +0 -8
  1082. package/docs/models/shared/subscriptionmetadata.md +0 -9
  1083. package/docs/models/shared/subscriptionminified.md +0 -8
  1084. package/docs/models/shared/subscriptionplanchange.md +0 -23
  1085. package/docs/models/shared/subscriptions.md +0 -9
  1086. package/docs/models/shared/subscriptionscheduleitem.md +0 -10
  1087. package/docs/models/shared/subscriptionscheduleitems.md +0 -9
  1088. package/docs/models/shared/subscriptionstatus.md +0 -10
  1089. package/docs/models/shared/subscriptiontrialinfo.md +0 -8
  1090. package/docs/models/shared/taxamount.md +0 -10
  1091. package/docs/models/shared/trialconfig.md +0 -9
  1092. package/docs/models/shared/trialconfigtrialperiodunit.md +0 -8
  1093. package/docs/models/shared/triggersubscriptionphaseparams.md +0 -8
  1094. package/docs/models/shared/unschedulefixedfeequantitychangeparams.md +0 -8
  1095. package/docs/models/shared/upcominginvoice.md +0 -46
  1096. package/docs/models/shared/upcominginvoicemetadata.md +0 -7
  1097. package/docs/models/shared/upcominginvoicestatus.md +0 -12
  1098. package/docs/models/shared/updateevent.md +0 -12
  1099. package/docs/models/shared/updateeventproperties.md +0 -9
  1100. package/docs/models/shared/validationerror.md +0 -9
  1101. package/docs/sdks/availability/README.md +0 -46
  1102. package/docs/sdks/coupon/README.md +0 -235
  1103. package/docs/sdks/credit/README.md +0 -565
  1104. package/docs/sdks/creditnote/README.md +0 -94
  1105. package/docs/sdks/customer/README.md +0 -1080
  1106. package/docs/sdks/event/README.md +0 -674
  1107. package/docs/sdks/invoice/README.md +0 -388
  1108. package/docs/sdks/item/README.md +0 -92
  1109. package/docs/sdks/metric/README.md +0 -136
  1110. package/docs/sdks/orb/README.md +0 -21
  1111. package/docs/sdks/plan/README.md +0 -298
  1112. package/docs/sdks/price/README.md +0 -375
  1113. package/docs/sdks/priceinterval/README.md +0 -137
  1114. package/docs/sdks/subscription/README.md +0 -1306
  1115. package/docs/types/rfcdate.md +0 -11
@@ -0,0 +1,4590 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ import * as Core from "../core";
4
+ import { APIResource } from "../resource";
5
+ import { isRequestOptions } from "../core";
6
+ import * as SubscriptionsAPI from "./subscriptions";
7
+ import * as CustomersAPI from "./customers/customers";
8
+ import * as PlansAPI from "./plans/plans";
9
+ import * as PricesAPI from "./prices/prices";
10
+ import { Page, type PageParams } from "../pagination";
11
+
12
+ export class Subscriptions extends APIResource {
13
+ /**
14
+ * A subscription represents the purchase of a plan by a customer. The customer is
15
+ * identified by either the `customer_id` or the `external_customer_id`, and
16
+ * exactly one of these fields must be provided.
17
+ *
18
+ * By default, subscriptions begin on the day that they're created and renew
19
+ * automatically for each billing cycle at the cadence that's configured in the
20
+ * plan definition.
21
+ *
22
+ * The default configuration for subscriptions in Orb is **In-advance billing** and
23
+ * **Beginning of month alignment** (see
24
+ * [Subscription](../guides/concepts#subscription) for more details).
25
+ *
26
+ * In order to change the alignment behavior, Orb also supports billing
27
+ * subscriptions on the day of the month they are created. If
28
+ * `align_billing_with_subscription_start_date = true` is specified, subscriptions
29
+ * have billing cycles that are aligned with their `start_date`. For example, a
30
+ * subscription that begins on January 15th will have a billing cycle from January
31
+ * 15th to February 15th. Every subsequent billing cycle will continue to start and
32
+ * invoice on the 15th.
33
+ *
34
+ * If the "day" value is greater than the number of days in the month, the next
35
+ * billing cycle will start at the end of the month. For example, if the start_date
36
+ * is January 31st, the next billing cycle will start on February 28th.
37
+ *
38
+ * If a customer was created with a currency, Orb only allows subscribing the
39
+ * customer to a plan with a matching `invoicing_currency`. If the customer does
40
+ * not have a currency set, on subscription creation, we set the customer's
41
+ * currency to be the `invoicing_currency` of the plan.
42
+ *
43
+ * ## Price overrides
44
+ *
45
+ * Price overrides are used to update some or all prices in a plan for the specific
46
+ * subscription being created. This is useful when a new customer has negotiated
47
+ * one or more different prices for a specific plan than the plan's default prices.
48
+ * Any type of price can be overridden, if the correct data is provided. The
49
+ * billable metric, cadence, type, and name of a price can not be overridden.
50
+ *
51
+ * To override prices, provide a list of objects with the key `price_overrides`.
52
+ * The price object in the list of overrides is expected to contain the existing
53
+ * price id, the `model_type` and config value in the format below. The specific
54
+ * numerical values can be updated, but the config value and `model_type` must
55
+ * match the existing price that is being overridden
56
+ *
57
+ * ### Request format for price overrides
58
+ *
59
+ * Orb supports a few different pricing models out of the box. The `model_type`
60
+ * field determines the key for the configuration object that is present.
61
+ *
62
+ * ### Unit pricing
63
+ *
64
+ * With unit pricing, each unit costs a fixed amount.
65
+ *
66
+ * ```json
67
+ * {
68
+ * ...
69
+ * "id": "price_id",
70
+ * "model_type": "unit",
71
+ * "unit_config": {
72
+ * "unit_amount": "0.50"
73
+ * }
74
+ * ...
75
+ * }
76
+ * ```
77
+ *
78
+ * ### Tiered pricing
79
+ *
80
+ * In tiered pricing, the cost of a given unit depends on the tier range that it
81
+ * falls into, where each tier range is defined by an upper and lower bound. For
82
+ * example, the first ten units may cost $0.50 each and all units thereafter may
83
+ * cost $0.10 each. Tiered prices can be overridden with a new number of tiers or
84
+ * new values for `first_unit`, `last_unit`, or `unit_amount`.
85
+ *
86
+ * ```json
87
+ * {
88
+ * ...
89
+ * "id": "price_id",
90
+ * "model_type": "tiered",
91
+ * "tiered_config": {
92
+ * "tiers": [
93
+ * {
94
+ * "first_unit":"1",
95
+ * "last_unit": "10",
96
+ * "unit_amount": "0.50"
97
+ * },
98
+ * {
99
+ * "first_unit": "10",
100
+ * "last_unit": null,
101
+ * "unit_amount": "0.10"
102
+ * }
103
+ * ]
104
+ * }
105
+ * ...
106
+ * }
107
+ * ```
108
+ *
109
+ * ### Bulk pricing
110
+ *
111
+ * Bulk pricing applies when the number of units determine the cost of _all_ units.
112
+ * For example, if you've bought less than 10 units, they may each be $0.50 for a
113
+ * total of $5.00. Once you've bought more than 10 units, all units may now be
114
+ * priced at $0.40 (i.e. 101 units total would be $40.40). Bulk prices can be
115
+ * overridden with a new number of tiers or new values for `maximum_units`, or
116
+ * `unit_amount`.
117
+ *
118
+ * ```json
119
+ * {
120
+ * ...
121
+ * "id": "price_id",
122
+ * "model_type": "bulk",
123
+ * "bulk_config": {
124
+ * "tiers": [
125
+ * {
126
+ * "maximum_units": "10",
127
+ * "unit_amount": "0.50"
128
+ * },
129
+ * {
130
+ * "maximum_units": "1000",
131
+ * "unit_amount": "0.40"
132
+ * }
133
+ * ]
134
+ * }
135
+ * ...
136
+ * }
137
+ * ```
138
+ *
139
+ * ### Package pricing
140
+ *
141
+ * Package pricing defines the size or granularity of a unit for billing purposes.
142
+ * For example, if the package size is set to 5, then 4 units will be billed as 5
143
+ * and 6 units will be billed at 10.
144
+ *
145
+ * ```json
146
+ * {
147
+ * ...
148
+ * "id": "price_id",
149
+ * "model_type": "package",
150
+ * "package_config": {
151
+ * "package_amount": "0.80",
152
+ * "package_size": 10
153
+ * }
154
+ * ...
155
+ * }
156
+ * ```
157
+ *
158
+ * ### BPS pricing
159
+ *
160
+ * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
161
+ * percent (the number of basis points to charge), as well as a cap per event to
162
+ * assess. For example, this would allow you to assess a fee of 0.25% on every
163
+ * payment you process, with a maximum charge of $25 per payment.
164
+ *
165
+ * ```json
166
+ * {
167
+ * ...
168
+ * "id": "price_id"
169
+ * "model_type": "bps",
170
+ * "bps_config": {
171
+ * "bps": 125,
172
+ * "per_event_cap": "11.00"
173
+ * }
174
+ * ...
175
+ * }
176
+ * ```
177
+ *
178
+ * ### Bulk BPS pricing
179
+ *
180
+ * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
181
+ * total quantity across all events. Similar to bulk pricing, the BPS parameters of
182
+ * a given event depends on the tier range that the billing period falls into. Each
183
+ * tier range is defined by an upper and lower bound. For example, after $1.5M of
184
+ * payment volume is reached, each individual payment may have a lower cap or a
185
+ * smaller take-rate.
186
+ *
187
+ * ```json
188
+ * {
189
+ * ...
190
+ * "id": "price_id"
191
+ * "model_type": "bulk_bps",
192
+ * "bulk_bps_config": {
193
+ * "tiers": [
194
+ * {
195
+ * "minimum_amount": "0.00",
196
+ * "maximum_amount": "1000000.00",
197
+ * "bps": 125,
198
+ * "per_event_cap": "19.00"
199
+ * },
200
+ * {
201
+ * "minimum_amount":"1000000.00",
202
+ * "maximum_amount": null,
203
+ * "bps": 115,
204
+ * "per_event_cap": "4.00"
205
+ * }
206
+ * ]
207
+ * }
208
+ * ...
209
+ * }
210
+ * ```
211
+ *
212
+ * ### Tiered BPS pricing
213
+ *
214
+ * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
215
+ * event's applicable parameter is a function of its marginal addition to the
216
+ * period total. Similar to tiered pricing, the BPS parameters of a given event
217
+ * depends on the tier range that it falls into, where each tier range is defined
218
+ * by an upper and lower bound. For example, the first few payments may have a 0.8
219
+ * BPS take-rate and all payments after a specific volume may incur a take-rate of
220
+ * 0.5 BPS each.
221
+ *
222
+ * ```json
223
+ * {
224
+ * ...
225
+ * "id": "price_id"
226
+ * "model_type": "tiered_bps",
227
+ * "tiered_bps_config": {
228
+ * "tiers": [
229
+ * {
230
+ * "minimum_amount": "0.00",
231
+ * "maximum_amount": "1000000.00",
232
+ * "bps": 125,
233
+ * "per_event_cap": "19.00"
234
+ * },
235
+ * {
236
+ * "minimum_amount":"1000000",
237
+ * "maximum_amount": null,
238
+ * "bps": 115,
239
+ * "per_event_cap": "4.00"
240
+ * }
241
+ * ]
242
+ * }
243
+ * ...
244
+ * }
245
+ * ```
246
+ *
247
+ * ### Matrix pricing
248
+ *
249
+ * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
250
+ * `dimensions` defines the two event property values evaluated in this pricing
251
+ * model. In a one-dimensional matrix, the second value is `null`. Every
252
+ * configuration has a list of `matrix_values` which give the unit prices for
253
+ * specified property values. In a one-dimensional matrix, the matrix values will
254
+ * have `dimension_values` where the second value of the pair is null. If an event
255
+ * does not match any of the dimension values in the matrix, it will resort to the
256
+ * `default_unit_amount`.
257
+ *
258
+ * ```json
259
+ * ...
260
+ * "model_type": "matrix"
261
+ * "matrix_config": {
262
+ * "default_unit_amount": "3.00",
263
+ * "dimensions": [
264
+ * "cluster_name",
265
+ * "region"
266
+ * ],
267
+ * "matrix_values": [
268
+ * {
269
+ * "dimension_values": [
270
+ * "alpha",
271
+ * "west"
272
+ * ],
273
+ * "unit_amount": "2.00"
274
+ * },
275
+ * ...
276
+ * ]
277
+ * }
278
+ * ...
279
+ * ```
280
+ *
281
+ * ### Fixed fees
282
+ *
283
+ * Fixed fees follow unit pricing, and also have an additional parameter
284
+ * `fixed_price_quantity` that indicates how many of a fixed fee that should be
285
+ * applied for a subscription. This parameter defaults to 1.
286
+ *
287
+ * ```json
288
+ * {
289
+ * ...
290
+ * "id": "price_id",
291
+ * "model_type": "unit",
292
+ * "unit_config": {
293
+ * "unit_amount": "2.00"
294
+ * },
295
+ * "fixed_price_quantity": 3.0
296
+ * ...
297
+ * }
298
+ * ```
299
+ *
300
+ * ## Maximums and Minimums
301
+ *
302
+ * Minimums and maximums, much like price overrides, can be useful when a new
303
+ * customer has negotiated a new or different minimum or maximum spend cap than the
304
+ * default for a given price. If one exists for a price and null is provided for
305
+ * the minimum/maximum override on creation, then there will be no minimum/maximum
306
+ * on the new subscription. If no value is provided, then the default price maximum
307
+ * or minimum is used.
308
+ *
309
+ * To add a minimum for a specific price, add `minimum_amount` to the specific
310
+ * price in the `price_overrides` object.
311
+ *
312
+ * To add a maximum for a specific price, add `maximum_amount` to the specific
313
+ * price in the `price_overrides` object.
314
+ *
315
+ * ### Minimum override example
316
+ *
317
+ * Price minimum override example:
318
+ *
319
+ * ```json
320
+ * {
321
+ * ...
322
+ * "id": "price_id",
323
+ * "model_type": "unit",
324
+ * "unit_config": {
325
+ * "unit_amount": "0.50"
326
+ * },
327
+ * "minimum_amount": "100.00"
328
+ * ...
329
+ * }
330
+ * ```
331
+ *
332
+ * Removing an existing minimum example
333
+ *
334
+ * ```json
335
+ * {
336
+ * ...
337
+ * "id": "price_id",
338
+ * "model_type": "unit",
339
+ * "unit_config": {
340
+ * "unit_amount": "0.50"
341
+ * },
342
+ * "minimum_amount": null
343
+ * ...
344
+ * }
345
+ * ```
346
+ *
347
+ * ## Discounts
348
+ *
349
+ * Discounts, like price overrides, can be useful when a new customer has
350
+ * negotiated a new or different discount than the default for a price. A single
351
+ * price price can have at most one discount. If a discount exists for a price and
352
+ * a null discount is provided on creation, then there will be no discount on the
353
+ * new subscription.
354
+ *
355
+ * To add a discount for a specific price, add `discount` to the price in the
356
+ * `price_overrides` object. Discount should be a dictionary of the format:
357
+ *
358
+ * ```json
359
+ * {
360
+ * "discount_type": "amount" | "percentage" | "usage",
361
+ * "amount_discount": string,
362
+ * "percentage_discount": string,
363
+ * "usage_discount": string
364
+ * }
365
+ * ```
366
+ *
367
+ * where either `amount_discount`, `percentage_discount`, or `usage_discount` is
368
+ * provided.
369
+ *
370
+ * Price discount example
371
+ *
372
+ * ```json
373
+ * {
374
+ * ...
375
+ * "id": "price_id",
376
+ * "model_type": "unit",
377
+ * "unit_config": {
378
+ * "unit_amount": "0.50"
379
+ * },
380
+ * "discount": {"discount_type": "amount", "amount_discount": "175"},
381
+ * }
382
+ * ```
383
+ *
384
+ * Removing an existing discount example
385
+ *
386
+ * ```json
387
+ * {
388
+ * "customer_id": "customer_id",
389
+ * "plan_id": "plan_id",
390
+ * "discount": null,
391
+ * "price_overrides": [ ... ]
392
+ * ...
393
+ * }
394
+ * ```
395
+ *
396
+ * ## Threshold Billing
397
+ *
398
+ * Orb supports invoicing for a subscription when a preconfigured usage threshold
399
+ * is hit. To enable threshold billing, pass in an `invoicing_threshold`, which is
400
+ * specified in the subscription's invoicing currency, when creating a
401
+ * subscription. Ex. pass in `10.00` to issue an invoice when usage amounts hit
402
+ * $10.00 for a subscription that invoices in USD.
403
+ */
404
+ create(body?: SubscriptionCreateParams, options?: Core.RequestOptions): Core.APIPromise<Subscription>;
405
+ create(options?: Core.RequestOptions): Core.APIPromise<Subscription>;
406
+ create(
407
+ body: SubscriptionCreateParams | Core.RequestOptions = {},
408
+ options?: Core.RequestOptions,
409
+ ): Core.APIPromise<Subscription> {
410
+ if (isRequestOptions(body)) {
411
+ return this.create({}, body);
412
+ }
413
+ return this.post('/subscriptions', { body, ...options });
414
+ }
415
+
416
+ /**
417
+ * This endpoint returns a list of all subscriptions for an account as a
418
+ * [paginated](../reference/pagination) list, ordered starting from the most
419
+ * recently created subscription. For a full discussion of the subscription
420
+ * resource, see [Subscription](../guides/concepts#subscription).
421
+ *
422
+ * Subscriptions can be filtered to a single customer by passing in the
423
+ * `customer_id` query parameter or the `external_customer_id` query parameter.
424
+ */
425
+ list(
426
+ query?: SubscriptionListParams,
427
+ options?: Core.RequestOptions,
428
+ ): Core.PagePromise<SubscriptionsPage, Subscription>;
429
+ list(options?: Core.RequestOptions): Core.PagePromise<SubscriptionsPage, Subscription>;
430
+ list(
431
+ query: SubscriptionListParams | Core.RequestOptions = {},
432
+ options?: Core.RequestOptions,
433
+ ): Core.PagePromise<SubscriptionsPage, Subscription> {
434
+ if (isRequestOptions(query)) {
435
+ return this.list({}, query);
436
+ }
437
+ return this.getAPIList('/subscriptions', SubscriptionsPage, { query, ...options });
438
+ }
439
+
440
+ /**
441
+ * This endpoint can be used to cancel an existing subscription. It returns the
442
+ * serialized subscription object with an `end_date` parameter that signifies when
443
+ * the subscription will transition to an ended state.
444
+ *
445
+ * The body parameter `cancel_option` determines the cancellation behavior. Orb
446
+ * supports three cancellation options:
447
+ *
448
+ * - `end_of_subscription_term`: stops the subscription from auto-renewing.
449
+ * Subscriptions that have been cancelled with this option can still incur
450
+ * charges for the remainder of their term:
451
+ *
452
+ * - Issuing this cancellation request for a monthly subscription will keep the
453
+ * subscription active until the start of the subsequent month, and potentially
454
+ * issue an invoice for any usage charges incurred in the intervening period.
455
+ * - Issuing this cancellation request for a quarterly subscription will keep the
456
+ * subscription active until the end of the quarter and potentially issue an
457
+ * invoice for any usage charges incurred in the intervening period.
458
+ * - Issuing this cancellation request for a yearly subscription will keep the
459
+ * subscription active for the full year. For example, a yearly subscription
460
+ * starting on 2021-11-01 and cancelled on 2021-12-08 will remain active until
461
+ * 2022-11-01 and potentially issue charges in the intervening months for any
462
+ * recurring monthly usage charges in its plan.
463
+ * - **Note**: If a subscription's plan contains prices with difference cadences,
464
+ * the end of term date will be determined by the largest cadence value. For
465
+ * example, cancelling end of term for a subscription with a quarterly fixed
466
+ * fee with a monthly usage fee will result in the subscription ending at the
467
+ * end of the quarter.
468
+ *
469
+ * - `immediate`: ends the subscription immediately, setting the `end_date` to the
470
+ * current time:
471
+ *
472
+ * - Subscriptions that have been cancelled with this option will be invoiced
473
+ * immediately. This invoice will include any usage fees incurred in the
474
+ * billing period up to the cancellation, along with any prorated recurring
475
+ * fees for the billing period, if applicable.
476
+ * - **Note**: If the subscription has a recurring fee that was paid in-advance,
477
+ * the prorated amount for the remaining time period will be added to the
478
+ * [customer's balance](list-balance-transactions) upon immediate cancellation.
479
+ * However, if the customer is ineligible to use the customer balance, the
480
+ * subscription cannot be cancelled immediately.
481
+ *
482
+ * - `requested_date`: ends the subscription on a specified date, which requires a
483
+ * `cancellation_date` to be passed in. If no timezone is provided, the
484
+ * customer's timezone is used. For example, a subscription starting on January
485
+ * 1st with a monthly price can be set to be cancelled on the first of any month
486
+ * after January 1st (e.g. March 1st, April 1st, May 1st). A subscription with
487
+ * multiple prices with different cadences defines the "term" to be the highest
488
+ * cadence of the prices.
489
+ *
490
+ * Upcoming subscriptions are only eligible for immediate cancellation, which will
491
+ * set the `end_date` equal to the `start_date` upon cancellation.
492
+ *
493
+ * ## Backdated cancellations
494
+ *
495
+ * Orb allows you to cancel a subscription in the past as long as there are no paid
496
+ * invoices between the `requested_date` and the current time. If the cancellation
497
+ * is after the latest issued invoice, Orb will generate a balance refund for the
498
+ * current period. If the cancellation is before the most recently issued invoice,
499
+ * Orb will void the intervening invoice and generate a new one based on the new
500
+ * dates for the subscription. See the section on
501
+ * [cancellation behaviors](../guides/product-catalog/creating-subscriptions.md#cancellation-behaviors).
502
+ */
503
+ cancel(
504
+ subscriptionId: string,
505
+ body: SubscriptionCancelParams,
506
+ options?: Core.RequestOptions,
507
+ ): Core.APIPromise<Subscription> {
508
+ return this.post(`/subscriptions/${subscriptionId}/cancel`, { body, ...options });
509
+ }
510
+
511
+ /**
512
+ * This endpoint is used to fetch a [Subscription](../guides/concepts#subscription)
513
+ * given an identifier.
514
+ */
515
+ fetch(subscriptionId: string, options?: Core.RequestOptions): Core.APIPromise<Subscription> {
516
+ return this.get(`/subscriptions/${subscriptionId}`, options);
517
+ }
518
+
519
+ /**
520
+ * This endpoint is used to fetch a day-by-day snapshot of a subscription's costs
521
+ * in Orb, calculated by applying pricing information to the underlying usage (see
522
+ * the [subscription usage endpoint](fetch-subscription-usage) to fetch usage per
523
+ * metric, in usage units rather than a currency).
524
+ *
525
+ * The semantics of this endpoint exactly mirror those of
526
+ * [fetching a customer's costs](fetch-customer-costs). Use this endpoint to limit
527
+ * your analysis of costs to a specific subscription for the customer (e.g. to
528
+ * de-aggregate costs when a customer's subscription has started and stopped on the
529
+ * same day).
530
+ */
531
+ fetchCosts(
532
+ subscriptionId: string,
533
+ query?: SubscriptionFetchCostsParams,
534
+ options?: Core.RequestOptions,
535
+ ): Core.APIPromise<SubscriptionFetchCostsResponse>;
536
+ fetchCosts(
537
+ subscriptionId: string,
538
+ options?: Core.RequestOptions,
539
+ ): Core.APIPromise<SubscriptionFetchCostsResponse>;
540
+ fetchCosts(
541
+ subscriptionId: string,
542
+ query: SubscriptionFetchCostsParams | Core.RequestOptions = {},
543
+ options?: Core.RequestOptions,
544
+ ): Core.APIPromise<SubscriptionFetchCostsResponse> {
545
+ if (isRequestOptions(query)) {
546
+ return this.fetchCosts(subscriptionId, {}, query);
547
+ }
548
+ return this.get(`/subscriptions/${subscriptionId}/costs`, { query, ...options });
549
+ }
550
+
551
+ /**
552
+ * This endpoint returns a [paginated](../reference/pagination) list of all plans
553
+ * associated with a subscription along with their start and end dates. This list
554
+ * contains the subscription's initial plan along with past and future plan
555
+ * changes.
556
+ */
557
+ fetchSchedule(
558
+ subscriptionId: string,
559
+ query?: SubscriptionFetchScheduleParams,
560
+ options?: Core.RequestOptions,
561
+ ): Core.PagePromise<SubscriptionFetchScheduleResponsesPage, SubscriptionFetchScheduleResponse>;
562
+ fetchSchedule(
563
+ subscriptionId: string,
564
+ options?: Core.RequestOptions,
565
+ ): Core.PagePromise<SubscriptionFetchScheduleResponsesPage, SubscriptionFetchScheduleResponse>;
566
+ fetchSchedule(
567
+ subscriptionId: string,
568
+ query: SubscriptionFetchScheduleParams | Core.RequestOptions = {},
569
+ options?: Core.RequestOptions,
570
+ ): Core.PagePromise<SubscriptionFetchScheduleResponsesPage, SubscriptionFetchScheduleResponse> {
571
+ if (isRequestOptions(query)) {
572
+ return this.fetchSchedule(subscriptionId, {}, query);
573
+ }
574
+ return this.getAPIList(
575
+ `/subscriptions/${subscriptionId}/schedule`,
576
+ SubscriptionFetchScheduleResponsesPage,
577
+ { query, ...options },
578
+ );
579
+ }
580
+
581
+ /**
582
+ * This endpoint is used to fetch a subscription's usage in Orb. Especially when
583
+ * combined with optional query parameters, this endpoint is a powerful way to
584
+ * build visualizations on top of Orb's event data and metrics.
585
+ *
586
+ * With no query parameters specified, this endpoint returns usage for the
587
+ * subscription's _current billing period_ across each billable metric that
588
+ * participates in the subscription. Usage quantities returned are the result of
589
+ * evaluating the metric definition for the entirety of the customer's billing
590
+ * period.
591
+ *
592
+ * ### Default response shape
593
+ *
594
+ * Orb returns a `data` array with an object corresponding to each billable metric.
595
+ * Nested within this object is a `usage` array which has a `quantity` value and a
596
+ * corresponding `timeframe_start` and `timeframe_end`. The `quantity` value
597
+ * represents the calculated usage value for the billable metric over the specified
598
+ * timeframe (inclusive of the `timeframe_start` timestamp and exclusive of the
599
+ * `timeframe_end` timestamp).
600
+ *
601
+ * Orb will include _every_ window in the response starting from the beginning of
602
+ * the billing period, even when there were no events (and therefore no usage) in
603
+ * the window. This increases the size of the response but prevents the caller from
604
+ * filling in gaps and handling cumbersome time-based logic.
605
+ *
606
+ * The query parameters in this endpoint serve to override this behavior and
607
+ * provide some key functionality, as listed below. Note that this functionality
608
+ * can also be used _in conjunction_ with each other, e.g. to display grouped usage
609
+ * on a custom timeframe.
610
+ *
611
+ * ## Custom timeframe
612
+ *
613
+ * In order to view usage for a custom timeframe rather than the current billing
614
+ * period, specify a `timeframe_start` and `timeframe_end`. This will calculate
615
+ * quantities for usage incurred between timeframe_start (inclusive) and
616
+ * timeframe_end (exclusive), i.e. `[timeframe_start, timeframe_end)`.
617
+ *
618
+ * Note:
619
+ *
620
+ * - These timestamps must be specified in ISO 8601 format and UTC timezone, e.g.
621
+ * `2022-02-01T05:00:00Z`.
622
+ * - Both parameters must be specified if either is specified.
623
+ *
624
+ * ## Grouping by custom attributes
625
+ *
626
+ * In order to view a single metric grouped by a specific _attribute_ that each
627
+ * event is tagged with (e.g. `cluster`), you must additionally specify a
628
+ * `billable_metric_id` and a `group_by` key. The `group_by` key denotes the event
629
+ * property on which to group.
630
+ *
631
+ * When returning grouped usage, only usage for `billable_metric_id` is returned,
632
+ * and a separate object in the `data` array is returned for each value of the
633
+ * `group_by` key present in your events. The `quantity` value is the result of
634
+ * evaluating the billable metric for events filtered to a single value of the
635
+ * `group_by` key.
636
+ *
637
+ * Orb expects that events that match the billable metric will contain values in
638
+ * the `properties` dictionary that correspond to the `group_by` key specified. By
639
+ * default, Orb will not return a `null` group (i.e. events that match the metric
640
+ * but do not have the key set). Currently, it is only possible to view usage
641
+ * grouped by a single attribute at a time.
642
+ *
643
+ * When viewing grouped usage, Orb uses pagination to limit the response size to
644
+ * 1000 groups by default. If there are more groups for a given subscription,
645
+ * pagination metadata in the response can be used to fetch all of the data.
646
+ *
647
+ * The following example shows usage for an "API Requests" billable metric grouped
648
+ * by `region`. Note the extra `metric_group` dictionary in the response, which
649
+ * provides metadata about the group:
650
+ *
651
+ * ```json
652
+ * {
653
+ * "data": [
654
+ * {
655
+ * "usage": [
656
+ * {
657
+ * "quantity": 0.19291,
658
+ * "timeframe_start": "2021-10-01T07:00:00Z",
659
+ * "timeframe_end": "2021-10-02T07:00:00Z",
660
+ * },
661
+ * ...
662
+ * ],
663
+ * "metric_group": {
664
+ * "property_key": "region",
665
+ * "property_value": "asia/pacific"
666
+ * },
667
+ * "billable_metric": {
668
+ * "id": "Fe9pbpMk86xpwdGB",
669
+ * "name": "API Requests"
670
+ * },
671
+ * "view_mode": "periodic"
672
+ * },
673
+ * ...
674
+ * ]
675
+ * }
676
+ * ```
677
+ *
678
+ * ## Windowed usage
679
+ *
680
+ * The `granularity` parameter can be used to _window_ the usage `quantity` value
681
+ * into periods. When not specified, usage is returned for the entirety of the time
682
+ * range.
683
+ *
684
+ * When `granularity = day` is specified with a timeframe longer than a day, Orb
685
+ * will return a `quantity` value for each full day between `timeframe_start` and
686
+ * `timeframe_end`. Note that the days are demarcated by the _customer's local
687
+ * midnight_.
688
+ *
689
+ * For example, with `timeframe_start = 2022-02-01T05:00:00Z`,
690
+ * `timeframe_end = 2022-02-04T01:00:00Z` and `granularity=day`, the following
691
+ * windows will be returned for a customer in the `America/Los_Angeles` timezone
692
+ * since local midnight is `08:00` UTC:
693
+ *
694
+ * - `[2022-02-01T05:00:00Z, 2022-02-01T08:00:00Z)`
695
+ * - `[2022-02-01T08:00:00, 2022-02-02T08:00:00Z)`
696
+ * - `[2022-02-02T08:00:00, 2022-02-03T08:00:00Z)`
697
+ * - `[2022-02-03T08:00:00, 2022-02-04T01:00:00Z)`
698
+ *
699
+ * ```json
700
+ * {
701
+ * "data": [
702
+ * {
703
+ * "billable_metric": {
704
+ * "id": "Q8w89wjTtBdejXKsm",
705
+ * "name": "API Requests"
706
+ * },
707
+ * "usage": [
708
+ * {
709
+ * "quantity": 0,
710
+ * "timeframe_end": "2022-02-01T08:00:00+00:00",
711
+ * "timeframe_start": "2022-02-01T05:00:00+00:00"
712
+ * },
713
+ * {
714
+ *
715
+ * "quantity": 0,
716
+ * "timeframe_end": "2022-02-02T08:00:00+00:00",
717
+ * "timeframe_start": "2022-02-01T08:00:00+00:00"
718
+ * },
719
+ * {
720
+ * "quantity": 0,
721
+ * "timeframe_end": "2022-02-03T08:00:00+00:00",
722
+ * "timeframe_start": "2022-02-02T08:00:00+00:00"
723
+ * },
724
+ * {
725
+ * "quantity": 0,
726
+ * "timeframe_end": "2022-02-04T01:00:00+00:00",
727
+ * "timeframe_start": "2022-02-03T08:00:00+00:00"
728
+ * }
729
+ * ],
730
+ * "view_mode": "periodic"
731
+ * },
732
+ * ...
733
+ * ]
734
+ * }
735
+ * ```
736
+ *
737
+ * ## Decomposable vs. non-decomposable metrics
738
+ *
739
+ * Billable metrics fall into one of two categories: decomposable and
740
+ * non-decomposable. A decomposable billable metric, such as a sum or a count, can
741
+ * be displayed and aggregated across arbitrary timescales. On the other hand, a
742
+ * non-decomposable metric is not meaningful when only a slice of the billing
743
+ * window is considered.
744
+ *
745
+ * As an example, if we have a billable metric that's defined to count unique
746
+ * users, displaying a graph of unique users for each day is not representative of
747
+ * the billable metric value over the month (days could have an overlapping set of
748
+ * 'unique' users). Instead, what's useful for any given day is the number of
749
+ * unique users in the billing period so far, which are the _cumulative_ unique
750
+ * users.
751
+ *
752
+ * Accordingly, this endpoint returns treats these two types of metrics differently
753
+ * when `group_by` is specified:
754
+ *
755
+ * - Decomposable metrics can be grouped by any event property.
756
+ * - Non-decomposable metrics can only be grouped by the corresponding price's
757
+ * invoice grouping key. If no invoice grouping key is present, the metric does
758
+ * not support `group_by`.
759
+ *
760
+ * ## Matrix prices
761
+ *
762
+ * When a billable metric is attached to a price that uses matrix pricing, it's
763
+ * important to view usage grouped by those matrix dimensions. In this case, use
764
+ * the query parameters `first_dimension_key`, `first_dimension_value` and
765
+ * `second_dimension_key`, `second_dimension_value` while filtering to a specific
766
+ * `billable_metric_id`.
767
+ *
768
+ * For example, if your compute metric has a separate unit price (i.e. a matrix
769
+ * pricing model) per `region` and `provider`, your request might provide the
770
+ * following parameters:
771
+ *
772
+ * - `first_dimension_key`: `region`
773
+ * - `first_dimension_value`: `us-east-1`
774
+ * - `second_dimension_key`: `provider`
775
+ * - `second_dimension_value`: `aws`
776
+ */
777
+ fetchUsage(
778
+ subscriptionId: string,
779
+ query?: SubscriptionFetchUsageParams,
780
+ options?: Core.RequestOptions,
781
+ ): Core.APIPromise<SubscriptionUsage>;
782
+ fetchUsage(subscriptionId: string, options?: Core.RequestOptions): Core.APIPromise<SubscriptionUsage>;
783
+ fetchUsage(
784
+ subscriptionId: string,
785
+ query: SubscriptionFetchUsageParams | Core.RequestOptions = {},
786
+ options?: Core.RequestOptions,
787
+ ): Core.APIPromise<SubscriptionUsage> {
788
+ if (isRequestOptions(query)) {
789
+ return this.fetchUsage(subscriptionId, {}, query);
790
+ }
791
+ return this.get(`/subscriptions/${subscriptionId}/usage`, { query, ...options });
792
+ }
793
+
794
+ /**
795
+ * This endpoint is used to add and edit subscription
796
+ * [price intervals](../reference/price-interval). By making modifications to a
797
+ * subscription’s price intervals, you can
798
+ * [flexibly and atomically control the billing behavior of a subscription](../guides/product-catalog/modifying-subscriptions).
799
+ *
800
+ * ## Adding price intervals
801
+ *
802
+ * Prices can be added as price intervals to a subscription by specifying them in
803
+ * the `add` array. A `price_id` or `external_price_id` from an add-on price or
804
+ * previously removed plan price can be specified to reuse an existing price
805
+ * definition (however, please note that prices from other plans cannot be added to
806
+ * the subscription). Additionally, a new price can be specified using the `price`
807
+ * field — this price will be created automatically.
808
+ *
809
+ * A `start_date` must be specified for the price interval. This is the date when
810
+ * the price will start billing on the subscription, so this will notably result in
811
+ * an immediate charge at this time for any billed in advance fixed fees. The
812
+ * `end_date` will default to null, resulting in a price interval that will bill on
813
+ * a continually recurring basis. Both of these dates can be set in the past or the
814
+ * future and Orb will generate or modify invoices to ensure the subscription’s
815
+ * invoicing behavior is correct.
816
+ *
817
+ * Additionally, a discount, minimum, or maximum can be specified on the price
818
+ * interval. This will only apply to this price interval, not any other price
819
+ * intervals on the subscription.
820
+ *
821
+ * ## Editing price intervals
822
+ *
823
+ * Price intervals can be adjusted by specifying edits to make in the `edit` array.
824
+ * A `price_interval_id` to edit must be specified — this can be retrieved from the
825
+ * `price_intervals` field on the subscription.
826
+ *
827
+ * A new `start_date` or `end_date` can be specified to change the range of the
828
+ * price interval, which will modify past or future invoices to ensure correctness.
829
+ * If either of these dates are unspecified, they will default to the existing date
830
+ * on the price interval. To remove a price interval entirely from a subscription,
831
+ * set the `end_date` to be equivalent to the `start_date`.
832
+ *
833
+ * ## Fixed fee quantity transitions
834
+ *
835
+ * The fixed fee quantity transitions for a fixed fee price interval can also be
836
+ * specified when adding or editing by passing an array for
837
+ * `fixed_fee_quantity_transitions`. A fixed fee quantity transition must have a
838
+ * `quantity` and an `effective_date`, which is the date after which the new
839
+ * quantity will be used for billing. If a fixed fee quantity transition is
840
+ * scheduled at a billing period boundary, the full quantity will be billed on an
841
+ * invoice with the other prices on the subscription. If the fixed fee quantity
842
+ * transition is scheduled mid-billing period, the difference between the existing
843
+ * quantity and quantity specified in the transition will be prorated for the rest
844
+ * of the billing period and billed immediately, which will generate a new invoice.
845
+ *
846
+ * Notably, the list of fixed fee quantity transitions passed will overwrite the
847
+ * existing fixed fee quantity transitions on the price interval, so the entire
848
+ * list of transitions must be specified to add additional transitions. The
849
+ * existing list of transitions can be retrieved using the
850
+ * `fixed_fee_quantity_transitions` property on a subscription’s serialized price
851
+ * intervals.
852
+ */
853
+ priceIntervals(
854
+ subscriptionId: string,
855
+ body?: SubscriptionPriceIntervalsParams,
856
+ options?: Core.RequestOptions,
857
+ ): Core.APIPromise<Subscription>;
858
+ priceIntervals(subscriptionId: string, options?: Core.RequestOptions): Core.APIPromise<Subscription>;
859
+ priceIntervals(
860
+ subscriptionId: string,
861
+ body: SubscriptionPriceIntervalsParams | Core.RequestOptions = {},
862
+ options?: Core.RequestOptions,
863
+ ): Core.APIPromise<Subscription> {
864
+ if (isRequestOptions(body)) {
865
+ return this.priceIntervals(subscriptionId, {}, body);
866
+ }
867
+ return this.post(`/subscriptions/${subscriptionId}/price_intervals`, { body, ...options });
868
+ }
869
+
870
+ /**
871
+ * This endpoint can be used to change the plan on an existing subscription. It
872
+ * returns the serialized updated subscription object.
873
+ *
874
+ * The body parameter `change_option` determines the timing of the plan change. Orb
875
+ * supports three options:
876
+ *
877
+ * - `end_of_subscription_term`: changes the plan at the end of the existing plan's
878
+ * term.
879
+ * - Issuing this plan change request for a monthly subscription will keep the
880
+ * existing plan active until the start of the subsequent month, and
881
+ * potentially issue an invoice for any usage charges incurred in the
882
+ * intervening period.
883
+ * - Issuing this plan change request for a yearly subscription will keep the
884
+ * existing plan active for the full year.
885
+ * - `immediate`: changes the plan immediately. Subscriptions that have their plan
886
+ * changed with this option will be invoiced immediately. This invoice will
887
+ * include any usage fees incurred in the billing period up to the change, along
888
+ * with any prorated recurring fees for the billing period, if applicable.
889
+ * - `requested_date`: changes the plan on the requested date (`change_date`). If
890
+ * no timezone is provided, the customer's timezone is used. The `change_date`
891
+ * body parameter is required if this option is chosen.
892
+ *
893
+ * Note that one of `plan_id` or `external_plan_id` is required in the request body
894
+ * for this operation.
895
+ *
896
+ * ## Price overrides, maximums, and minimums
897
+ *
898
+ * Price overrides are used to update some or all prices in the target plan.
899
+ * Minimums and maximums, much like price overrides, can be useful when a new
900
+ * customer has negotiated a new or different minimum or maximum spend cap than the
901
+ * default for the plan. The request format for price overrides, maximums, and
902
+ * minimums are the same as those in [subscription creation](create-subscription).
903
+ *
904
+ * ## Prorations for in-advance fees
905
+ *
906
+ * By default, Orb calculates the prorated difference in any fixed fees when making
907
+ * a plan change, adjusting the customer balance as needed. For details on this
908
+ * behavior, see
909
+ * [Modifying subscriptions](../guides/product-catalog/modifying-subscriptions.md#prorations-for-in-advance-fees).
910
+ */
911
+ schedulePlanChange(
912
+ subscriptionId: string,
913
+ body: SubscriptionSchedulePlanChangeParams,
914
+ options?: Core.RequestOptions,
915
+ ): Core.APIPromise<Subscription> {
916
+ return this.post(`/subscriptions/${subscriptionId}/schedule_plan_change`, { body, ...options });
917
+ }
918
+
919
+ /**
920
+ * Manually trigger a phase, effective the given date (or the current time, if not
921
+ * specified).
922
+ */
923
+ triggerPhase(
924
+ subscriptionId: string,
925
+ body?: SubscriptionTriggerPhaseParams,
926
+ options?: Core.RequestOptions,
927
+ ): Core.APIPromise<Subscription>;
928
+ triggerPhase(subscriptionId: string, options?: Core.RequestOptions): Core.APIPromise<Subscription>;
929
+ triggerPhase(
930
+ subscriptionId: string,
931
+ body: SubscriptionTriggerPhaseParams | Core.RequestOptions = {},
932
+ options?: Core.RequestOptions,
933
+ ): Core.APIPromise<Subscription> {
934
+ if (isRequestOptions(body)) {
935
+ return this.triggerPhase(subscriptionId, {}, body);
936
+ }
937
+ return this.post(`/subscriptions/${subscriptionId}/trigger_phase`, { body, ...options });
938
+ }
939
+
940
+ /**
941
+ * This endpoint can be used to unschedule any pending cancellations for a
942
+ * subscription.
943
+ *
944
+ * To be eligible, the subscription must currently be active and have a future
945
+ * cancellation. This operation will turn on auto-renew, ensuring that the
946
+ * subscription does not end at the currently scheduled cancellation time.
947
+ */
948
+ unscheduleCancellation(
949
+ subscriptionId: string,
950
+ options?: Core.RequestOptions,
951
+ ): Core.APIPromise<Subscription> {
952
+ return this.post(`/subscriptions/${subscriptionId}/unschedule_cancellation`, options);
953
+ }
954
+
955
+ /**
956
+ * This endpoint can be used to clear scheduled updates to the quantity for a fixed
957
+ * fee.
958
+ *
959
+ * If there are no updates scheduled, this endpoint is a no-op.
960
+ */
961
+ unscheduleFixedFeeQuantityUpdates(
962
+ subscriptionId: string,
963
+ body: SubscriptionUnscheduleFixedFeeQuantityUpdatesParams,
964
+ options?: Core.RequestOptions,
965
+ ): Core.APIPromise<Subscription> {
966
+ return this.post(`/subscriptions/${subscriptionId}/unschedule_fixed_fee_quantity_updates`, {
967
+ body,
968
+ ...options,
969
+ });
970
+ }
971
+
972
+ /**
973
+ * This endpoint can be used to unschedule any pending plan changes on an existing
974
+ * subscription.
975
+ */
976
+ unschedulePendingPlanChanges(
977
+ subscriptionId: string,
978
+ options?: Core.RequestOptions,
979
+ ): Core.APIPromise<Subscription> {
980
+ return this.post(`/subscriptions/${subscriptionId}/unschedule_pending_plan_changes`, options);
981
+ }
982
+
983
+ /**
984
+ * This endpoint can be used to update the quantity for a fixed fee.
985
+ *
986
+ * To be eligible, the subscription must currently be active and the price
987
+ * specified must be a fixed fee (not usage-based). This operation will immediately
988
+ * update the quantity for the fee, or if a `effective_date` is passed in, will
989
+ * update the quantity on the requested date at midnight in the customer's
990
+ * timezone.
991
+ *
992
+ * In order to change the fixed fee quantity as of the next draft invoice for this
993
+ * subscription, pass `change_option=upcoming_invoice` without an `effective_date`
994
+ * specified.
995
+ *
996
+ * If the fee is an in-advance fixed fee, it will also issue an immediate invoice
997
+ * for the difference for the remainder of the billing period.
998
+ */
999
+ updateFixedFeeQuantity(
1000
+ subscriptionId: string,
1001
+ body: SubscriptionUpdateFixedFeeQuantityParams,
1002
+ options?: Core.RequestOptions,
1003
+ ): Core.APIPromise<Subscription> {
1004
+ return this.post(`/subscriptions/${subscriptionId}/update_fixed_fee_quantity`, { body, ...options });
1005
+ }
1006
+ }
1007
+
1008
+ export class SubscriptionsPage extends Page<Subscription> {}
1009
+
1010
+ export class SubscriptionFetchScheduleResponsesPage extends Page<SubscriptionFetchScheduleResponse> {}
1011
+
1012
+ /**
1013
+ * A [subscription](../guides/core-concepts.mdx#subscription) represents the
1014
+ * purchase of a plan by a customer.
1015
+ *
1016
+ * By default, subscriptions begin on the day that they're created and renew
1017
+ * automatically for each billing cycle at the cadence that's configured in the
1018
+ * plan definition.
1019
+ *
1020
+ * Subscriptions also default to **beginning of month alignment**, which means the
1021
+ * first invoice issued for the subscription will have pro-rated charges between
1022
+ * the `start_date` and the first of the following month. Subsequent billing
1023
+ * periods will always start and end on a month boundary (e.g. subsequent month
1024
+ * starts for monthly billing).
1025
+ *
1026
+ * Depending on the plan configuration, any _flat_ recurring fees will be billed
1027
+ * either at the beginning (in-advance) or end (in-arrears) of each billing cycle.
1028
+ * Plans default to **in-advance billing**. Usage-based fees are billed in arrears
1029
+ * as usage is accumulated. In the normal course of events, you can expect an
1030
+ * invoice to contain usage-based charges for the previous period, and a recurring
1031
+ * fee for the following period.
1032
+ */
1033
+ export interface Subscription {
1034
+ id: string;
1035
+
1036
+ /**
1037
+ * The current plan phase that is active, only if the subscription's plan has
1038
+ * phases.
1039
+ */
1040
+ active_plan_phase_order: number | null;
1041
+
1042
+ /**
1043
+ * Determines whether issued invoices for this subscription will automatically be
1044
+ * charged with the saved payment method on the due date. This property defaults to
1045
+ * the plan's behavior.
1046
+ */
1047
+ auto_collection: boolean | null;
1048
+
1049
+ /**
1050
+ * The day of the month on which the billing cycle is anchored. If the maximum
1051
+ * number of days in a month is greater than this value, the last day of the month
1052
+ * is the billing cycle day (e.g. billing_cycle_day=31 for April means the billing
1053
+ * period begins on the 30th.
1054
+ */
1055
+ billing_cycle_day: number;
1056
+
1057
+ created_at: string;
1058
+
1059
+ /**
1060
+ * The end of the current billing period. This is an exclusive timestamp, such that
1061
+ * the instant returned is not part of the billing period. Set to null for
1062
+ * subscriptions that are not currently active.
1063
+ */
1064
+ current_billing_period_end_date: string | null;
1065
+
1066
+ /**
1067
+ * The start date of the current billing period. This is an inclusive timestamp;
1068
+ * the instant returned is exactly the beginning of the billing period. Set to null
1069
+ * if the subscription is not currently active.
1070
+ */
1071
+ current_billing_period_start_date: string | null;
1072
+
1073
+ /**
1074
+ * A customer is a buyer of your products, and the other party to the billing
1075
+ * relationship.
1076
+ *
1077
+ * In Orb, customers are assigned system generated identifiers automatically, but
1078
+ * it's often desirable to have these match existing identifiers in your system. To
1079
+ * avoid having to denormalize Orb ID information, you can pass in an
1080
+ * `external_customer_id` with your own identifier. See
1081
+ * [Customer ID Aliases](../guides/events-and-metrics/customer-aliases) for further
1082
+ * information about how these aliases work in Orb.
1083
+ *
1084
+ * In addition to having an identifier in your system, a customer may exist in a
1085
+ * payment provider solution like Stripe. Use the `payment_provider_id` and the
1086
+ * `payment_provider` enum field to express this mapping.
1087
+ *
1088
+ * A customer also has a timezone (from the standard
1089
+ * [IANA timezone database](https://www.iana.org/time-zones)), which defaults to
1090
+ * your account's timezone. See
1091
+ * [Timezone localization](../guides/product-catalog/timezones.md) for information
1092
+ * on what this timezone parameter influences within Orb.
1093
+ */
1094
+ customer: CustomersAPI.Customer;
1095
+
1096
+ /**
1097
+ * Determines the default memo on this subscriptions' invoices. Note that if this
1098
+ * is not provided, it is determined by the plan configuration.
1099
+ */
1100
+ default_invoice_memo: string | null;
1101
+
1102
+ /**
1103
+ * The discount intervals for this subscription.
1104
+ */
1105
+ discount_intervals: Array<
1106
+ | Subscription.AmountDiscountInterval
1107
+ | Subscription.PercentageDiscountInterval
1108
+ | Subscription.UsageDiscountInterval
1109
+ >;
1110
+
1111
+ /**
1112
+ * The date Orb stops billing for this subscription.
1113
+ */
1114
+ end_date: string | null;
1115
+
1116
+ fixed_fee_quantity_schedule: Array<Subscription.FixedFeeQuantitySchedule>;
1117
+
1118
+ invoicing_threshold: string | null;
1119
+
1120
+ /**
1121
+ * The maximum intervals for this subscription.
1122
+ */
1123
+ maximum_intervals: Array<Subscription.MaximumInterval>;
1124
+
1125
+ /**
1126
+ * User specified key-value pairs. If no metadata was specified at subscription
1127
+ * creation time, this defaults to an empty dictionary.
1128
+ */
1129
+ metadata: unknown;
1130
+
1131
+ /**
1132
+ * The minimum intervals for this subscription.
1133
+ */
1134
+ minimum_intervals: Array<Subscription.MinimumInterval>;
1135
+
1136
+ /**
1137
+ * Determines the difference between the invoice issue date for subscription
1138
+ * invoices as the date that they are due. A value of `0` here represents that the
1139
+ * invoice is due on issue, whereas a value of `30` represents that the customer
1140
+ * has a month to pay the invoice.
1141
+ */
1142
+ net_terms: number;
1143
+
1144
+ /**
1145
+ * The [Plan](../guides/core-concepts.mdx#plan-and-price) resource represents a
1146
+ * plan that can be subscribed to by a customer. Plans define the billing behavior
1147
+ * of the subscription. You can see more about how to configure prices in the
1148
+ * [Price resource](/reference/price).
1149
+ */
1150
+ plan: PlansAPI.Plan;
1151
+
1152
+ /**
1153
+ * The price intervals for this subscription.
1154
+ */
1155
+ price_intervals: Array<Subscription.PriceInterval>;
1156
+
1157
+ redeemed_coupon: Subscription.RedeemedCoupon | null;
1158
+
1159
+ /**
1160
+ * The date Orb starts billing for this subscription.
1161
+ */
1162
+ start_date: string;
1163
+
1164
+ status: 'active' | 'ended' | 'upcoming';
1165
+
1166
+ trial_info: Subscription.TrialInfo;
1167
+ }
1168
+
1169
+ export namespace Subscription {
1170
+ export interface AmountDiscountInterval {
1171
+ /**
1172
+ * Only available if discount_type is `amount`.
1173
+ */
1174
+ amount_discount: string;
1175
+
1176
+ /**
1177
+ * The price ids that this discount interval applies to.
1178
+ */
1179
+ applies_to_price_ids: Array<string>;
1180
+
1181
+ /**
1182
+ * The price interval ids that this discount interval applies to.
1183
+ */
1184
+ applies_to_price_interval_ids: Array<string>;
1185
+
1186
+ discount_type: 'amount';
1187
+
1188
+ /**
1189
+ * The end date of the discount interval.
1190
+ */
1191
+ end_date: string | null;
1192
+
1193
+ /**
1194
+ * The start date of the discount interval.
1195
+ */
1196
+ start_date: string;
1197
+ }
1198
+
1199
+ export interface PercentageDiscountInterval {
1200
+ /**
1201
+ * The price ids that this discount interval applies to.
1202
+ */
1203
+ applies_to_price_ids: Array<string>;
1204
+
1205
+ /**
1206
+ * The price interval ids that this discount interval applies to.
1207
+ */
1208
+ applies_to_price_interval_ids: Array<string>;
1209
+
1210
+ discount_type: 'percentage';
1211
+
1212
+ /**
1213
+ * The end date of the discount interval.
1214
+ */
1215
+ end_date: string | null;
1216
+
1217
+ /**
1218
+ * Only available if discount_type is `percentage`.This is a number between 0
1219
+ * and 1.
1220
+ */
1221
+ percentage_discount: number;
1222
+
1223
+ /**
1224
+ * The start date of the discount interval.
1225
+ */
1226
+ start_date: string;
1227
+ }
1228
+
1229
+ export interface UsageDiscountInterval {
1230
+ /**
1231
+ * The price ids that this discount interval applies to.
1232
+ */
1233
+ applies_to_price_ids: Array<string>;
1234
+
1235
+ /**
1236
+ * The price interval ids that this discount interval applies to.
1237
+ */
1238
+ applies_to_price_interval_ids: Array<string>;
1239
+
1240
+ discount_type: 'usage';
1241
+
1242
+ /**
1243
+ * The end date of the discount interval.
1244
+ */
1245
+ end_date: string | null;
1246
+
1247
+ /**
1248
+ * The start date of the discount interval.
1249
+ */
1250
+ start_date: string;
1251
+
1252
+ /**
1253
+ * Only available if discount_type is `usage`. Number of usage units that this
1254
+ * discount is for
1255
+ */
1256
+ usage_discount: number;
1257
+ }
1258
+
1259
+ export interface FixedFeeQuantitySchedule {
1260
+ end_date: string | null;
1261
+
1262
+ price_id: string;
1263
+
1264
+ quantity: number;
1265
+
1266
+ start_date: string;
1267
+ }
1268
+
1269
+ export interface MaximumInterval {
1270
+ /**
1271
+ * The price ids that this maximum interval applies to.
1272
+ */
1273
+ applies_to_price_ids: Array<string>;
1274
+
1275
+ /**
1276
+ * The price interval ids that this maximum interval applies to.
1277
+ */
1278
+ applies_to_price_interval_ids: Array<string>;
1279
+
1280
+ /**
1281
+ * The end date of the maximum interval.
1282
+ */
1283
+ end_date: string | null;
1284
+
1285
+ /**
1286
+ * The maximum amount to charge in a given billing period for the price intervals
1287
+ * this transform applies to.
1288
+ */
1289
+ maximum_amount: string;
1290
+
1291
+ /**
1292
+ * The start date of the maximum interval.
1293
+ */
1294
+ start_date: string;
1295
+ }
1296
+
1297
+ export interface MinimumInterval {
1298
+ /**
1299
+ * The price ids that this minimum interval applies to.
1300
+ */
1301
+ applies_to_price_ids: Array<string>;
1302
+
1303
+ /**
1304
+ * The price interval ids that this minimum interval applies to.
1305
+ */
1306
+ applies_to_price_interval_ids: Array<string>;
1307
+
1308
+ /**
1309
+ * The end date of the minimum interval.
1310
+ */
1311
+ end_date: string | null;
1312
+
1313
+ /**
1314
+ * The minimum amount to charge in a given billing period for the price intervals
1315
+ * this minimum applies to.
1316
+ */
1317
+ minimum_amount: string;
1318
+
1319
+ /**
1320
+ * The start date of the minimum interval.
1321
+ */
1322
+ start_date: string;
1323
+ }
1324
+
1325
+ /**
1326
+ * The Price Interval resource represents a period of time for which a price will
1327
+ * bill on a subscription. A subscription’s price intervals define its billing
1328
+ * behavior.
1329
+ */
1330
+ export interface PriceInterval {
1331
+ id: string;
1332
+
1333
+ /**
1334
+ * The day of the month that Orb bills for this price
1335
+ */
1336
+ billing_cycle_day: number;
1337
+
1338
+ /**
1339
+ * The end of the current billing period. This is an exclusive timestamp, such that
1340
+ * the instant returned is exactly the end of the billing period. Set to null if
1341
+ * this price interval is not currently active.
1342
+ */
1343
+ current_billing_period_end_date: string | null;
1344
+
1345
+ /**
1346
+ * The start date of the current billing period. This is an inclusive timestamp;
1347
+ * the instant returned is exactly the beginning of the billing period. Set to null
1348
+ * if this price interval is not currently active.
1349
+ */
1350
+ current_billing_period_start_date: string | null;
1351
+
1352
+ /**
1353
+ * The end date of the price interval. This is the date that Orb stops billing for
1354
+ * this price.
1355
+ */
1356
+ end_date: string | null;
1357
+
1358
+ /**
1359
+ * The fixed fee quantity transitions for this price interval. This is only
1360
+ * relevant for fixed fees.
1361
+ */
1362
+ fixed_fee_quantity_transitions: Array<PriceInterval.FixedFeeQuantityTransition> | null;
1363
+
1364
+ /**
1365
+ * The Price resource represents a price that can be billed on a subscription,
1366
+ * resulting in a charge on an invoice in the form of an invoice line item. Prices
1367
+ * take a quantity and determine an amount to bill.
1368
+ *
1369
+ * Orb supports a few different pricing models out of the box. Each of these models
1370
+ * is serialized differently in a given Price object. The model_type field
1371
+ * determines the key for the configuration object that is present.
1372
+ *
1373
+ * ## Unit pricing
1374
+ *
1375
+ * With unit pricing, each unit costs a fixed amount.
1376
+ *
1377
+ * ```json
1378
+ * {
1379
+ * ...
1380
+ * "model_type": "unit",
1381
+ * "unit_config": {
1382
+ * "unit_amount": "0.50"
1383
+ * }
1384
+ * ...
1385
+ * }
1386
+ * ```
1387
+ *
1388
+ * ## Tiered pricing
1389
+ *
1390
+ * In tiered pricing, the cost of a given unit depends on the tier range that it
1391
+ * falls into, where each tier range is defined by an upper and lower bound. For
1392
+ * example, the first ten units may cost $0.50 each and all units thereafter may
1393
+ * cost $0.10 each.
1394
+ *
1395
+ * ```json
1396
+ * {
1397
+ * ...
1398
+ * "model_type": "tiered",
1399
+ * "tiered_config": {
1400
+ * "tiers": [
1401
+ * {
1402
+ * "first_unit": 1,
1403
+ * "last_unit": 10,
1404
+ * "unit_amount": "0.50"
1405
+ * },
1406
+ * {
1407
+ * "first_unit": 11,
1408
+ * "last_unit": null,
1409
+ * "unit_amount": "0.10"
1410
+ * }
1411
+ * ]
1412
+ * }
1413
+ * ...
1414
+ * ```
1415
+ *
1416
+ * ## Bulk pricing
1417
+ *
1418
+ * Bulk pricing applies when the number of units determine the cost of all units.
1419
+ * For example, if you've bought less than 10 units, they may each be $0.50 for a
1420
+ * total of $5.00. Once you've bought more than 10 units, all units may now be
1421
+ * priced at $0.40 (i.e. 101 units total would be $40.40).
1422
+ *
1423
+ * ```json
1424
+ * {
1425
+ * ...
1426
+ * "model_type": "bulk",
1427
+ * "bulk_config": {
1428
+ * "tiers": [
1429
+ * {
1430
+ * "maximum_units": 10,
1431
+ * "unit_amount": "0.50"
1432
+ * },
1433
+ * {
1434
+ * "maximum_units": 1000,
1435
+ * "unit_amount": "0.40"
1436
+ * }
1437
+ * ]
1438
+ * }
1439
+ * ...
1440
+ * }
1441
+ * ```
1442
+ *
1443
+ * ## Package pricing
1444
+ *
1445
+ * Package pricing defines the size or granularity of a unit for billing purposes.
1446
+ * For example, if the package size is set to 5, then 4 units will be billed as 5
1447
+ * and 6 units will be billed at 10.
1448
+ *
1449
+ * ```json
1450
+ * {
1451
+ * ...
1452
+ * "model_type": "package",
1453
+ * "package_config": {
1454
+ * "package_amount": "0.80",
1455
+ * "package_size": 10
1456
+ * }
1457
+ * ...
1458
+ * }
1459
+ * ```
1460
+ *
1461
+ * ## BPS pricing
1462
+ *
1463
+ * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
1464
+ * percent (the number of basis points to charge), as well as a cap per event to
1465
+ * assess. For example, this would allow you to assess a fee of 0.25% on every
1466
+ * payment you process, with a maximum charge of $25 per payment.
1467
+ *
1468
+ * ```json
1469
+ * {
1470
+ * ...
1471
+ * "model_type": "bps",
1472
+ * "bps_config": {
1473
+ * "bps": 125,
1474
+ * "per_unit_maximum": "11.00"
1475
+ * }
1476
+ * ...
1477
+ * }
1478
+ * ```
1479
+ *
1480
+ * ## Bulk BPS pricing
1481
+ *
1482
+ * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
1483
+ * total quantity across all events. Similar to bulk pricing, the BPS parameters of
1484
+ * a given event depends on the tier range that the billing period falls into. Each
1485
+ * tier range is defined by an upper bound. For example, after $1.5M of payment
1486
+ * volume is reached, each individual payment may have a lower cap or a smaller
1487
+ * take-rate.
1488
+ *
1489
+ * ```json
1490
+ * ...
1491
+ * "model_type": "bulk_bps",
1492
+ * "bulk_bps_config": {
1493
+ * "tiers": [
1494
+ * {
1495
+ * "maximum_amount": "1000000.00",
1496
+ * "bps": 125,
1497
+ * "per_unit_maximum": "19.00"
1498
+ * },
1499
+ * {
1500
+ * "maximum_amount": null,
1501
+ * "bps": 115,
1502
+ * "per_unit_maximum": "4.00"
1503
+ * }
1504
+ * ]
1505
+ * }
1506
+ * ...
1507
+ * }
1508
+ * ```
1509
+ *
1510
+ * ## Tiered BPS pricing
1511
+ *
1512
+ * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
1513
+ * event's applicable parameter is a function of its marginal addition to the
1514
+ * period total. Similar to tiered pricing, the BPS parameters of a given event
1515
+ * depends on the tier range that it falls into, where each tier range is defined
1516
+ * by an upper and lower bound. For example, the first few payments may have a 0.8
1517
+ * BPS take-rate and all payments after a specific volume may incur a take-rate of
1518
+ * 0.5 BPS each.
1519
+ *
1520
+ * ```json
1521
+ * ...
1522
+ * "model_type": "tiered_bps",
1523
+ * "tiered_bps_config": {
1524
+ * "tiers": [
1525
+ * {
1526
+ * "minimum_amount": "0",
1527
+ * "maximum_amount": "1000000.00",
1528
+ * "bps": 125,
1529
+ * "per_unit_maximum": "19.00"
1530
+ * },
1531
+ * {
1532
+ * "minimum_amount": "1000000.00",
1533
+ * "maximum_amount": null,
1534
+ * "bps": 115,
1535
+ * "per_unit_maximum": "4.00"
1536
+ * }
1537
+ * ]
1538
+ * }
1539
+ * ...
1540
+ * }
1541
+ * ```
1542
+ *
1543
+ * ## Matrix pricing
1544
+ *
1545
+ * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
1546
+ * `dimensions` defines the two event property values evaluated in this pricing
1547
+ * model. In a one-dimensional matrix, the second value is `null`. Every
1548
+ * configuration has a list of `matrix_values` which give the unit prices for
1549
+ * specified property values. In a one-dimensional matrix, the matrix values will
1550
+ * have `dimension_values` where the second value of the pair is null. If an event
1551
+ * does not match any of the dimension values in the matrix, it will resort to the
1552
+ * `default_unit_amount`.
1553
+ *
1554
+ * ```json
1555
+ * {
1556
+ * "model_type": "matrix"
1557
+ * "matrix_config": {
1558
+ * "default_unit_amount": "3.00",
1559
+ * "dimensions": [
1560
+ * "cluster_name",
1561
+ * "region"
1562
+ * ],
1563
+ * "matrix_values": [
1564
+ * {
1565
+ * "dimension_values": [
1566
+ * "alpha",
1567
+ * "west"
1568
+ * ],
1569
+ * "unit_amount": "2.00"
1570
+ * },
1571
+ * ...
1572
+ * ]
1573
+ * }
1574
+ * }
1575
+ * ```
1576
+ *
1577
+ * ### Fixed fees
1578
+ *
1579
+ * Fixed fees are prices that are applied independent of usage quantities, and
1580
+ * follow unit pricing. They also have an additional parameter
1581
+ * `fixed_price_quantity`. If the Price represents a fixed cost, this represents
1582
+ * the quantity of units applied.
1583
+ *
1584
+ * ```json
1585
+ * {
1586
+ * ...
1587
+ * "id": "price_id",
1588
+ * "model_type": "unit",
1589
+ * "unit_config": {
1590
+ * "unit_amount": "2.00"
1591
+ * },
1592
+ * "fixed_price_quantity": 3.0
1593
+ * ...
1594
+ * }
1595
+ * ```
1596
+ */
1597
+ price: PricesAPI.Price;
1598
+
1599
+ /**
1600
+ * The start date of the price interval. This is the date that Orb starts billing
1601
+ * for this price.
1602
+ */
1603
+ start_date: string;
1604
+ }
1605
+
1606
+ export namespace PriceInterval {
1607
+ export interface FixedFeeQuantityTransition {
1608
+ effective_date: string;
1609
+
1610
+ price_id: string;
1611
+
1612
+ quantity: number;
1613
+ }
1614
+ }
1615
+
1616
+ export interface RedeemedCoupon {
1617
+ coupon_id: string;
1618
+
1619
+ end_date: string | null;
1620
+
1621
+ start_date: string;
1622
+ }
1623
+
1624
+ export interface TrialInfo {
1625
+ end_date: string | null;
1626
+ }
1627
+ }
1628
+
1629
+ export interface Subscriptions {
1630
+ data: Array<Subscription>;
1631
+
1632
+ pagination_metadata: Subscriptions.PaginationMetadata;
1633
+ }
1634
+
1635
+ export namespace Subscriptions {
1636
+ export interface PaginationMetadata {
1637
+ has_more: boolean;
1638
+
1639
+ next_cursor: string | null;
1640
+ }
1641
+ }
1642
+
1643
+ export type SubscriptionUsage =
1644
+ | SubscriptionUsage.UngroupedSubscriptionUsage
1645
+ | SubscriptionUsage.GroupedSubscriptionUsage;
1646
+
1647
+ export namespace SubscriptionUsage {
1648
+ export interface UngroupedSubscriptionUsage {
1649
+ data: Array<UngroupedSubscriptionUsage.Data>;
1650
+ }
1651
+
1652
+ export namespace UngroupedSubscriptionUsage {
1653
+ export interface Data {
1654
+ billable_metric: Data.BillableMetric;
1655
+
1656
+ usage: Array<Data.Usage>;
1657
+
1658
+ view_mode: 'periodic' | 'cumulative';
1659
+ }
1660
+
1661
+ export namespace Data {
1662
+ export interface BillableMetric {
1663
+ id: string;
1664
+
1665
+ name: string;
1666
+ }
1667
+
1668
+ export interface Usage {
1669
+ quantity: number;
1670
+
1671
+ timeframe_end: string;
1672
+
1673
+ timeframe_start: string;
1674
+ }
1675
+ }
1676
+ }
1677
+
1678
+ export interface GroupedSubscriptionUsage {
1679
+ data: Array<GroupedSubscriptionUsage.Data>;
1680
+
1681
+ pagination_metadata?: GroupedSubscriptionUsage.PaginationMetadata | null;
1682
+ }
1683
+
1684
+ export namespace GroupedSubscriptionUsage {
1685
+ export interface Data {
1686
+ billable_metric: Data.BillableMetric;
1687
+
1688
+ metric_group: Data.MetricGroup;
1689
+
1690
+ usage: Array<Data.Usage>;
1691
+
1692
+ view_mode: 'periodic' | 'cumulative';
1693
+ }
1694
+
1695
+ export namespace Data {
1696
+ export interface BillableMetric {
1697
+ id: string;
1698
+
1699
+ name: string;
1700
+ }
1701
+
1702
+ export interface MetricGroup {
1703
+ property_key: string;
1704
+
1705
+ property_value: string;
1706
+ }
1707
+
1708
+ export interface Usage {
1709
+ quantity: number;
1710
+
1711
+ timeframe_end: string;
1712
+
1713
+ timeframe_start: string;
1714
+ }
1715
+ }
1716
+
1717
+ export interface PaginationMetadata {
1718
+ has_more: boolean;
1719
+
1720
+ next_cursor: string | null;
1721
+ }
1722
+ }
1723
+ }
1724
+
1725
+ export interface SubscriptionFetchCostsResponse {
1726
+ data: Array<SubscriptionFetchCostsResponse.Data>;
1727
+ }
1728
+
1729
+ export namespace SubscriptionFetchCostsResponse {
1730
+ export interface Data {
1731
+ per_price_costs: Array<Data.PerPriceCost>;
1732
+
1733
+ /**
1734
+ * Total costs for the timeframe, excluding any minimums and discounts.
1735
+ */
1736
+ subtotal: string;
1737
+
1738
+ timeframe_end: string;
1739
+
1740
+ timeframe_start: string;
1741
+
1742
+ /**
1743
+ * Total costs for the timeframe, including any minimums and discounts.
1744
+ */
1745
+ total: string;
1746
+ }
1747
+
1748
+ export namespace Data {
1749
+ export interface PerPriceCost {
1750
+ /**
1751
+ * The Price resource represents a price that can be billed on a subscription,
1752
+ * resulting in a charge on an invoice in the form of an invoice line item. Prices
1753
+ * take a quantity and determine an amount to bill.
1754
+ *
1755
+ * Orb supports a few different pricing models out of the box. Each of these models
1756
+ * is serialized differently in a given Price object. The model_type field
1757
+ * determines the key for the configuration object that is present.
1758
+ *
1759
+ * ## Unit pricing
1760
+ *
1761
+ * With unit pricing, each unit costs a fixed amount.
1762
+ *
1763
+ * ```json
1764
+ * {
1765
+ * ...
1766
+ * "model_type": "unit",
1767
+ * "unit_config": {
1768
+ * "unit_amount": "0.50"
1769
+ * }
1770
+ * ...
1771
+ * }
1772
+ * ```
1773
+ *
1774
+ * ## Tiered pricing
1775
+ *
1776
+ * In tiered pricing, the cost of a given unit depends on the tier range that it
1777
+ * falls into, where each tier range is defined by an upper and lower bound. For
1778
+ * example, the first ten units may cost $0.50 each and all units thereafter may
1779
+ * cost $0.10 each.
1780
+ *
1781
+ * ```json
1782
+ * {
1783
+ * ...
1784
+ * "model_type": "tiered",
1785
+ * "tiered_config": {
1786
+ * "tiers": [
1787
+ * {
1788
+ * "first_unit": 1,
1789
+ * "last_unit": 10,
1790
+ * "unit_amount": "0.50"
1791
+ * },
1792
+ * {
1793
+ * "first_unit": 11,
1794
+ * "last_unit": null,
1795
+ * "unit_amount": "0.10"
1796
+ * }
1797
+ * ]
1798
+ * }
1799
+ * ...
1800
+ * ```
1801
+ *
1802
+ * ## Bulk pricing
1803
+ *
1804
+ * Bulk pricing applies when the number of units determine the cost of all units.
1805
+ * For example, if you've bought less than 10 units, they may each be $0.50 for a
1806
+ * total of $5.00. Once you've bought more than 10 units, all units may now be
1807
+ * priced at $0.40 (i.e. 101 units total would be $40.40).
1808
+ *
1809
+ * ```json
1810
+ * {
1811
+ * ...
1812
+ * "model_type": "bulk",
1813
+ * "bulk_config": {
1814
+ * "tiers": [
1815
+ * {
1816
+ * "maximum_units": 10,
1817
+ * "unit_amount": "0.50"
1818
+ * },
1819
+ * {
1820
+ * "maximum_units": 1000,
1821
+ * "unit_amount": "0.40"
1822
+ * }
1823
+ * ]
1824
+ * }
1825
+ * ...
1826
+ * }
1827
+ * ```
1828
+ *
1829
+ * ## Package pricing
1830
+ *
1831
+ * Package pricing defines the size or granularity of a unit for billing purposes.
1832
+ * For example, if the package size is set to 5, then 4 units will be billed as 5
1833
+ * and 6 units will be billed at 10.
1834
+ *
1835
+ * ```json
1836
+ * {
1837
+ * ...
1838
+ * "model_type": "package",
1839
+ * "package_config": {
1840
+ * "package_amount": "0.80",
1841
+ * "package_size": 10
1842
+ * }
1843
+ * ...
1844
+ * }
1845
+ * ```
1846
+ *
1847
+ * ## BPS pricing
1848
+ *
1849
+ * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
1850
+ * percent (the number of basis points to charge), as well as a cap per event to
1851
+ * assess. For example, this would allow you to assess a fee of 0.25% on every
1852
+ * payment you process, with a maximum charge of $25 per payment.
1853
+ *
1854
+ * ```json
1855
+ * {
1856
+ * ...
1857
+ * "model_type": "bps",
1858
+ * "bps_config": {
1859
+ * "bps": 125,
1860
+ * "per_unit_maximum": "11.00"
1861
+ * }
1862
+ * ...
1863
+ * }
1864
+ * ```
1865
+ *
1866
+ * ## Bulk BPS pricing
1867
+ *
1868
+ * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
1869
+ * total quantity across all events. Similar to bulk pricing, the BPS parameters of
1870
+ * a given event depends on the tier range that the billing period falls into. Each
1871
+ * tier range is defined by an upper bound. For example, after $1.5M of payment
1872
+ * volume is reached, each individual payment may have a lower cap or a smaller
1873
+ * take-rate.
1874
+ *
1875
+ * ```json
1876
+ * ...
1877
+ * "model_type": "bulk_bps",
1878
+ * "bulk_bps_config": {
1879
+ * "tiers": [
1880
+ * {
1881
+ * "maximum_amount": "1000000.00",
1882
+ * "bps": 125,
1883
+ * "per_unit_maximum": "19.00"
1884
+ * },
1885
+ * {
1886
+ * "maximum_amount": null,
1887
+ * "bps": 115,
1888
+ * "per_unit_maximum": "4.00"
1889
+ * }
1890
+ * ]
1891
+ * }
1892
+ * ...
1893
+ * }
1894
+ * ```
1895
+ *
1896
+ * ## Tiered BPS pricing
1897
+ *
1898
+ * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
1899
+ * event's applicable parameter is a function of its marginal addition to the
1900
+ * period total. Similar to tiered pricing, the BPS parameters of a given event
1901
+ * depends on the tier range that it falls into, where each tier range is defined
1902
+ * by an upper and lower bound. For example, the first few payments may have a 0.8
1903
+ * BPS take-rate and all payments after a specific volume may incur a take-rate of
1904
+ * 0.5 BPS each.
1905
+ *
1906
+ * ```json
1907
+ * ...
1908
+ * "model_type": "tiered_bps",
1909
+ * "tiered_bps_config": {
1910
+ * "tiers": [
1911
+ * {
1912
+ * "minimum_amount": "0",
1913
+ * "maximum_amount": "1000000.00",
1914
+ * "bps": 125,
1915
+ * "per_unit_maximum": "19.00"
1916
+ * },
1917
+ * {
1918
+ * "minimum_amount": "1000000.00",
1919
+ * "maximum_amount": null,
1920
+ * "bps": 115,
1921
+ * "per_unit_maximum": "4.00"
1922
+ * }
1923
+ * ]
1924
+ * }
1925
+ * ...
1926
+ * }
1927
+ * ```
1928
+ *
1929
+ * ## Matrix pricing
1930
+ *
1931
+ * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
1932
+ * `dimensions` defines the two event property values evaluated in this pricing
1933
+ * model. In a one-dimensional matrix, the second value is `null`. Every
1934
+ * configuration has a list of `matrix_values` which give the unit prices for
1935
+ * specified property values. In a one-dimensional matrix, the matrix values will
1936
+ * have `dimension_values` where the second value of the pair is null. If an event
1937
+ * does not match any of the dimension values in the matrix, it will resort to the
1938
+ * `default_unit_amount`.
1939
+ *
1940
+ * ```json
1941
+ * {
1942
+ * "model_type": "matrix"
1943
+ * "matrix_config": {
1944
+ * "default_unit_amount": "3.00",
1945
+ * "dimensions": [
1946
+ * "cluster_name",
1947
+ * "region"
1948
+ * ],
1949
+ * "matrix_values": [
1950
+ * {
1951
+ * "dimension_values": [
1952
+ * "alpha",
1953
+ * "west"
1954
+ * ],
1955
+ * "unit_amount": "2.00"
1956
+ * },
1957
+ * ...
1958
+ * ]
1959
+ * }
1960
+ * }
1961
+ * ```
1962
+ *
1963
+ * ### Fixed fees
1964
+ *
1965
+ * Fixed fees are prices that are applied independent of usage quantities, and
1966
+ * follow unit pricing. They also have an additional parameter
1967
+ * `fixed_price_quantity`. If the Price represents a fixed cost, this represents
1968
+ * the quantity of units applied.
1969
+ *
1970
+ * ```json
1971
+ * {
1972
+ * ...
1973
+ * "id": "price_id",
1974
+ * "model_type": "unit",
1975
+ * "unit_config": {
1976
+ * "unit_amount": "2.00"
1977
+ * },
1978
+ * "fixed_price_quantity": 3.0
1979
+ * ...
1980
+ * }
1981
+ * ```
1982
+ */
1983
+ price: PricesAPI.Price;
1984
+
1985
+ /**
1986
+ * Price's contributions for the timeframe, excluding any minimums and discounts.
1987
+ */
1988
+ subtotal: string;
1989
+
1990
+ /**
1991
+ * Price's contributions for the timeframe, including minimums and discounts.
1992
+ */
1993
+ total: string;
1994
+
1995
+ /**
1996
+ * If a `group_by` attribute is passed in, array of costs per `grouping_key`,
1997
+ * `grouping_value` or `secondary_grouping_key`, `secondary_grouping_value`.
1998
+ */
1999
+ price_groups?: Array<PerPriceCost.PriceGroup> | null;
2000
+
2001
+ /**
2002
+ * The price's quantity for the timeframe
2003
+ */
2004
+ quantity?: number | null;
2005
+ }
2006
+
2007
+ export namespace PerPriceCost {
2008
+ export interface PriceGroup {
2009
+ /**
2010
+ * Grouping key to break down a single price's costs
2011
+ */
2012
+ grouping_key: string;
2013
+
2014
+ grouping_value: string | null;
2015
+
2016
+ /**
2017
+ * If the price is a matrix price, this is the second dimension key
2018
+ */
2019
+ secondary_grouping_key: string | null;
2020
+
2021
+ secondary_grouping_value: string | null;
2022
+
2023
+ /**
2024
+ * Total costs for this group for the timeframe. Note that this does not account
2025
+ * for any minimums or discounts.
2026
+ */
2027
+ total: string;
2028
+ }
2029
+ }
2030
+ }
2031
+ }
2032
+
2033
+ export interface SubscriptionFetchScheduleResponse {
2034
+ end_date: string | null;
2035
+
2036
+ plan: SubscriptionFetchScheduleResponse.Plan;
2037
+
2038
+ start_date: string;
2039
+ }
2040
+
2041
+ export namespace SubscriptionFetchScheduleResponse {
2042
+ export interface Plan {
2043
+ id: string | null;
2044
+
2045
+ /**
2046
+ * An optional user-defined ID for this plan resource, used throughout the system
2047
+ * as an alias for this Plan. Use this field to identify a plan by an existing
2048
+ * identifier in your system.
2049
+ */
2050
+ external_plan_id: string | null;
2051
+
2052
+ name: string | null;
2053
+ }
2054
+ }
2055
+
2056
+ export interface SubscriptionCreateParams {
2057
+ align_billing_with_subscription_start_date?: boolean;
2058
+
2059
+ auto_collection?: boolean | null;
2060
+
2061
+ aws_region?: string | null;
2062
+
2063
+ coupon_redemption_code?: string | null;
2064
+
2065
+ credits_overage_rate?: number | null;
2066
+
2067
+ customer_id?: string | null;
2068
+
2069
+ default_invoice_memo?: string | null;
2070
+
2071
+ end_date?: string | null;
2072
+
2073
+ external_customer_id?: string | null;
2074
+
2075
+ external_marketplace?: 'google' | 'aws' | 'azure' | null;
2076
+
2077
+ external_marketplace_reporting_id?: string | null;
2078
+
2079
+ /**
2080
+ * The external_plan_id of the plan that the given subscription should be switched
2081
+ * to. Note that either this property or `plan_id` must be specified.
2082
+ */
2083
+ external_plan_id?: string | null;
2084
+
2085
+ initial_phase_order?: number | null;
2086
+
2087
+ invoicing_threshold?: string | null;
2088
+
2089
+ metadata?: unknown | null;
2090
+
2091
+ net_terms?: number | null;
2092
+
2093
+ per_credit_overage_amount?: string | null;
2094
+
2095
+ /**
2096
+ * The plan that the given subscription should be switched to. Note that either
2097
+ * this property or `external_plan_id` must be specified.
2098
+ */
2099
+ plan_id?: string | null;
2100
+
2101
+ /**
2102
+ * Optionally provide a list of overrides for prices on the plan
2103
+ */
2104
+ price_overrides?: Array<
2105
+ | SubscriptionCreateParams.OverrideUnitPrice
2106
+ | SubscriptionCreateParams.OverridePackagePrice
2107
+ | SubscriptionCreateParams.OverrideMatrixPrice
2108
+ | SubscriptionCreateParams.OverrideTieredPrice
2109
+ | SubscriptionCreateParams.OverrideTieredBpsPrice
2110
+ | SubscriptionCreateParams.OverrideBpsPrice
2111
+ | SubscriptionCreateParams.OverrideBulkBpsPrice
2112
+ | SubscriptionCreateParams.OverrideBulkPrice
2113
+ | SubscriptionCreateParams.OverrideTestRatingFunctionPrice
2114
+ | SubscriptionCreateParams.OverrideFivetranExamplePrice
2115
+ | SubscriptionCreateParams.OverrideThresholdTotalAmountPrice
2116
+ | SubscriptionCreateParams.OverrideTieredPackagePrice
2117
+ | SubscriptionCreateParams.OverrideTieredWithMinimumPrice
2118
+ | SubscriptionCreateParams.OverridePackageWithAllocationPrice
2119
+ > | null;
2120
+
2121
+ start_date?: string | null;
2122
+ }
2123
+
2124
+ export namespace SubscriptionCreateParams {
2125
+ export interface OverrideUnitPrice {
2126
+ id: string;
2127
+
2128
+ model_type: 'unit';
2129
+
2130
+ unit_config: OverrideUnitPrice.UnitConfig;
2131
+
2132
+ /**
2133
+ * The subscription's override discount for the plan.
2134
+ */
2135
+ discount?: PricesAPI.Discount | null;
2136
+
2137
+ /**
2138
+ * The starting quantity of the price, if the price is a fixed price.
2139
+ */
2140
+ fixed_price_quantity?: number | null;
2141
+
2142
+ /**
2143
+ * The subscription's override maximum amount for the plan.
2144
+ */
2145
+ maximum_amount?: string | null;
2146
+
2147
+ /**
2148
+ * The subscription's override minimum amount for the plan.
2149
+ */
2150
+ minimum_amount?: string | null;
2151
+ }
2152
+
2153
+ export namespace OverrideUnitPrice {
2154
+ export interface UnitConfig {
2155
+ /**
2156
+ * Rate per unit of usage
2157
+ */
2158
+ unit_amount: string;
2159
+
2160
+ /**
2161
+ * Multiplier to scale rated quantity by
2162
+ */
2163
+ scaling_factor?: number | null;
2164
+ }
2165
+ }
2166
+
2167
+ export interface OverridePackagePrice {
2168
+ id: string;
2169
+
2170
+ model_type: 'package';
2171
+
2172
+ package_config: OverridePackagePrice.PackageConfig;
2173
+
2174
+ /**
2175
+ * The subscription's override discount for the plan.
2176
+ */
2177
+ discount?: PricesAPI.Discount | null;
2178
+
2179
+ /**
2180
+ * The starting quantity of the price, if the price is a fixed price.
2181
+ */
2182
+ fixed_price_quantity?: number | null;
2183
+
2184
+ /**
2185
+ * The subscription's override maximum amount for the plan.
2186
+ */
2187
+ maximum_amount?: string | null;
2188
+
2189
+ /**
2190
+ * The subscription's override minimum amount for the plan.
2191
+ */
2192
+ minimum_amount?: string | null;
2193
+ }
2194
+
2195
+ export namespace OverridePackagePrice {
2196
+ export interface PackageConfig {
2197
+ /**
2198
+ * A currency amount to rate usage by
2199
+ */
2200
+ package_amount: string;
2201
+
2202
+ /**
2203
+ * An integer amount to represent package size. For example, 1000 here would divide
2204
+ * usage by 1000 before multiplying by package_amount in rating
2205
+ */
2206
+ package_size?: number | null;
2207
+ }
2208
+ }
2209
+
2210
+ export interface OverrideMatrixPrice {
2211
+ id: string;
2212
+
2213
+ matrix_config: OverrideMatrixPrice.MatrixConfig;
2214
+
2215
+ model_type: 'matrix';
2216
+
2217
+ /**
2218
+ * The subscription's override discount for the plan.
2219
+ */
2220
+ discount?: PricesAPI.Discount | null;
2221
+
2222
+ /**
2223
+ * The starting quantity of the price, if the price is a fixed price.
2224
+ */
2225
+ fixed_price_quantity?: number | null;
2226
+
2227
+ /**
2228
+ * The subscription's override maximum amount for the plan.
2229
+ */
2230
+ maximum_amount?: string | null;
2231
+
2232
+ /**
2233
+ * The subscription's override minimum amount for the plan.
2234
+ */
2235
+ minimum_amount?: string | null;
2236
+ }
2237
+
2238
+ export namespace OverrideMatrixPrice {
2239
+ export interface MatrixConfig {
2240
+ /**
2241
+ * Default per unit rate for any usage not bucketed into a specified matrix_value
2242
+ */
2243
+ default_unit_amount: string;
2244
+
2245
+ /**
2246
+ * One or two event property values to evaluate matrix groups by
2247
+ */
2248
+ dimensions: Array<string | null>;
2249
+
2250
+ /**
2251
+ * Matrix values for specified matrix grouping keys
2252
+ */
2253
+ matrix_values: Array<MatrixConfig.MatrixValue>;
2254
+
2255
+ /**
2256
+ * Default optional multiplier to scale rated quantities that fall into the default
2257
+ * bucket by
2258
+ */
2259
+ scaling_factor?: number | null;
2260
+ }
2261
+
2262
+ export namespace MatrixConfig {
2263
+ export interface MatrixValue {
2264
+ /**
2265
+ * One or two matrix keys to filter usage to this Matrix value by. For example,
2266
+ * ["region", "tier"] could be used to filter cloud usage by a cloud region and an
2267
+ * instance tier.
2268
+ */
2269
+ dimension_values: Array<string | null>;
2270
+
2271
+ /**
2272
+ * Unit price for the specified dimension_values
2273
+ */
2274
+ unit_amount: string;
2275
+
2276
+ /**
2277
+ * Optional multiplier to scale rated quantities by
2278
+ */
2279
+ scaling_factor?: number | null;
2280
+ }
2281
+ }
2282
+ }
2283
+
2284
+ export interface OverrideTieredPrice {
2285
+ id: string;
2286
+
2287
+ model_type: 'tiered';
2288
+
2289
+ tiered_config: OverrideTieredPrice.TieredConfig;
2290
+
2291
+ /**
2292
+ * The subscription's override discount for the plan.
2293
+ */
2294
+ discount?: PricesAPI.Discount | null;
2295
+
2296
+ /**
2297
+ * The starting quantity of the price, if the price is a fixed price.
2298
+ */
2299
+ fixed_price_quantity?: number | null;
2300
+
2301
+ /**
2302
+ * The subscription's override maximum amount for the plan.
2303
+ */
2304
+ maximum_amount?: string | null;
2305
+
2306
+ /**
2307
+ * The subscription's override minimum amount for the plan.
2308
+ */
2309
+ minimum_amount?: string | null;
2310
+ }
2311
+
2312
+ export namespace OverrideTieredPrice {
2313
+ export interface TieredConfig {
2314
+ /**
2315
+ * Tiers for rating based on total usage quantities into the specified tier
2316
+ */
2317
+ tiers: Array<TieredConfig.Tier>;
2318
+ }
2319
+
2320
+ export namespace TieredConfig {
2321
+ export interface Tier {
2322
+ /**
2323
+ * Inclusive tier starting value
2324
+ */
2325
+ first_unit: number;
2326
+
2327
+ /**
2328
+ * Amount per unit
2329
+ */
2330
+ unit_amount: string;
2331
+
2332
+ /**
2333
+ * Exclusive tier ending value. If null, this is treated as the last tier
2334
+ */
2335
+ last_unit?: number | null;
2336
+ }
2337
+ }
2338
+ }
2339
+
2340
+ export interface OverrideTieredBpsPrice {
2341
+ id: string;
2342
+
2343
+ model_type: 'tiered_bps';
2344
+
2345
+ tiered_bps_config: OverrideTieredBpsPrice.TieredBpsConfig;
2346
+
2347
+ /**
2348
+ * The subscription's override discount for the plan.
2349
+ */
2350
+ discount?: PricesAPI.Discount | null;
2351
+
2352
+ /**
2353
+ * The starting quantity of the price, if the price is a fixed price.
2354
+ */
2355
+ fixed_price_quantity?: number | null;
2356
+
2357
+ /**
2358
+ * The subscription's override maximum amount for the plan.
2359
+ */
2360
+ maximum_amount?: string | null;
2361
+
2362
+ /**
2363
+ * The subscription's override minimum amount for the plan.
2364
+ */
2365
+ minimum_amount?: string | null;
2366
+ }
2367
+
2368
+ export namespace OverrideTieredBpsPrice {
2369
+ export interface TieredBpsConfig {
2370
+ /**
2371
+ * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
2372
+ * tiers
2373
+ */
2374
+ tiers: Array<TieredBpsConfig.Tier>;
2375
+ }
2376
+
2377
+ export namespace TieredBpsConfig {
2378
+ export interface Tier {
2379
+ /**
2380
+ * Per-event basis point rate
2381
+ */
2382
+ bps: number;
2383
+
2384
+ /**
2385
+ * Inclusive tier starting value
2386
+ */
2387
+ minimum_amount: string;
2388
+
2389
+ /**
2390
+ * Exclusive tier ending value
2391
+ */
2392
+ maximum_amount?: string | null;
2393
+
2394
+ /**
2395
+ * Per unit maximum to charge
2396
+ */
2397
+ per_unit_maximum?: string | null;
2398
+ }
2399
+ }
2400
+ }
2401
+
2402
+ export interface OverrideBpsPrice {
2403
+ id: string;
2404
+
2405
+ bps_config: OverrideBpsPrice.BpsConfig;
2406
+
2407
+ model_type: 'bps';
2408
+
2409
+ /**
2410
+ * The subscription's override discount for the plan.
2411
+ */
2412
+ discount?: PricesAPI.Discount | null;
2413
+
2414
+ /**
2415
+ * The starting quantity of the price, if the price is a fixed price.
2416
+ */
2417
+ fixed_price_quantity?: number | null;
2418
+
2419
+ /**
2420
+ * The subscription's override maximum amount for the plan.
2421
+ */
2422
+ maximum_amount?: string | null;
2423
+
2424
+ /**
2425
+ * The subscription's override minimum amount for the plan.
2426
+ */
2427
+ minimum_amount?: string | null;
2428
+ }
2429
+
2430
+ export namespace OverrideBpsPrice {
2431
+ export interface BpsConfig {
2432
+ /**
2433
+ * Basis point take rate per event
2434
+ */
2435
+ bps: number;
2436
+
2437
+ /**
2438
+ * Optional currency amount maximum to cap spend per event
2439
+ */
2440
+ per_unit_maximum?: string | null;
2441
+ }
2442
+ }
2443
+
2444
+ export interface OverrideBulkBpsPrice {
2445
+ id: string;
2446
+
2447
+ bulk_bps_config: OverrideBulkBpsPrice.BulkBpsConfig;
2448
+
2449
+ model_type: 'bulk_bps';
2450
+
2451
+ /**
2452
+ * The subscription's override discount for the plan.
2453
+ */
2454
+ discount?: PricesAPI.Discount | null;
2455
+
2456
+ /**
2457
+ * The starting quantity of the price, if the price is a fixed price.
2458
+ */
2459
+ fixed_price_quantity?: number | null;
2460
+
2461
+ /**
2462
+ * The subscription's override maximum amount for the plan.
2463
+ */
2464
+ maximum_amount?: string | null;
2465
+
2466
+ /**
2467
+ * The subscription's override minimum amount for the plan.
2468
+ */
2469
+ minimum_amount?: string | null;
2470
+ }
2471
+
2472
+ export namespace OverrideBulkBpsPrice {
2473
+ export interface BulkBpsConfig {
2474
+ /**
2475
+ * Tiers for a bulk BPS pricing model where all usage is aggregated to a single
2476
+ * tier based on total volume
2477
+ */
2478
+ tiers: Array<BulkBpsConfig.Tier>;
2479
+ }
2480
+
2481
+ export namespace BulkBpsConfig {
2482
+ export interface Tier {
2483
+ /**
2484
+ * Basis points to rate on
2485
+ */
2486
+ bps: number;
2487
+
2488
+ /**
2489
+ * Upper bound for tier
2490
+ */
2491
+ maximum_amount?: string | null;
2492
+
2493
+ /**
2494
+ * The maximum amount to charge for any one event
2495
+ */
2496
+ per_unit_maximum?: string | null;
2497
+ }
2498
+ }
2499
+ }
2500
+
2501
+ export interface OverrideBulkPrice {
2502
+ id: string;
2503
+
2504
+ bulk_config: OverrideBulkPrice.BulkConfig;
2505
+
2506
+ model_type: 'bulk';
2507
+
2508
+ /**
2509
+ * The subscription's override discount for the plan.
2510
+ */
2511
+ discount?: PricesAPI.Discount | null;
2512
+
2513
+ /**
2514
+ * The starting quantity of the price, if the price is a fixed price.
2515
+ */
2516
+ fixed_price_quantity?: number | null;
2517
+
2518
+ /**
2519
+ * The subscription's override maximum amount for the plan.
2520
+ */
2521
+ maximum_amount?: string | null;
2522
+
2523
+ /**
2524
+ * The subscription's override minimum amount for the plan.
2525
+ */
2526
+ minimum_amount?: string | null;
2527
+ }
2528
+
2529
+ export namespace OverrideBulkPrice {
2530
+ export interface BulkConfig {
2531
+ /**
2532
+ * Bulk tiers for rating based on total usage volume
2533
+ */
2534
+ tiers: Array<BulkConfig.Tier>;
2535
+ }
2536
+
2537
+ export namespace BulkConfig {
2538
+ export interface Tier {
2539
+ /**
2540
+ * Amount per unit
2541
+ */
2542
+ unit_amount: string;
2543
+
2544
+ /**
2545
+ * Upper bound for this tier
2546
+ */
2547
+ maximum_units?: number | null;
2548
+ }
2549
+ }
2550
+ }
2551
+
2552
+ export interface OverrideTestRatingFunctionPrice {
2553
+ id: string;
2554
+
2555
+ model_type: 'test_rating_function';
2556
+
2557
+ test_rating_function_config: Record<string, unknown>;
2558
+
2559
+ /**
2560
+ * The subscription's override discount for the plan.
2561
+ */
2562
+ discount?: PricesAPI.Discount | null;
2563
+
2564
+ /**
2565
+ * The starting quantity of the price, if the price is a fixed price.
2566
+ */
2567
+ fixed_price_quantity?: number | null;
2568
+
2569
+ /**
2570
+ * The subscription's override maximum amount for the plan.
2571
+ */
2572
+ maximum_amount?: string | null;
2573
+
2574
+ /**
2575
+ * The subscription's override minimum amount for the plan.
2576
+ */
2577
+ minimum_amount?: string | null;
2578
+ }
2579
+
2580
+ export interface OverrideFivetranExamplePrice {
2581
+ id: string;
2582
+
2583
+ fivetran_example_config: Record<string, unknown>;
2584
+
2585
+ model_type: 'fivetran_example';
2586
+
2587
+ /**
2588
+ * The subscription's override discount for the plan.
2589
+ */
2590
+ discount?: PricesAPI.Discount | null;
2591
+
2592
+ /**
2593
+ * The starting quantity of the price, if the price is a fixed price.
2594
+ */
2595
+ fixed_price_quantity?: number | null;
2596
+
2597
+ /**
2598
+ * The subscription's override maximum amount for the plan.
2599
+ */
2600
+ maximum_amount?: string | null;
2601
+
2602
+ /**
2603
+ * The subscription's override minimum amount for the plan.
2604
+ */
2605
+ minimum_amount?: string | null;
2606
+ }
2607
+
2608
+ export interface OverrideThresholdTotalAmountPrice {
2609
+ id: string;
2610
+
2611
+ model_type: 'threshold_total_amount';
2612
+
2613
+ threshold_total_amount_config: Record<string, unknown>;
2614
+
2615
+ /**
2616
+ * The subscription's override discount for the plan.
2617
+ */
2618
+ discount?: PricesAPI.Discount | null;
2619
+
2620
+ /**
2621
+ * The starting quantity of the price, if the price is a fixed price.
2622
+ */
2623
+ fixed_price_quantity?: number | null;
2624
+
2625
+ /**
2626
+ * The subscription's override maximum amount for the plan.
2627
+ */
2628
+ maximum_amount?: string | null;
2629
+
2630
+ /**
2631
+ * The subscription's override minimum amount for the plan.
2632
+ */
2633
+ minimum_amount?: string | null;
2634
+ }
2635
+
2636
+ export interface OverrideTieredPackagePrice {
2637
+ id: string;
2638
+
2639
+ model_type: 'tiered_package';
2640
+
2641
+ tiered_package_config: Record<string, unknown>;
2642
+
2643
+ /**
2644
+ * The subscription's override discount for the plan.
2645
+ */
2646
+ discount?: PricesAPI.Discount | null;
2647
+
2648
+ /**
2649
+ * The starting quantity of the price, if the price is a fixed price.
2650
+ */
2651
+ fixed_price_quantity?: number | null;
2652
+
2653
+ /**
2654
+ * The subscription's override maximum amount for the plan.
2655
+ */
2656
+ maximum_amount?: string | null;
2657
+
2658
+ /**
2659
+ * The subscription's override minimum amount for the plan.
2660
+ */
2661
+ minimum_amount?: string | null;
2662
+ }
2663
+
2664
+ export interface OverrideTieredWithMinimumPrice {
2665
+ id: string;
2666
+
2667
+ model_type: 'tiered_with_minimum';
2668
+
2669
+ tiered_with_minimum_config: Record<string, unknown>;
2670
+
2671
+ /**
2672
+ * The subscription's override discount for the plan.
2673
+ */
2674
+ discount?: PricesAPI.Discount | null;
2675
+
2676
+ /**
2677
+ * The starting quantity of the price, if the price is a fixed price.
2678
+ */
2679
+ fixed_price_quantity?: number | null;
2680
+
2681
+ /**
2682
+ * The subscription's override maximum amount for the plan.
2683
+ */
2684
+ maximum_amount?: string | null;
2685
+
2686
+ /**
2687
+ * The subscription's override minimum amount for the plan.
2688
+ */
2689
+ minimum_amount?: string | null;
2690
+ }
2691
+
2692
+ export interface OverridePackageWithAllocationPrice {
2693
+ id: string;
2694
+
2695
+ model_type: 'package_with_allocation';
2696
+
2697
+ package_with_allocation_config: Record<string, unknown>;
2698
+
2699
+ /**
2700
+ * The subscription's override discount for the plan.
2701
+ */
2702
+ discount?: PricesAPI.Discount | null;
2703
+
2704
+ /**
2705
+ * The starting quantity of the price, if the price is a fixed price.
2706
+ */
2707
+ fixed_price_quantity?: number | null;
2708
+
2709
+ /**
2710
+ * The subscription's override maximum amount for the plan.
2711
+ */
2712
+ maximum_amount?: string | null;
2713
+
2714
+ /**
2715
+ * The subscription's override minimum amount for the plan.
2716
+ */
2717
+ minimum_amount?: string | null;
2718
+ }
2719
+ }
2720
+
2721
+ export interface SubscriptionListParams extends PageParams {
2722
+ 'created_at[gt]'?: string | null;
2723
+
2724
+ 'created_at[gte]'?: string | null;
2725
+
2726
+ 'created_at[lt]'?: string | null;
2727
+
2728
+ 'created_at[lte]'?: string | null;
2729
+
2730
+ customer_id?: string | null;
2731
+
2732
+ external_customer_id?: string | null;
2733
+
2734
+ status?: 'active' | 'ended' | 'upcoming' | null;
2735
+ }
2736
+
2737
+ export interface SubscriptionCancelParams {
2738
+ /**
2739
+ * Determines the timing of subscription cancellation
2740
+ */
2741
+ cancel_option: 'end_of_subscription_term' | 'immediate' | 'requested_date';
2742
+
2743
+ /**
2744
+ * The date that the cancellation should take effect. This parameter can only be
2745
+ * passed if the `cancel_option` is `requested_date`.
2746
+ */
2747
+ cancellation_date?: string | null;
2748
+ }
2749
+
2750
+ export interface SubscriptionFetchCostsParams {
2751
+ /**
2752
+ * Groups per-price costs by the key provided.
2753
+ */
2754
+ group_by?: string | null;
2755
+
2756
+ /**
2757
+ * Costs returned are exclusive of `timeframe_end`.
2758
+ */
2759
+ timeframe_end?: string | null;
2760
+
2761
+ /**
2762
+ * Costs returned are inclusive of `timeframe_start`.
2763
+ */
2764
+ timeframe_start?: string | null;
2765
+
2766
+ /**
2767
+ * Controls whether Orb returns cumulative costs since the start of the billing
2768
+ * period, or incremental day-by-day costs. If your customer has minimums or
2769
+ * discounts, it's strongly recommended that you use the default cumulative
2770
+ * behavior.
2771
+ */
2772
+ view_mode?: 'periodic' | 'cumulative' | null;
2773
+ }
2774
+
2775
+ export interface SubscriptionFetchScheduleParams extends PageParams {
2776
+ 'start_date[gt]'?: string | null;
2777
+
2778
+ 'start_date[gte]'?: string | null;
2779
+
2780
+ 'start_date[lt]'?: string | null;
2781
+
2782
+ 'start_date[lte]'?: string | null;
2783
+ }
2784
+
2785
+ export interface SubscriptionFetchUsageParams {
2786
+ /**
2787
+ * When specified in conjunction with `group_by`, this parameter filters usage to a
2788
+ * single billable metric. Note that both `group_by` and `billable_metric_id` must
2789
+ * be specified together.
2790
+ */
2791
+ billable_metric_id?: string | null;
2792
+
2793
+ /**
2794
+ * Cursor for pagination. This can be populated by the `next_cursor` value returned
2795
+ * from the initial request.
2796
+ */
2797
+ cursor?: string | null;
2798
+
2799
+ first_dimension_key?: string | null;
2800
+
2801
+ first_dimension_value?: string | null;
2802
+
2803
+ /**
2804
+ * This determines the windowing of usage reporting.
2805
+ */
2806
+ granularity?: 'day' | null;
2807
+
2808
+ /**
2809
+ * Groups per-price usage by the key provided.
2810
+ */
2811
+ group_by?: string | null;
2812
+
2813
+ /**
2814
+ * If including a `group_by`, the number of groups to fetch data for. Defaults
2815
+ * to 1000.
2816
+ */
2817
+ limit?: number | null;
2818
+
2819
+ second_dimension_key?: string | null;
2820
+
2821
+ second_dimension_value?: string | null;
2822
+
2823
+ /**
2824
+ * Usage returned is exclusive of `timeframe_end`.
2825
+ */
2826
+ timeframe_end?: string | null;
2827
+
2828
+ /**
2829
+ * Usage returned is inclusive of `timeframe_start`.
2830
+ */
2831
+ timeframe_start?: string | null;
2832
+
2833
+ /**
2834
+ * Controls whether Orb returns cumulative usage since the start of the billing
2835
+ * period, or incremental day-by-day usage. If your customer has minimums or
2836
+ * discounts, it's strongly recommended that you use the default cumulative
2837
+ * behavior.
2838
+ */
2839
+ view_mode?: 'periodic' | 'cumulative' | null;
2840
+ }
2841
+
2842
+ export interface SubscriptionPriceIntervalsParams {
2843
+ /**
2844
+ * A list of price intervals to add to the subscription.
2845
+ */
2846
+ add?: Array<SubscriptionPriceIntervalsParams.Add>;
2847
+
2848
+ /**
2849
+ * A list of price intervals to edit on the subscription.
2850
+ */
2851
+ edit?: Array<SubscriptionPriceIntervalsParams.Edit>;
2852
+ }
2853
+
2854
+ export namespace SubscriptionPriceIntervalsParams {
2855
+ export interface Add {
2856
+ /**
2857
+ * The start date of the price interval. This is the date that the price will start
2858
+ * billing on the subscription.
2859
+ */
2860
+ start_date: (string & {}) | 'start_of_term' | 'end_of_term';
2861
+
2862
+ /**
2863
+ * A list of discounts to initialize on the price interval.
2864
+ */
2865
+ discounts?: Array<
2866
+ | Add.AmountDiscountCreationParams
2867
+ | Add.PercentageDiscountCreationParams
2868
+ | Add.UsageDiscountCreationParams
2869
+ > | null;
2870
+
2871
+ /**
2872
+ * The end date of the price interval. This is the date that the price will stop
2873
+ * billing on the subscription.
2874
+ */
2875
+ end_date?: (string & {}) | 'start_of_term' | 'end_of_term' | null;
2876
+
2877
+ /**
2878
+ * The external price id of the price to add to the subscription.
2879
+ */
2880
+ external_price_id?: string | null;
2881
+
2882
+ /**
2883
+ * A list of fixed fee quantity transitions to initialize on the price interval.
2884
+ */
2885
+ fixed_fee_quantity_transitions?: Array<Add.FixedFeeQuantityTransition> | null;
2886
+
2887
+ /**
2888
+ * The maximum amount that will be billed for this price interval for a given
2889
+ * billing period.
2890
+ */
2891
+ maximum_amount?: number | null;
2892
+
2893
+ /**
2894
+ * The minimum amount that will be billed for this price interval for a given
2895
+ * billing period.
2896
+ */
2897
+ minimum_amount?: number | null;
2898
+
2899
+ /**
2900
+ * The definition of a new price to create and add to the subscription.
2901
+ */
2902
+ price?:
2903
+ | Add.NewUnitPrice
2904
+ | Add.NewPackagePrice
2905
+ | Add.NewMatrixPrice
2906
+ | Add.NewTieredPrice
2907
+ | Add.NewTieredBpsPrice
2908
+ | Add.NewBpsPrice
2909
+ | Add.NewBulkBpsPrice
2910
+ | Add.NewBulkPrice
2911
+ | Add.NewThresholdTotalAmountPrice
2912
+ | Add.NewTieredPackagePrice
2913
+ | Add.NewTieredWithMinimumPrice
2914
+ | Add.NewPackageWithAllocationPrice
2915
+ | null;
2916
+
2917
+ /**
2918
+ * The id of the price to add to the subscription.
2919
+ */
2920
+ price_id?: string | null;
2921
+ }
2922
+
2923
+ export namespace Add {
2924
+ export interface AmountDiscountCreationParams {
2925
+ /**
2926
+ * Only available if discount_type is `amount`.
2927
+ */
2928
+ amount_discount: number;
2929
+
2930
+ discount_type: 'amount';
2931
+ }
2932
+
2933
+ export interface PercentageDiscountCreationParams {
2934
+ discount_type: 'percentage';
2935
+
2936
+ /**
2937
+ * Only available if discount_type is `percentage`. This is a number between 0
2938
+ * and 1.
2939
+ */
2940
+ percentage_discount: number;
2941
+ }
2942
+
2943
+ export interface UsageDiscountCreationParams {
2944
+ discount_type: 'usage';
2945
+
2946
+ /**
2947
+ * Only available if discount_type is `usage`. Number of usage units that this
2948
+ * discount is for.
2949
+ */
2950
+ usage_discount: number;
2951
+ }
2952
+
2953
+ export interface FixedFeeQuantityTransition {
2954
+ /**
2955
+ * The date that the fixed fee quantity transition should take effect.
2956
+ */
2957
+ effective_date: string;
2958
+
2959
+ /**
2960
+ * The quantity of the fixed fee quantity transition.
2961
+ */
2962
+ quantity: number;
2963
+ }
2964
+
2965
+ export interface NewUnitPrice {
2966
+ /**
2967
+ * The cadence to bill for this price on.
2968
+ */
2969
+ cadence: 'annual' | 'monthly' | 'quarterly';
2970
+
2971
+ /**
2972
+ * An ISO 4217 currency string for which this price is billed in.
2973
+ */
2974
+ currency: string;
2975
+
2976
+ /**
2977
+ * The id of the item the plan will be associated with.
2978
+ */
2979
+ item_id: string;
2980
+
2981
+ model_type: 'unit';
2982
+
2983
+ /**
2984
+ * The name of the price.
2985
+ */
2986
+ name: string;
2987
+
2988
+ unit_config: NewUnitPrice.UnitConfig;
2989
+
2990
+ /**
2991
+ * The id of the billable metric for the price. Only needed if the price is
2992
+ * usage-based.
2993
+ */
2994
+ billable_metric_id?: string | null;
2995
+
2996
+ /**
2997
+ * If the Price represents a fixed cost, the price will be billed in-advance if
2998
+ * this is true, and in-arrears if this is false.
2999
+ */
3000
+ billed_in_advance?: boolean | null;
3001
+
3002
+ /**
3003
+ * An alias for the price.
3004
+ */
3005
+ external_price_id?: string | null;
3006
+
3007
+ /**
3008
+ * If the Price represents a fixed cost, this represents the quantity of units
3009
+ * applied.
3010
+ */
3011
+ fixed_price_quantity?: number | null;
3012
+
3013
+ /**
3014
+ * The property used to group this price on an invoice
3015
+ */
3016
+ invoice_grouping_key?: string | null;
3017
+ }
3018
+
3019
+ export namespace NewUnitPrice {
3020
+ export interface UnitConfig {
3021
+ /**
3022
+ * Rate per unit of usage
3023
+ */
3024
+ unit_amount: string;
3025
+
3026
+ /**
3027
+ * Multiplier to scale rated quantity by
3028
+ */
3029
+ scaling_factor?: number | null;
3030
+ }
3031
+ }
3032
+
3033
+ export interface NewPackagePrice {
3034
+ /**
3035
+ * The cadence to bill for this price on.
3036
+ */
3037
+ cadence: 'annual' | 'monthly' | 'quarterly';
3038
+
3039
+ /**
3040
+ * An ISO 4217 currency string for which this price is billed in.
3041
+ */
3042
+ currency: string;
3043
+
3044
+ /**
3045
+ * The id of the item the plan will be associated with.
3046
+ */
3047
+ item_id: string;
3048
+
3049
+ model_type: 'package';
3050
+
3051
+ /**
3052
+ * The name of the price.
3053
+ */
3054
+ name: string;
3055
+
3056
+ package_config: NewPackagePrice.PackageConfig;
3057
+
3058
+ /**
3059
+ * The id of the billable metric for the price. Only needed if the price is
3060
+ * usage-based.
3061
+ */
3062
+ billable_metric_id?: string | null;
3063
+
3064
+ /**
3065
+ * If the Price represents a fixed cost, the price will be billed in-advance if
3066
+ * this is true, and in-arrears if this is false.
3067
+ */
3068
+ billed_in_advance?: boolean | null;
3069
+
3070
+ /**
3071
+ * An alias for the price.
3072
+ */
3073
+ external_price_id?: string | null;
3074
+
3075
+ /**
3076
+ * If the Price represents a fixed cost, this represents the quantity of units
3077
+ * applied.
3078
+ */
3079
+ fixed_price_quantity?: number | null;
3080
+
3081
+ /**
3082
+ * The property used to group this price on an invoice
3083
+ */
3084
+ invoice_grouping_key?: string | null;
3085
+ }
3086
+
3087
+ export namespace NewPackagePrice {
3088
+ export interface PackageConfig {
3089
+ /**
3090
+ * A currency amount to rate usage by
3091
+ */
3092
+ package_amount: string;
3093
+
3094
+ /**
3095
+ * An integer amount to represent package size. For example, 1000 here would divide
3096
+ * usage by 1000 before multiplying by package_amount in rating
3097
+ */
3098
+ package_size?: number | null;
3099
+ }
3100
+ }
3101
+
3102
+ export interface NewMatrixPrice {
3103
+ /**
3104
+ * The cadence to bill for this price on.
3105
+ */
3106
+ cadence: 'annual' | 'monthly' | 'quarterly';
3107
+
3108
+ /**
3109
+ * An ISO 4217 currency string for which this price is billed in.
3110
+ */
3111
+ currency: string;
3112
+
3113
+ /**
3114
+ * The id of the item the plan will be associated with.
3115
+ */
3116
+ item_id: string;
3117
+
3118
+ matrix_config: NewMatrixPrice.MatrixConfig;
3119
+
3120
+ model_type: 'matrix';
3121
+
3122
+ /**
3123
+ * The name of the price.
3124
+ */
3125
+ name: string;
3126
+
3127
+ /**
3128
+ * The id of the billable metric for the price. Only needed if the price is
3129
+ * usage-based.
3130
+ */
3131
+ billable_metric_id?: string | null;
3132
+
3133
+ /**
3134
+ * If the Price represents a fixed cost, the price will be billed in-advance if
3135
+ * this is true, and in-arrears if this is false.
3136
+ */
3137
+ billed_in_advance?: boolean | null;
3138
+
3139
+ /**
3140
+ * An alias for the price.
3141
+ */
3142
+ external_price_id?: string | null;
3143
+
3144
+ /**
3145
+ * If the Price represents a fixed cost, this represents the quantity of units
3146
+ * applied.
3147
+ */
3148
+ fixed_price_quantity?: number | null;
3149
+
3150
+ /**
3151
+ * The property used to group this price on an invoice
3152
+ */
3153
+ invoice_grouping_key?: string | null;
3154
+ }
3155
+
3156
+ export namespace NewMatrixPrice {
3157
+ export interface MatrixConfig {
3158
+ /**
3159
+ * Default per unit rate for any usage not bucketed into a specified matrix_value
3160
+ */
3161
+ default_unit_amount: string;
3162
+
3163
+ /**
3164
+ * One or two event property values to evaluate matrix groups by
3165
+ */
3166
+ dimensions: Array<string | null>;
3167
+
3168
+ /**
3169
+ * Matrix values for specified matrix grouping keys
3170
+ */
3171
+ matrix_values: Array<MatrixConfig.MatrixValue>;
3172
+
3173
+ /**
3174
+ * Default optional multiplier to scale rated quantities that fall into the default
3175
+ * bucket by
3176
+ */
3177
+ scaling_factor?: number | null;
3178
+ }
3179
+
3180
+ export namespace MatrixConfig {
3181
+ export interface MatrixValue {
3182
+ /**
3183
+ * One or two matrix keys to filter usage to this Matrix value by. For example,
3184
+ * ["region", "tier"] could be used to filter cloud usage by a cloud region and an
3185
+ * instance tier.
3186
+ */
3187
+ dimension_values: Array<string | null>;
3188
+
3189
+ /**
3190
+ * Unit price for the specified dimension_values
3191
+ */
3192
+ unit_amount: string;
3193
+
3194
+ /**
3195
+ * Optional multiplier to scale rated quantities by
3196
+ */
3197
+ scaling_factor?: number | null;
3198
+ }
3199
+ }
3200
+ }
3201
+
3202
+ export interface NewTieredPrice {
3203
+ /**
3204
+ * The cadence to bill for this price on.
3205
+ */
3206
+ cadence: 'annual' | 'monthly' | 'quarterly';
3207
+
3208
+ /**
3209
+ * An ISO 4217 currency string for which this price is billed in.
3210
+ */
3211
+ currency: string;
3212
+
3213
+ /**
3214
+ * The id of the item the plan will be associated with.
3215
+ */
3216
+ item_id: string;
3217
+
3218
+ model_type: 'tiered';
3219
+
3220
+ /**
3221
+ * The name of the price.
3222
+ */
3223
+ name: string;
3224
+
3225
+ tiered_config: NewTieredPrice.TieredConfig;
3226
+
3227
+ /**
3228
+ * The id of the billable metric for the price. Only needed if the price is
3229
+ * usage-based.
3230
+ */
3231
+ billable_metric_id?: string | null;
3232
+
3233
+ /**
3234
+ * If the Price represents a fixed cost, the price will be billed in-advance if
3235
+ * this is true, and in-arrears if this is false.
3236
+ */
3237
+ billed_in_advance?: boolean | null;
3238
+
3239
+ /**
3240
+ * An alias for the price.
3241
+ */
3242
+ external_price_id?: string | null;
3243
+
3244
+ /**
3245
+ * If the Price represents a fixed cost, this represents the quantity of units
3246
+ * applied.
3247
+ */
3248
+ fixed_price_quantity?: number | null;
3249
+
3250
+ /**
3251
+ * The property used to group this price on an invoice
3252
+ */
3253
+ invoice_grouping_key?: string | null;
3254
+ }
3255
+
3256
+ export namespace NewTieredPrice {
3257
+ export interface TieredConfig {
3258
+ /**
3259
+ * Tiers for rating based on total usage quantities into the specified tier
3260
+ */
3261
+ tiers: Array<TieredConfig.Tier>;
3262
+ }
3263
+
3264
+ export namespace TieredConfig {
3265
+ export interface Tier {
3266
+ /**
3267
+ * Inclusive tier starting value
3268
+ */
3269
+ first_unit: number;
3270
+
3271
+ /**
3272
+ * Amount per unit
3273
+ */
3274
+ unit_amount: string;
3275
+
3276
+ /**
3277
+ * Exclusive tier ending value. If null, this is treated as the last tier
3278
+ */
3279
+ last_unit?: number | null;
3280
+ }
3281
+ }
3282
+ }
3283
+
3284
+ export interface NewTieredBpsPrice {
3285
+ /**
3286
+ * The cadence to bill for this price on.
3287
+ */
3288
+ cadence: 'annual' | 'monthly' | 'quarterly';
3289
+
3290
+ /**
3291
+ * An ISO 4217 currency string for which this price is billed in.
3292
+ */
3293
+ currency: string;
3294
+
3295
+ /**
3296
+ * The id of the item the plan will be associated with.
3297
+ */
3298
+ item_id: string;
3299
+
3300
+ model_type: 'tiered_bps';
3301
+
3302
+ /**
3303
+ * The name of the price.
3304
+ */
3305
+ name: string;
3306
+
3307
+ tiered_bps_config: NewTieredBpsPrice.TieredBpsConfig;
3308
+
3309
+ /**
3310
+ * The id of the billable metric for the price. Only needed if the price is
3311
+ * usage-based.
3312
+ */
3313
+ billable_metric_id?: string | null;
3314
+
3315
+ /**
3316
+ * If the Price represents a fixed cost, the price will be billed in-advance if
3317
+ * this is true, and in-arrears if this is false.
3318
+ */
3319
+ billed_in_advance?: boolean | null;
3320
+
3321
+ /**
3322
+ * An alias for the price.
3323
+ */
3324
+ external_price_id?: string | null;
3325
+
3326
+ /**
3327
+ * If the Price represents a fixed cost, this represents the quantity of units
3328
+ * applied.
3329
+ */
3330
+ fixed_price_quantity?: number | null;
3331
+
3332
+ /**
3333
+ * The property used to group this price on an invoice
3334
+ */
3335
+ invoice_grouping_key?: string | null;
3336
+ }
3337
+
3338
+ export namespace NewTieredBpsPrice {
3339
+ export interface TieredBpsConfig {
3340
+ /**
3341
+ * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
3342
+ * tiers
3343
+ */
3344
+ tiers: Array<TieredBpsConfig.Tier>;
3345
+ }
3346
+
3347
+ export namespace TieredBpsConfig {
3348
+ export interface Tier {
3349
+ /**
3350
+ * Per-event basis point rate
3351
+ */
3352
+ bps: number;
3353
+
3354
+ /**
3355
+ * Inclusive tier starting value
3356
+ */
3357
+ minimum_amount: string;
3358
+
3359
+ /**
3360
+ * Exclusive tier ending value
3361
+ */
3362
+ maximum_amount?: string | null;
3363
+
3364
+ /**
3365
+ * Per unit maximum to charge
3366
+ */
3367
+ per_unit_maximum?: string | null;
3368
+ }
3369
+ }
3370
+ }
3371
+
3372
+ export interface NewBpsPrice {
3373
+ bps_config: NewBpsPrice.BpsConfig;
3374
+
3375
+ /**
3376
+ * The cadence to bill for this price on.
3377
+ */
3378
+ cadence: 'annual' | 'monthly' | 'quarterly';
3379
+
3380
+ /**
3381
+ * An ISO 4217 currency string for which this price is billed in.
3382
+ */
3383
+ currency: string;
3384
+
3385
+ /**
3386
+ * The id of the item the plan will be associated with.
3387
+ */
3388
+ item_id: string;
3389
+
3390
+ model_type: 'bps';
3391
+
3392
+ /**
3393
+ * The name of the price.
3394
+ */
3395
+ name: string;
3396
+
3397
+ /**
3398
+ * The id of the billable metric for the price. Only needed if the price is
3399
+ * usage-based.
3400
+ */
3401
+ billable_metric_id?: string | null;
3402
+
3403
+ /**
3404
+ * If the Price represents a fixed cost, the price will be billed in-advance if
3405
+ * this is true, and in-arrears if this is false.
3406
+ */
3407
+ billed_in_advance?: boolean | null;
3408
+
3409
+ /**
3410
+ * An alias for the price.
3411
+ */
3412
+ external_price_id?: string | null;
3413
+
3414
+ /**
3415
+ * If the Price represents a fixed cost, this represents the quantity of units
3416
+ * applied.
3417
+ */
3418
+ fixed_price_quantity?: number | null;
3419
+
3420
+ /**
3421
+ * The property used to group this price on an invoice
3422
+ */
3423
+ invoice_grouping_key?: string | null;
3424
+ }
3425
+
3426
+ export namespace NewBpsPrice {
3427
+ export interface BpsConfig {
3428
+ /**
3429
+ * Basis point take rate per event
3430
+ */
3431
+ bps: number;
3432
+
3433
+ /**
3434
+ * Optional currency amount maximum to cap spend per event
3435
+ */
3436
+ per_unit_maximum?: string | null;
3437
+ }
3438
+ }
3439
+
3440
+ export interface NewBulkBpsPrice {
3441
+ bulk_bps_config: NewBulkBpsPrice.BulkBpsConfig;
3442
+
3443
+ /**
3444
+ * The cadence to bill for this price on.
3445
+ */
3446
+ cadence: 'annual' | 'monthly' | 'quarterly';
3447
+
3448
+ /**
3449
+ * An ISO 4217 currency string for which this price is billed in.
3450
+ */
3451
+ currency: string;
3452
+
3453
+ /**
3454
+ * The id of the item the plan will be associated with.
3455
+ */
3456
+ item_id: string;
3457
+
3458
+ model_type: 'bulk_bps';
3459
+
3460
+ /**
3461
+ * The name of the price.
3462
+ */
3463
+ name: string;
3464
+
3465
+ /**
3466
+ * The id of the billable metric for the price. Only needed if the price is
3467
+ * usage-based.
3468
+ */
3469
+ billable_metric_id?: string | null;
3470
+
3471
+ /**
3472
+ * If the Price represents a fixed cost, the price will be billed in-advance if
3473
+ * this is true, and in-arrears if this is false.
3474
+ */
3475
+ billed_in_advance?: boolean | null;
3476
+
3477
+ /**
3478
+ * An alias for the price.
3479
+ */
3480
+ external_price_id?: string | null;
3481
+
3482
+ /**
3483
+ * If the Price represents a fixed cost, this represents the quantity of units
3484
+ * applied.
3485
+ */
3486
+ fixed_price_quantity?: number | null;
3487
+
3488
+ /**
3489
+ * The property used to group this price on an invoice
3490
+ */
3491
+ invoice_grouping_key?: string | null;
3492
+ }
3493
+
3494
+ export namespace NewBulkBpsPrice {
3495
+ export interface BulkBpsConfig {
3496
+ /**
3497
+ * Tiers for a bulk BPS pricing model where all usage is aggregated to a single
3498
+ * tier based on total volume
3499
+ */
3500
+ tiers: Array<BulkBpsConfig.Tier>;
3501
+ }
3502
+
3503
+ export namespace BulkBpsConfig {
3504
+ export interface Tier {
3505
+ /**
3506
+ * Basis points to rate on
3507
+ */
3508
+ bps: number;
3509
+
3510
+ /**
3511
+ * Upper bound for tier
3512
+ */
3513
+ maximum_amount?: string | null;
3514
+
3515
+ /**
3516
+ * The maximum amount to charge for any one event
3517
+ */
3518
+ per_unit_maximum?: string | null;
3519
+ }
3520
+ }
3521
+ }
3522
+
3523
+ export interface NewBulkPrice {
3524
+ bulk_config: NewBulkPrice.BulkConfig;
3525
+
3526
+ /**
3527
+ * The cadence to bill for this price on.
3528
+ */
3529
+ cadence: 'annual' | 'monthly' | 'quarterly';
3530
+
3531
+ /**
3532
+ * An ISO 4217 currency string for which this price is billed in.
3533
+ */
3534
+ currency: string;
3535
+
3536
+ /**
3537
+ * The id of the item the plan will be associated with.
3538
+ */
3539
+ item_id: string;
3540
+
3541
+ model_type: 'bulk';
3542
+
3543
+ /**
3544
+ * The name of the price.
3545
+ */
3546
+ name: string;
3547
+
3548
+ /**
3549
+ * The id of the billable metric for the price. Only needed if the price is
3550
+ * usage-based.
3551
+ */
3552
+ billable_metric_id?: string | null;
3553
+
3554
+ /**
3555
+ * If the Price represents a fixed cost, the price will be billed in-advance if
3556
+ * this is true, and in-arrears if this is false.
3557
+ */
3558
+ billed_in_advance?: boolean | null;
3559
+
3560
+ /**
3561
+ * An alias for the price.
3562
+ */
3563
+ external_price_id?: string | null;
3564
+
3565
+ /**
3566
+ * If the Price represents a fixed cost, this represents the quantity of units
3567
+ * applied.
3568
+ */
3569
+ fixed_price_quantity?: number | null;
3570
+
3571
+ /**
3572
+ * The property used to group this price on an invoice
3573
+ */
3574
+ invoice_grouping_key?: string | null;
3575
+ }
3576
+
3577
+ export namespace NewBulkPrice {
3578
+ export interface BulkConfig {
3579
+ /**
3580
+ * Bulk tiers for rating based on total usage volume
3581
+ */
3582
+ tiers: Array<BulkConfig.Tier>;
3583
+ }
3584
+
3585
+ export namespace BulkConfig {
3586
+ export interface Tier {
3587
+ /**
3588
+ * Amount per unit
3589
+ */
3590
+ unit_amount: string;
3591
+
3592
+ /**
3593
+ * Upper bound for this tier
3594
+ */
3595
+ maximum_units?: number | null;
3596
+ }
3597
+ }
3598
+ }
3599
+
3600
+ export interface NewThresholdTotalAmountPrice {
3601
+ /**
3602
+ * The cadence to bill for this price on.
3603
+ */
3604
+ cadence: 'annual' | 'monthly' | 'quarterly';
3605
+
3606
+ /**
3607
+ * An ISO 4217 currency string for which this price is billed in.
3608
+ */
3609
+ currency: string;
3610
+
3611
+ /**
3612
+ * The id of the item the plan will be associated with.
3613
+ */
3614
+ item_id: string;
3615
+
3616
+ model_type: 'threshold_total_amount';
3617
+
3618
+ /**
3619
+ * The name of the price.
3620
+ */
3621
+ name: string;
3622
+
3623
+ threshold_total_amount_config: Record<string, unknown>;
3624
+
3625
+ /**
3626
+ * The id of the billable metric for the price. Only needed if the price is
3627
+ * usage-based.
3628
+ */
3629
+ billable_metric_id?: string | null;
3630
+
3631
+ /**
3632
+ * If the Price represents a fixed cost, the price will be billed in-advance if
3633
+ * this is true, and in-arrears if this is false.
3634
+ */
3635
+ billed_in_advance?: boolean | null;
3636
+
3637
+ /**
3638
+ * An alias for the price.
3639
+ */
3640
+ external_price_id?: string | null;
3641
+
3642
+ /**
3643
+ * If the Price represents a fixed cost, this represents the quantity of units
3644
+ * applied.
3645
+ */
3646
+ fixed_price_quantity?: number | null;
3647
+
3648
+ /**
3649
+ * The property used to group this price on an invoice
3650
+ */
3651
+ invoice_grouping_key?: string | null;
3652
+ }
3653
+
3654
+ export interface NewTieredPackagePrice {
3655
+ /**
3656
+ * The cadence to bill for this price on.
3657
+ */
3658
+ cadence: 'annual' | 'monthly' | 'quarterly';
3659
+
3660
+ /**
3661
+ * An ISO 4217 currency string for which this price is billed in.
3662
+ */
3663
+ currency: string;
3664
+
3665
+ /**
3666
+ * The id of the item the plan will be associated with.
3667
+ */
3668
+ item_id: string;
3669
+
3670
+ model_type: 'tiered_package';
3671
+
3672
+ /**
3673
+ * The name of the price.
3674
+ */
3675
+ name: string;
3676
+
3677
+ tiered_package_config: Record<string, unknown>;
3678
+
3679
+ /**
3680
+ * The id of the billable metric for the price. Only needed if the price is
3681
+ * usage-based.
3682
+ */
3683
+ billable_metric_id?: string | null;
3684
+
3685
+ /**
3686
+ * If the Price represents a fixed cost, the price will be billed in-advance if
3687
+ * this is true, and in-arrears if this is false.
3688
+ */
3689
+ billed_in_advance?: boolean | null;
3690
+
3691
+ /**
3692
+ * An alias for the price.
3693
+ */
3694
+ external_price_id?: string | null;
3695
+
3696
+ /**
3697
+ * If the Price represents a fixed cost, this represents the quantity of units
3698
+ * applied.
3699
+ */
3700
+ fixed_price_quantity?: number | null;
3701
+
3702
+ /**
3703
+ * The property used to group this price on an invoice
3704
+ */
3705
+ invoice_grouping_key?: string | null;
3706
+ }
3707
+
3708
+ export interface NewTieredWithMinimumPrice {
3709
+ /**
3710
+ * The cadence to bill for this price on.
3711
+ */
3712
+ cadence: 'annual' | 'monthly' | 'quarterly';
3713
+
3714
+ /**
3715
+ * An ISO 4217 currency string for which this price is billed in.
3716
+ */
3717
+ currency: string;
3718
+
3719
+ /**
3720
+ * The id of the item the plan will be associated with.
3721
+ */
3722
+ item_id: string;
3723
+
3724
+ model_type: 'tiered_with_minimum';
3725
+
3726
+ /**
3727
+ * The name of the price.
3728
+ */
3729
+ name: string;
3730
+
3731
+ tiered_with_minimum_config: Record<string, unknown>;
3732
+
3733
+ /**
3734
+ * The id of the billable metric for the price. Only needed if the price is
3735
+ * usage-based.
3736
+ */
3737
+ billable_metric_id?: string | null;
3738
+
3739
+ /**
3740
+ * If the Price represents a fixed cost, the price will be billed in-advance if
3741
+ * this is true, and in-arrears if this is false.
3742
+ */
3743
+ billed_in_advance?: boolean | null;
3744
+
3745
+ /**
3746
+ * An alias for the price.
3747
+ */
3748
+ external_price_id?: string | null;
3749
+
3750
+ /**
3751
+ * If the Price represents a fixed cost, this represents the quantity of units
3752
+ * applied.
3753
+ */
3754
+ fixed_price_quantity?: number | null;
3755
+
3756
+ /**
3757
+ * The property used to group this price on an invoice
3758
+ */
3759
+ invoice_grouping_key?: string | null;
3760
+ }
3761
+
3762
+ export interface NewPackageWithAllocationPrice {
3763
+ /**
3764
+ * The cadence to bill for this price on.
3765
+ */
3766
+ cadence: 'annual' | 'monthly' | 'quarterly';
3767
+
3768
+ /**
3769
+ * An ISO 4217 currency string for which this price is billed in.
3770
+ */
3771
+ currency: string;
3772
+
3773
+ /**
3774
+ * The id of the item the plan will be associated with.
3775
+ */
3776
+ item_id: string;
3777
+
3778
+ model_type: 'package_with_allocation';
3779
+
3780
+ /**
3781
+ * The name of the price.
3782
+ */
3783
+ name: string;
3784
+
3785
+ package_with_allocation_config: Record<string, unknown>;
3786
+
3787
+ /**
3788
+ * The id of the billable metric for the price. Only needed if the price is
3789
+ * usage-based.
3790
+ */
3791
+ billable_metric_id?: string | null;
3792
+
3793
+ /**
3794
+ * If the Price represents a fixed cost, the price will be billed in-advance if
3795
+ * this is true, and in-arrears if this is false.
3796
+ */
3797
+ billed_in_advance?: boolean | null;
3798
+
3799
+ /**
3800
+ * An alias for the price.
3801
+ */
3802
+ external_price_id?: string | null;
3803
+
3804
+ /**
3805
+ * If the Price represents a fixed cost, this represents the quantity of units
3806
+ * applied.
3807
+ */
3808
+ fixed_price_quantity?: number | null;
3809
+
3810
+ /**
3811
+ * The property used to group this price on an invoice
3812
+ */
3813
+ invoice_grouping_key?: string | null;
3814
+ }
3815
+ }
3816
+
3817
+ export interface Edit {
3818
+ /**
3819
+ * The id of the price interval to edit.
3820
+ */
3821
+ price_interval_id: string;
3822
+
3823
+ /**
3824
+ * The updated end date of this price interval. If not specified, the start date
3825
+ * will not be updated.
3826
+ */
3827
+ end_date?: (string & {}) | 'start_of_term' | 'end_of_term' | null;
3828
+
3829
+ /**
3830
+ * A list of fixed fee quantity transitions to use for this price interval. Note
3831
+ * that this list will overwrite all existing fixed fee quantity transitions on the
3832
+ * price interval.
3833
+ */
3834
+ fixed_fee_quantity_transitions?: Array<Edit.FixedFeeQuantityTransition> | null;
3835
+
3836
+ /**
3837
+ * The updated start date of this price interval. If not specified, the start date
3838
+ * will not be updated.
3839
+ */
3840
+ start_date?: (string & {}) | 'start_of_term' | 'end_of_term' | null;
3841
+ }
3842
+
3843
+ export namespace Edit {
3844
+ export interface FixedFeeQuantityTransition {
3845
+ /**
3846
+ * The date that the fixed fee quantity transition should take effect.
3847
+ */
3848
+ effective_date: string;
3849
+
3850
+ /**
3851
+ * The quantity of the fixed fee quantity transition.
3852
+ */
3853
+ quantity: number;
3854
+ }
3855
+ }
3856
+ }
3857
+
3858
+ export interface SubscriptionSchedulePlanChangeParams {
3859
+ change_option: 'requested_date' | 'end_of_subscription_term' | 'immediate';
3860
+
3861
+ /**
3862
+ * [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be
3863
+ * aligned with the plan change’s effective date.
3864
+ */
3865
+ align_billing_with_plan_change_date?: boolean | null;
3866
+
3867
+ /**
3868
+ * Reset billing periods to be aligned with the plan change’s effective date or
3869
+ * start of the month. Defaults to `unchanged` which keeps subscription's existing
3870
+ * billing cycle alignment.
3871
+ */
3872
+ billing_cycle_alignment?: 'unchanged' | 'plan_change_date' | 'start_of_month' | null;
3873
+
3874
+ /**
3875
+ * The date that the plan change should take effect. This parameter can only be
3876
+ * passed if the `change_option` is `requested_date`.
3877
+ */
3878
+ change_date?: string | null;
3879
+
3880
+ /**
3881
+ * Redemption code to be used for this subscription. If the coupon cannot be found
3882
+ * by its redemption code, or cannot be redeemed, an error response will be
3883
+ * returned and the plan change will not be scheduled.
3884
+ */
3885
+ coupon_redemption_code?: string | null;
3886
+
3887
+ credits_overage_rate?: number | null;
3888
+
3889
+ /**
3890
+ * The external_plan_id of the plan that the given subscription should be switched
3891
+ * to. Note that either this property or `plan_id` must be specified.
3892
+ */
3893
+ external_plan_id?: string | null;
3894
+
3895
+ /**
3896
+ * The phase of the plan to start with
3897
+ */
3898
+ initial_phase_order?: number | null;
3899
+
3900
+ /**
3901
+ * When this subscription's accrued usage reaches this threshold, an invoice will
3902
+ * be issued for the subscription. If not specified, invoices will only be issued
3903
+ * at the end of the billing period.
3904
+ */
3905
+ invoicing_threshold?: string | null;
3906
+
3907
+ per_credit_overage_amount?: string | null;
3908
+
3909
+ /**
3910
+ * The plan that the given subscription should be switched to. Note that either
3911
+ * this property or `external_plan_id` must be specified.
3912
+ */
3913
+ plan_id?: string | null;
3914
+
3915
+ /**
3916
+ * Optionally provide a list of overrides for prices on the plan
3917
+ */
3918
+ price_overrides?: Array<
3919
+ | SubscriptionSchedulePlanChangeParams.OverrideUnitPrice
3920
+ | SubscriptionSchedulePlanChangeParams.OverridePackagePrice
3921
+ | SubscriptionSchedulePlanChangeParams.OverrideMatrixPrice
3922
+ | SubscriptionSchedulePlanChangeParams.OverrideTieredPrice
3923
+ | SubscriptionSchedulePlanChangeParams.OverrideTieredBpsPrice
3924
+ | SubscriptionSchedulePlanChangeParams.OverrideBpsPrice
3925
+ | SubscriptionSchedulePlanChangeParams.OverrideBulkBpsPrice
3926
+ | SubscriptionSchedulePlanChangeParams.OverrideBulkPrice
3927
+ | SubscriptionSchedulePlanChangeParams.OverrideTestRatingFunctionPrice
3928
+ | SubscriptionSchedulePlanChangeParams.OverrideFivetranExamplePrice
3929
+ | SubscriptionSchedulePlanChangeParams.OverrideThresholdTotalAmountPrice
3930
+ | SubscriptionSchedulePlanChangeParams.OverrideTieredPackagePrice
3931
+ | SubscriptionSchedulePlanChangeParams.OverrideTieredWithMinimumPrice
3932
+ | SubscriptionSchedulePlanChangeParams.OverridePackageWithAllocationPrice
3933
+ > | null;
3934
+ }
3935
+
3936
+ export namespace SubscriptionSchedulePlanChangeParams {
3937
+ export interface OverrideUnitPrice {
3938
+ id: string;
3939
+
3940
+ model_type: 'unit';
3941
+
3942
+ unit_config: OverrideUnitPrice.UnitConfig;
3943
+
3944
+ /**
3945
+ * The subscription's override discount for the plan.
3946
+ */
3947
+ discount?: PricesAPI.Discount | null;
3948
+
3949
+ /**
3950
+ * The starting quantity of the price, if the price is a fixed price.
3951
+ */
3952
+ fixed_price_quantity?: number | null;
3953
+
3954
+ /**
3955
+ * The subscription's override maximum amount for the plan.
3956
+ */
3957
+ maximum_amount?: string | null;
3958
+
3959
+ /**
3960
+ * The subscription's override minimum amount for the plan.
3961
+ */
3962
+ minimum_amount?: string | null;
3963
+ }
3964
+
3965
+ export namespace OverrideUnitPrice {
3966
+ export interface UnitConfig {
3967
+ /**
3968
+ * Rate per unit of usage
3969
+ */
3970
+ unit_amount: string;
3971
+
3972
+ /**
3973
+ * Multiplier to scale rated quantity by
3974
+ */
3975
+ scaling_factor?: number | null;
3976
+ }
3977
+ }
3978
+
3979
+ export interface OverridePackagePrice {
3980
+ id: string;
3981
+
3982
+ model_type: 'package';
3983
+
3984
+ package_config: OverridePackagePrice.PackageConfig;
3985
+
3986
+ /**
3987
+ * The subscription's override discount for the plan.
3988
+ */
3989
+ discount?: PricesAPI.Discount | null;
3990
+
3991
+ /**
3992
+ * The starting quantity of the price, if the price is a fixed price.
3993
+ */
3994
+ fixed_price_quantity?: number | null;
3995
+
3996
+ /**
3997
+ * The subscription's override maximum amount for the plan.
3998
+ */
3999
+ maximum_amount?: string | null;
4000
+
4001
+ /**
4002
+ * The subscription's override minimum amount for the plan.
4003
+ */
4004
+ minimum_amount?: string | null;
4005
+ }
4006
+
4007
+ export namespace OverridePackagePrice {
4008
+ export interface PackageConfig {
4009
+ /**
4010
+ * A currency amount to rate usage by
4011
+ */
4012
+ package_amount: string;
4013
+
4014
+ /**
4015
+ * An integer amount to represent package size. For example, 1000 here would divide
4016
+ * usage by 1000 before multiplying by package_amount in rating
4017
+ */
4018
+ package_size?: number | null;
4019
+ }
4020
+ }
4021
+
4022
+ export interface OverrideMatrixPrice {
4023
+ id: string;
4024
+
4025
+ matrix_config: OverrideMatrixPrice.MatrixConfig;
4026
+
4027
+ model_type: 'matrix';
4028
+
4029
+ /**
4030
+ * The subscription's override discount for the plan.
4031
+ */
4032
+ discount?: PricesAPI.Discount | null;
4033
+
4034
+ /**
4035
+ * The starting quantity of the price, if the price is a fixed price.
4036
+ */
4037
+ fixed_price_quantity?: number | null;
4038
+
4039
+ /**
4040
+ * The subscription's override maximum amount for the plan.
4041
+ */
4042
+ maximum_amount?: string | null;
4043
+
4044
+ /**
4045
+ * The subscription's override minimum amount for the plan.
4046
+ */
4047
+ minimum_amount?: string | null;
4048
+ }
4049
+
4050
+ export namespace OverrideMatrixPrice {
4051
+ export interface MatrixConfig {
4052
+ /**
4053
+ * Default per unit rate for any usage not bucketed into a specified matrix_value
4054
+ */
4055
+ default_unit_amount: string;
4056
+
4057
+ /**
4058
+ * One or two event property values to evaluate matrix groups by
4059
+ */
4060
+ dimensions: Array<string | null>;
4061
+
4062
+ /**
4063
+ * Matrix values for specified matrix grouping keys
4064
+ */
4065
+ matrix_values: Array<MatrixConfig.MatrixValue>;
4066
+
4067
+ /**
4068
+ * Default optional multiplier to scale rated quantities that fall into the default
4069
+ * bucket by
4070
+ */
4071
+ scaling_factor?: number | null;
4072
+ }
4073
+
4074
+ export namespace MatrixConfig {
4075
+ export interface MatrixValue {
4076
+ /**
4077
+ * One or two matrix keys to filter usage to this Matrix value by. For example,
4078
+ * ["region", "tier"] could be used to filter cloud usage by a cloud region and an
4079
+ * instance tier.
4080
+ */
4081
+ dimension_values: Array<string | null>;
4082
+
4083
+ /**
4084
+ * Unit price for the specified dimension_values
4085
+ */
4086
+ unit_amount: string;
4087
+
4088
+ /**
4089
+ * Optional multiplier to scale rated quantities by
4090
+ */
4091
+ scaling_factor?: number | null;
4092
+ }
4093
+ }
4094
+ }
4095
+
4096
+ export interface OverrideTieredPrice {
4097
+ id: string;
4098
+
4099
+ model_type: 'tiered';
4100
+
4101
+ tiered_config: OverrideTieredPrice.TieredConfig;
4102
+
4103
+ /**
4104
+ * The subscription's override discount for the plan.
4105
+ */
4106
+ discount?: PricesAPI.Discount | null;
4107
+
4108
+ /**
4109
+ * The starting quantity of the price, if the price is a fixed price.
4110
+ */
4111
+ fixed_price_quantity?: number | null;
4112
+
4113
+ /**
4114
+ * The subscription's override maximum amount for the plan.
4115
+ */
4116
+ maximum_amount?: string | null;
4117
+
4118
+ /**
4119
+ * The subscription's override minimum amount for the plan.
4120
+ */
4121
+ minimum_amount?: string | null;
4122
+ }
4123
+
4124
+ export namespace OverrideTieredPrice {
4125
+ export interface TieredConfig {
4126
+ /**
4127
+ * Tiers for rating based on total usage quantities into the specified tier
4128
+ */
4129
+ tiers: Array<TieredConfig.Tier>;
4130
+ }
4131
+
4132
+ export namespace TieredConfig {
4133
+ export interface Tier {
4134
+ /**
4135
+ * Inclusive tier starting value
4136
+ */
4137
+ first_unit: number;
4138
+
4139
+ /**
4140
+ * Amount per unit
4141
+ */
4142
+ unit_amount: string;
4143
+
4144
+ /**
4145
+ * Exclusive tier ending value. If null, this is treated as the last tier
4146
+ */
4147
+ last_unit?: number | null;
4148
+ }
4149
+ }
4150
+ }
4151
+
4152
+ export interface OverrideTieredBpsPrice {
4153
+ id: string;
4154
+
4155
+ model_type: 'tiered_bps';
4156
+
4157
+ tiered_bps_config: OverrideTieredBpsPrice.TieredBpsConfig;
4158
+
4159
+ /**
4160
+ * The subscription's override discount for the plan.
4161
+ */
4162
+ discount?: PricesAPI.Discount | null;
4163
+
4164
+ /**
4165
+ * The starting quantity of the price, if the price is a fixed price.
4166
+ */
4167
+ fixed_price_quantity?: number | null;
4168
+
4169
+ /**
4170
+ * The subscription's override maximum amount for the plan.
4171
+ */
4172
+ maximum_amount?: string | null;
4173
+
4174
+ /**
4175
+ * The subscription's override minimum amount for the plan.
4176
+ */
4177
+ minimum_amount?: string | null;
4178
+ }
4179
+
4180
+ export namespace OverrideTieredBpsPrice {
4181
+ export interface TieredBpsConfig {
4182
+ /**
4183
+ * Tiers for a Graduated BPS pricing model, where usage is bucketed into specified
4184
+ * tiers
4185
+ */
4186
+ tiers: Array<TieredBpsConfig.Tier>;
4187
+ }
4188
+
4189
+ export namespace TieredBpsConfig {
4190
+ export interface Tier {
4191
+ /**
4192
+ * Per-event basis point rate
4193
+ */
4194
+ bps: number;
4195
+
4196
+ /**
4197
+ * Inclusive tier starting value
4198
+ */
4199
+ minimum_amount: string;
4200
+
4201
+ /**
4202
+ * Exclusive tier ending value
4203
+ */
4204
+ maximum_amount?: string | null;
4205
+
4206
+ /**
4207
+ * Per unit maximum to charge
4208
+ */
4209
+ per_unit_maximum?: string | null;
4210
+ }
4211
+ }
4212
+ }
4213
+
4214
+ export interface OverrideBpsPrice {
4215
+ id: string;
4216
+
4217
+ bps_config: OverrideBpsPrice.BpsConfig;
4218
+
4219
+ model_type: 'bps';
4220
+
4221
+ /**
4222
+ * The subscription's override discount for the plan.
4223
+ */
4224
+ discount?: PricesAPI.Discount | null;
4225
+
4226
+ /**
4227
+ * The starting quantity of the price, if the price is a fixed price.
4228
+ */
4229
+ fixed_price_quantity?: number | null;
4230
+
4231
+ /**
4232
+ * The subscription's override maximum amount for the plan.
4233
+ */
4234
+ maximum_amount?: string | null;
4235
+
4236
+ /**
4237
+ * The subscription's override minimum amount for the plan.
4238
+ */
4239
+ minimum_amount?: string | null;
4240
+ }
4241
+
4242
+ export namespace OverrideBpsPrice {
4243
+ export interface BpsConfig {
4244
+ /**
4245
+ * Basis point take rate per event
4246
+ */
4247
+ bps: number;
4248
+
4249
+ /**
4250
+ * Optional currency amount maximum to cap spend per event
4251
+ */
4252
+ per_unit_maximum?: string | null;
4253
+ }
4254
+ }
4255
+
4256
+ export interface OverrideBulkBpsPrice {
4257
+ id: string;
4258
+
4259
+ bulk_bps_config: OverrideBulkBpsPrice.BulkBpsConfig;
4260
+
4261
+ model_type: 'bulk_bps';
4262
+
4263
+ /**
4264
+ * The subscription's override discount for the plan.
4265
+ */
4266
+ discount?: PricesAPI.Discount | null;
4267
+
4268
+ /**
4269
+ * The starting quantity of the price, if the price is a fixed price.
4270
+ */
4271
+ fixed_price_quantity?: number | null;
4272
+
4273
+ /**
4274
+ * The subscription's override maximum amount for the plan.
4275
+ */
4276
+ maximum_amount?: string | null;
4277
+
4278
+ /**
4279
+ * The subscription's override minimum amount for the plan.
4280
+ */
4281
+ minimum_amount?: string | null;
4282
+ }
4283
+
4284
+ export namespace OverrideBulkBpsPrice {
4285
+ export interface BulkBpsConfig {
4286
+ /**
4287
+ * Tiers for a bulk BPS pricing model where all usage is aggregated to a single
4288
+ * tier based on total volume
4289
+ */
4290
+ tiers: Array<BulkBpsConfig.Tier>;
4291
+ }
4292
+
4293
+ export namespace BulkBpsConfig {
4294
+ export interface Tier {
4295
+ /**
4296
+ * Basis points to rate on
4297
+ */
4298
+ bps: number;
4299
+
4300
+ /**
4301
+ * Upper bound for tier
4302
+ */
4303
+ maximum_amount?: string | null;
4304
+
4305
+ /**
4306
+ * The maximum amount to charge for any one event
4307
+ */
4308
+ per_unit_maximum?: string | null;
4309
+ }
4310
+ }
4311
+ }
4312
+
4313
+ export interface OverrideBulkPrice {
4314
+ id: string;
4315
+
4316
+ bulk_config: OverrideBulkPrice.BulkConfig;
4317
+
4318
+ model_type: 'bulk';
4319
+
4320
+ /**
4321
+ * The subscription's override discount for the plan.
4322
+ */
4323
+ discount?: PricesAPI.Discount | null;
4324
+
4325
+ /**
4326
+ * The starting quantity of the price, if the price is a fixed price.
4327
+ */
4328
+ fixed_price_quantity?: number | null;
4329
+
4330
+ /**
4331
+ * The subscription's override maximum amount for the plan.
4332
+ */
4333
+ maximum_amount?: string | null;
4334
+
4335
+ /**
4336
+ * The subscription's override minimum amount for the plan.
4337
+ */
4338
+ minimum_amount?: string | null;
4339
+ }
4340
+
4341
+ export namespace OverrideBulkPrice {
4342
+ export interface BulkConfig {
4343
+ /**
4344
+ * Bulk tiers for rating based on total usage volume
4345
+ */
4346
+ tiers: Array<BulkConfig.Tier>;
4347
+ }
4348
+
4349
+ export namespace BulkConfig {
4350
+ export interface Tier {
4351
+ /**
4352
+ * Amount per unit
4353
+ */
4354
+ unit_amount: string;
4355
+
4356
+ /**
4357
+ * Upper bound for this tier
4358
+ */
4359
+ maximum_units?: number | null;
4360
+ }
4361
+ }
4362
+ }
4363
+
4364
+ export interface OverrideTestRatingFunctionPrice {
4365
+ id: string;
4366
+
4367
+ model_type: 'test_rating_function';
4368
+
4369
+ test_rating_function_config: Record<string, unknown>;
4370
+
4371
+ /**
4372
+ * The subscription's override discount for the plan.
4373
+ */
4374
+ discount?: PricesAPI.Discount | null;
4375
+
4376
+ /**
4377
+ * The starting quantity of the price, if the price is a fixed price.
4378
+ */
4379
+ fixed_price_quantity?: number | null;
4380
+
4381
+ /**
4382
+ * The subscription's override maximum amount for the plan.
4383
+ */
4384
+ maximum_amount?: string | null;
4385
+
4386
+ /**
4387
+ * The subscription's override minimum amount for the plan.
4388
+ */
4389
+ minimum_amount?: string | null;
4390
+ }
4391
+
4392
+ export interface OverrideFivetranExamplePrice {
4393
+ id: string;
4394
+
4395
+ fivetran_example_config: Record<string, unknown>;
4396
+
4397
+ model_type: 'fivetran_example';
4398
+
4399
+ /**
4400
+ * The subscription's override discount for the plan.
4401
+ */
4402
+ discount?: PricesAPI.Discount | null;
4403
+
4404
+ /**
4405
+ * The starting quantity of the price, if the price is a fixed price.
4406
+ */
4407
+ fixed_price_quantity?: number | null;
4408
+
4409
+ /**
4410
+ * The subscription's override maximum amount for the plan.
4411
+ */
4412
+ maximum_amount?: string | null;
4413
+
4414
+ /**
4415
+ * The subscription's override minimum amount for the plan.
4416
+ */
4417
+ minimum_amount?: string | null;
4418
+ }
4419
+
4420
+ export interface OverrideThresholdTotalAmountPrice {
4421
+ id: string;
4422
+
4423
+ model_type: 'threshold_total_amount';
4424
+
4425
+ threshold_total_amount_config: Record<string, unknown>;
4426
+
4427
+ /**
4428
+ * The subscription's override discount for the plan.
4429
+ */
4430
+ discount?: PricesAPI.Discount | null;
4431
+
4432
+ /**
4433
+ * The starting quantity of the price, if the price is a fixed price.
4434
+ */
4435
+ fixed_price_quantity?: number | null;
4436
+
4437
+ /**
4438
+ * The subscription's override maximum amount for the plan.
4439
+ */
4440
+ maximum_amount?: string | null;
4441
+
4442
+ /**
4443
+ * The subscription's override minimum amount for the plan.
4444
+ */
4445
+ minimum_amount?: string | null;
4446
+ }
4447
+
4448
+ export interface OverrideTieredPackagePrice {
4449
+ id: string;
4450
+
4451
+ model_type: 'tiered_package';
4452
+
4453
+ tiered_package_config: Record<string, unknown>;
4454
+
4455
+ /**
4456
+ * The subscription's override discount for the plan.
4457
+ */
4458
+ discount?: PricesAPI.Discount | null;
4459
+
4460
+ /**
4461
+ * The starting quantity of the price, if the price is a fixed price.
4462
+ */
4463
+ fixed_price_quantity?: number | null;
4464
+
4465
+ /**
4466
+ * The subscription's override maximum amount for the plan.
4467
+ */
4468
+ maximum_amount?: string | null;
4469
+
4470
+ /**
4471
+ * The subscription's override minimum amount for the plan.
4472
+ */
4473
+ minimum_amount?: string | null;
4474
+ }
4475
+
4476
+ export interface OverrideTieredWithMinimumPrice {
4477
+ id: string;
4478
+
4479
+ model_type: 'tiered_with_minimum';
4480
+
4481
+ tiered_with_minimum_config: Record<string, unknown>;
4482
+
4483
+ /**
4484
+ * The subscription's override discount for the plan.
4485
+ */
4486
+ discount?: PricesAPI.Discount | null;
4487
+
4488
+ /**
4489
+ * The starting quantity of the price, if the price is a fixed price.
4490
+ */
4491
+ fixed_price_quantity?: number | null;
4492
+
4493
+ /**
4494
+ * The subscription's override maximum amount for the plan.
4495
+ */
4496
+ maximum_amount?: string | null;
4497
+
4498
+ /**
4499
+ * The subscription's override minimum amount for the plan.
4500
+ */
4501
+ minimum_amount?: string | null;
4502
+ }
4503
+
4504
+ export interface OverridePackageWithAllocationPrice {
4505
+ id: string;
4506
+
4507
+ model_type: 'package_with_allocation';
4508
+
4509
+ package_with_allocation_config: Record<string, unknown>;
4510
+
4511
+ /**
4512
+ * The subscription's override discount for the plan.
4513
+ */
4514
+ discount?: PricesAPI.Discount | null;
4515
+
4516
+ /**
4517
+ * The starting quantity of the price, if the price is a fixed price.
4518
+ */
4519
+ fixed_price_quantity?: number | null;
4520
+
4521
+ /**
4522
+ * The subscription's override maximum amount for the plan.
4523
+ */
4524
+ maximum_amount?: string | null;
4525
+
4526
+ /**
4527
+ * The subscription's override minimum amount for the plan.
4528
+ */
4529
+ minimum_amount?: string | null;
4530
+ }
4531
+ }
4532
+
4533
+ export interface SubscriptionTriggerPhaseParams {
4534
+ /**
4535
+ * The date on which the phase change should take effect. If not provided, defaults
4536
+ * to today in the customer's timezone.
4537
+ */
4538
+ effective_date?: string | null;
4539
+ }
4540
+
4541
+ export interface SubscriptionUnscheduleFixedFeeQuantityUpdatesParams {
4542
+ /**
4543
+ * Price for which the updates should be cleared. Must be a fixed fee.
4544
+ */
4545
+ price_id: string;
4546
+ }
4547
+
4548
+ export interface SubscriptionUpdateFixedFeeQuantityParams {
4549
+ /**
4550
+ * Price for which the quantity should be updated. Must be a fixed fee.
4551
+ */
4552
+ price_id: string;
4553
+
4554
+ quantity: number;
4555
+
4556
+ /**
4557
+ * Determines when the change takes effect. Note that if `effective_date` is
4558
+ * specified, this defaults to `effective_date`. Otherwise, this defaults to
4559
+ * `immediate` unless it's explicitly set to `upcoming_invoice.
4560
+ */
4561
+ change_option?: 'immediate' | 'upcoming_invoice' | 'effective_date';
4562
+
4563
+ /**
4564
+ * The date that the quantity change should take effect, localized to the
4565
+ * customer's timezone. Ifthis parameter is not passed in, the quantity change is
4566
+ * effective according to `change_option`.
4567
+ */
4568
+ effective_date?: string | null;
4569
+ }
4570
+
4571
+ export namespace Subscriptions {
4572
+ export import Subscription = SubscriptionsAPI.Subscription;
4573
+ export import Subscriptions = SubscriptionsAPI.Subscriptions;
4574
+ export import SubscriptionUsage = SubscriptionsAPI.SubscriptionUsage;
4575
+ export import SubscriptionFetchCostsResponse = SubscriptionsAPI.SubscriptionFetchCostsResponse;
4576
+ export import SubscriptionFetchScheduleResponse = SubscriptionsAPI.SubscriptionFetchScheduleResponse;
4577
+ export import SubscriptionsPage = SubscriptionsAPI.SubscriptionsPage;
4578
+ export import SubscriptionFetchScheduleResponsesPage = SubscriptionsAPI.SubscriptionFetchScheduleResponsesPage;
4579
+ export import SubscriptionCreateParams = SubscriptionsAPI.SubscriptionCreateParams;
4580
+ export import SubscriptionListParams = SubscriptionsAPI.SubscriptionListParams;
4581
+ export import SubscriptionCancelParams = SubscriptionsAPI.SubscriptionCancelParams;
4582
+ export import SubscriptionFetchCostsParams = SubscriptionsAPI.SubscriptionFetchCostsParams;
4583
+ export import SubscriptionFetchScheduleParams = SubscriptionsAPI.SubscriptionFetchScheduleParams;
4584
+ export import SubscriptionFetchUsageParams = SubscriptionsAPI.SubscriptionFetchUsageParams;
4585
+ export import SubscriptionPriceIntervalsParams = SubscriptionsAPI.SubscriptionPriceIntervalsParams;
4586
+ export import SubscriptionSchedulePlanChangeParams = SubscriptionsAPI.SubscriptionSchedulePlanChangeParams;
4587
+ export import SubscriptionTriggerPhaseParams = SubscriptionsAPI.SubscriptionTriggerPhaseParams;
4588
+ export import SubscriptionUnscheduleFixedFeeQuantityUpdatesParams = SubscriptionsAPI.SubscriptionUnscheduleFixedFeeQuantityUpdatesParams;
4589
+ export import SubscriptionUpdateFixedFeeQuantityParams = SubscriptionsAPI.SubscriptionUpdateFixedFeeQuantityParams;
4590
+ }