orb-billing 5.75.1 → 6.0.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 (926) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +118 -45
  3. package/api-promise.d.mts +3 -0
  4. package/api-promise.d.mts.map +1 -0
  5. package/api-promise.d.ts +3 -0
  6. package/api-promise.d.ts.map +1 -0
  7. package/api-promise.js +6 -0
  8. package/api-promise.js.map +1 -0
  9. package/api-promise.mjs +3 -0
  10. package/api-promise.mjs.map +1 -0
  11. package/client.d.mts +474 -0
  12. package/client.d.mts.map +1 -0
  13. package/client.d.ts +474 -0
  14. package/client.d.ts.map +1 -0
  15. package/client.js +650 -0
  16. package/client.js.map +1 -0
  17. package/client.mjs +645 -0
  18. package/client.mjs.map +1 -0
  19. package/core/api-promise.d.mts +46 -0
  20. package/core/api-promise.d.mts.map +1 -0
  21. package/core/api-promise.d.ts +46 -0
  22. package/core/api-promise.d.ts.map +1 -0
  23. package/core/api-promise.js +74 -0
  24. package/core/api-promise.js.map +1 -0
  25. package/core/api-promise.mjs +70 -0
  26. package/core/api-promise.mjs.map +1 -0
  27. package/core/error.d.mts +131 -0
  28. package/core/error.d.mts.map +1 -0
  29. package/core/error.d.ts +131 -0
  30. package/core/error.d.ts.map +1 -0
  31. package/core/error.js +294 -0
  32. package/core/error.js.map +1 -0
  33. package/core/error.mjs +266 -0
  34. package/core/error.mjs.map +1 -0
  35. package/core/pagination.d.mts +67 -0
  36. package/core/pagination.d.mts.map +1 -0
  37. package/core/pagination.d.ts +67 -0
  38. package/core/pagination.d.ts.map +1 -0
  39. package/core/pagination.js +101 -0
  40. package/core/pagination.js.map +1 -0
  41. package/core/pagination.mjs +95 -0
  42. package/core/pagination.mjs.map +1 -0
  43. package/core/resource.d.mts +6 -0
  44. package/core/resource.d.mts.map +1 -0
  45. package/core/resource.d.ts +6 -0
  46. package/core/resource.d.ts.map +1 -0
  47. package/core/resource.js +11 -0
  48. package/core/resource.js.map +1 -0
  49. package/core/resource.mjs +7 -0
  50. package/core/resource.mjs.map +1 -0
  51. package/core/uploads.d.mts +3 -0
  52. package/core/uploads.d.mts.map +1 -0
  53. package/core/uploads.d.ts +3 -0
  54. package/core/uploads.d.ts.map +1 -0
  55. package/core/uploads.js +6 -0
  56. package/core/uploads.js.map +1 -0
  57. package/core/uploads.mjs +2 -0
  58. package/core/uploads.mjs.map +1 -0
  59. package/error.d.mts +3 -0
  60. package/error.d.mts.map +1 -0
  61. package/error.d.ts +2 -131
  62. package/error.d.ts.map +1 -1
  63. package/error.js +3 -291
  64. package/error.js.map +1 -1
  65. package/error.mjs +2 -265
  66. package/error.mjs.map +1 -1
  67. package/index.d.mts +7 -401
  68. package/index.d.mts.map +1 -0
  69. package/index.d.ts +6 -400
  70. package/index.d.ts.map +1 -1
  71. package/index.js +15 -286
  72. package/index.js.map +1 -1
  73. package/index.mjs +6 -259
  74. package/index.mjs.map +1 -1
  75. package/internal/builtin-types.d.mts +73 -0
  76. package/internal/builtin-types.d.mts.map +1 -0
  77. package/internal/builtin-types.d.ts +73 -0
  78. package/internal/builtin-types.d.ts.map +1 -0
  79. package/internal/builtin-types.js +4 -0
  80. package/internal/builtin-types.js.map +1 -0
  81. package/internal/builtin-types.mjs +3 -0
  82. package/internal/builtin-types.mjs.map +1 -0
  83. package/internal/detect-platform.d.mts +15 -0
  84. package/internal/detect-platform.d.mts.map +1 -0
  85. package/internal/detect-platform.d.ts +15 -0
  86. package/internal/detect-platform.d.ts.map +1 -0
  87. package/internal/detect-platform.js +162 -0
  88. package/internal/detect-platform.js.map +1 -0
  89. package/internal/detect-platform.mjs +157 -0
  90. package/internal/detect-platform.mjs.map +1 -0
  91. package/internal/errors.d.mts +3 -0
  92. package/internal/errors.d.mts.map +1 -0
  93. package/internal/errors.d.ts +3 -0
  94. package/internal/errors.d.ts.map +1 -0
  95. package/internal/errors.js +41 -0
  96. package/internal/errors.js.map +1 -0
  97. package/internal/errors.mjs +36 -0
  98. package/internal/errors.mjs.map +1 -0
  99. package/internal/headers.d.mts +20 -0
  100. package/internal/headers.d.mts.map +1 -0
  101. package/internal/headers.d.ts +20 -0
  102. package/internal/headers.d.ts.map +1 -0
  103. package/internal/headers.js +79 -0
  104. package/internal/headers.js.map +1 -0
  105. package/internal/headers.mjs +74 -0
  106. package/internal/headers.mjs.map +1 -0
  107. package/internal/parse.d.mts +12 -0
  108. package/internal/parse.d.mts.map +1 -0
  109. package/internal/parse.d.ts +12 -0
  110. package/internal/parse.d.ts.map +1 -0
  111. package/internal/parse.js +40 -0
  112. package/internal/parse.js.map +1 -0
  113. package/internal/parse.mjs +37 -0
  114. package/internal/parse.mjs.map +1 -0
  115. package/internal/qs/formats.d.mts +7 -0
  116. package/internal/qs/formats.d.mts.map +1 -0
  117. package/internal/qs/formats.d.ts +1 -0
  118. package/internal/qs/formats.d.ts.map +1 -1
  119. package/internal/qs/formats.js +4 -2
  120. package/internal/qs/formats.js.map +1 -1
  121. package/internal/qs/formats.mjs +2 -1
  122. package/internal/qs/formats.mjs.map +1 -1
  123. package/internal/qs/index.d.mts +10 -0
  124. package/internal/qs/index.d.mts.map +1 -0
  125. package/internal/qs/index.d.ts +2 -2
  126. package/internal/qs/index.d.ts.map +1 -1
  127. package/internal/qs/index.mjs.map +1 -1
  128. package/internal/qs/stringify.d.mts +3 -0
  129. package/internal/qs/stringify.d.mts.map +1 -0
  130. package/internal/qs/stringify.d.ts.map +1 -1
  131. package/internal/qs/stringify.js +16 -19
  132. package/internal/qs/stringify.js.map +1 -1
  133. package/internal/qs/stringify.mjs +17 -19
  134. package/internal/qs/stringify.mjs.map +1 -1
  135. package/internal/qs/types.d.mts +57 -0
  136. package/internal/qs/types.d.mts.map +1 -0
  137. package/internal/qs/utils.d.mts +15 -0
  138. package/internal/qs/utils.d.mts.map +1 -0
  139. package/internal/qs/utils.d.ts +1 -0
  140. package/internal/qs/utils.d.ts.map +1 -1
  141. package/internal/qs/utils.js +22 -21
  142. package/internal/qs/utils.js.map +1 -1
  143. package/internal/qs/utils.mjs +12 -12
  144. package/internal/qs/utils.mjs.map +1 -1
  145. package/internal/request-options.d.mts +75 -0
  146. package/internal/request-options.d.mts.map +1 -0
  147. package/internal/request-options.d.ts +75 -0
  148. package/internal/request-options.d.ts.map +1 -0
  149. package/internal/request-options.js +14 -0
  150. package/internal/request-options.js.map +1 -0
  151. package/internal/request-options.mjs +10 -0
  152. package/internal/request-options.mjs.map +1 -0
  153. package/internal/shim-types.d.mts +17 -0
  154. package/internal/shim-types.d.mts.map +1 -0
  155. package/internal/shim-types.d.ts +17 -0
  156. package/internal/shim-types.d.ts.map +1 -0
  157. package/internal/shim-types.js +4 -0
  158. package/internal/shim-types.js.map +1 -0
  159. package/internal/shim-types.mjs +3 -0
  160. package/internal/shim-types.mjs.map +1 -0
  161. package/internal/shims.d.mts +26 -0
  162. package/internal/shims.d.mts.map +1 -0
  163. package/internal/shims.d.ts +26 -0
  164. package/internal/shims.d.ts.map +1 -0
  165. package/internal/shims.js +92 -0
  166. package/internal/shims.js.map +1 -0
  167. package/internal/shims.mjs +85 -0
  168. package/internal/shims.mjs.map +1 -0
  169. package/internal/to-file.d.mts +45 -0
  170. package/internal/to-file.d.mts.map +1 -0
  171. package/internal/to-file.d.ts +45 -0
  172. package/internal/to-file.d.ts.map +1 -0
  173. package/internal/to-file.js +91 -0
  174. package/internal/to-file.js.map +1 -0
  175. package/internal/to-file.mjs +88 -0
  176. package/internal/to-file.mjs.map +1 -0
  177. package/internal/tslib.js +81 -0
  178. package/internal/tslib.mjs +17 -0
  179. package/internal/types.d.mts +69 -0
  180. package/internal/types.d.mts.map +1 -0
  181. package/internal/types.d.ts +69 -0
  182. package/internal/types.d.ts.map +1 -0
  183. package/internal/types.js +4 -0
  184. package/internal/types.js.map +1 -0
  185. package/internal/types.mjs +3 -0
  186. package/internal/types.mjs.map +1 -0
  187. package/internal/uploads.d.mts +42 -0
  188. package/internal/uploads.d.mts.map +1 -0
  189. package/internal/uploads.d.ts +42 -0
  190. package/internal/uploads.d.ts.map +1 -0
  191. package/internal/uploads.js +141 -0
  192. package/internal/uploads.js.map +1 -0
  193. package/internal/uploads.mjs +131 -0
  194. package/internal/uploads.mjs.map +1 -0
  195. package/internal/utils/base64.d.mts +3 -0
  196. package/internal/utils/base64.d.mts.map +1 -0
  197. package/internal/utils/base64.d.ts +3 -0
  198. package/internal/utils/base64.d.ts.map +1 -0
  199. package/internal/utils/base64.js +38 -0
  200. package/internal/utils/base64.js.map +1 -0
  201. package/internal/utils/base64.mjs +33 -0
  202. package/internal/utils/base64.mjs.map +1 -0
  203. package/internal/utils/bytes.d.mts +4 -0
  204. package/internal/utils/bytes.d.mts.map +1 -0
  205. package/internal/utils/bytes.d.ts +4 -0
  206. package/internal/utils/bytes.d.ts.map +1 -0
  207. package/internal/utils/bytes.js +31 -0
  208. package/internal/utils/bytes.js.map +1 -0
  209. package/internal/utils/bytes.mjs +26 -0
  210. package/internal/utils/bytes.mjs.map +1 -0
  211. package/internal/utils/env.d.mts +9 -0
  212. package/internal/utils/env.d.mts.map +1 -0
  213. package/internal/utils/env.d.ts +9 -0
  214. package/internal/utils/env.d.ts.map +1 -0
  215. package/internal/utils/env.js +22 -0
  216. package/internal/utils/env.js.map +1 -0
  217. package/internal/utils/env.mjs +18 -0
  218. package/internal/utils/env.mjs.map +1 -0
  219. package/internal/utils/log.d.mts +37 -0
  220. package/internal/utils/log.d.mts.map +1 -0
  221. package/internal/utils/log.d.ts +37 -0
  222. package/internal/utils/log.d.ts.map +1 -0
  223. package/internal/utils/log.js +87 -0
  224. package/internal/utils/log.js.map +1 -0
  225. package/internal/utils/log.mjs +81 -0
  226. package/internal/utils/log.mjs.map +1 -0
  227. package/internal/utils/path.d.mts +15 -0
  228. package/internal/utils/path.d.mts.map +1 -0
  229. package/internal/utils/path.d.ts +15 -0
  230. package/internal/utils/path.d.ts.map +1 -0
  231. package/internal/utils/path.js +79 -0
  232. package/internal/utils/path.js.map +1 -0
  233. package/internal/utils/path.mjs +74 -0
  234. package/internal/utils/path.mjs.map +1 -0
  235. package/internal/utils/query.d.mts +2 -0
  236. package/internal/utils/query.d.mts.map +1 -0
  237. package/internal/utils/query.js +3 -26
  238. package/internal/utils/query.js.map +1 -1
  239. package/internal/utils/query.mjs.map +1 -1
  240. package/internal/utils/sleep.d.mts +2 -0
  241. package/internal/utils/sleep.d.mts.map +1 -0
  242. package/internal/utils/sleep.d.ts +2 -0
  243. package/internal/utils/sleep.d.ts.map +1 -0
  244. package/internal/utils/sleep.js +7 -0
  245. package/internal/utils/sleep.js.map +1 -0
  246. package/internal/utils/sleep.mjs +3 -0
  247. package/internal/utils/sleep.mjs.map +1 -0
  248. package/internal/utils/uuid.d.mts +5 -0
  249. package/internal/utils/uuid.d.mts.map +1 -0
  250. package/internal/utils/uuid.d.ts +5 -0
  251. package/internal/utils/uuid.d.ts.map +1 -0
  252. package/internal/utils/uuid.js +19 -0
  253. package/internal/utils/uuid.js.map +1 -0
  254. package/internal/utils/uuid.mjs +15 -0
  255. package/internal/utils/uuid.mjs.map +1 -0
  256. package/internal/utils/values.d.mts +18 -0
  257. package/internal/utils/values.d.mts.map +1 -0
  258. package/internal/utils/values.d.ts +18 -0
  259. package/internal/utils/values.d.ts.map +1 -0
  260. package/internal/utils/values.js +112 -0
  261. package/internal/utils/values.js.map +1 -0
  262. package/internal/utils/values.mjs +94 -0
  263. package/internal/utils/values.mjs.map +1 -0
  264. package/internal/utils.d.mts +8 -0
  265. package/internal/utils.d.mts.map +1 -0
  266. package/internal/utils.d.ts +8 -0
  267. package/internal/utils.d.ts.map +1 -0
  268. package/internal/utils.js +12 -0
  269. package/internal/utils.js.map +1 -0
  270. package/internal/utils.mjs +9 -0
  271. package/internal/utils.mjs.map +1 -0
  272. package/package.json +122 -65
  273. package/pagination.d.mts +3 -0
  274. package/pagination.d.mts.map +1 -0
  275. package/pagination.d.ts +2 -30
  276. package/pagination.d.ts.map +1 -1
  277. package/pagination.js +3 -37
  278. package/pagination.js.map +1 -1
  279. package/pagination.mjs +2 -35
  280. package/pagination.mjs.map +1 -1
  281. package/resource.d.mts +3 -0
  282. package/resource.d.mts.map +1 -0
  283. package/resource.d.ts +2 -5
  284. package/resource.d.ts.map +1 -1
  285. package/resource.js +3 -8
  286. package/resource.js.map +1 -1
  287. package/resource.mjs +2 -6
  288. package/resource.mjs.map +1 -1
  289. package/resources/alerts.d.mts +430 -0
  290. package/resources/alerts.d.mts.map +1 -0
  291. package/resources/alerts.d.ts +14 -17
  292. package/resources/alerts.d.ts.map +1 -1
  293. package/resources/alerts.js +37 -27
  294. package/resources/alerts.js.map +1 -1
  295. package/resources/alerts.mjs +36 -25
  296. package/resources/alerts.mjs.map +1 -1
  297. package/resources/beta/beta.d.mts +2826 -0
  298. package/resources/beta/beta.d.mts.map +1 -0
  299. package/resources/beta/beta.d.ts +13 -9
  300. package/resources/beta/beta.d.ts.map +1 -1
  301. package/resources/beta/beta.js +10 -30
  302. package/resources/beta/beta.js.map +1 -1
  303. package/resources/beta/beta.mjs +8 -6
  304. package/resources/beta/beta.mjs.map +1 -1
  305. package/resources/beta/external-plan-id.d.mts +2713 -0
  306. package/resources/beta/external-plan-id.d.mts.map +1 -0
  307. package/resources/beta/external-plan-id.d.ts +10 -6
  308. package/resources/beta/external-plan-id.d.ts.map +1 -1
  309. package/resources/beta/external-plan-id.js +7 -5
  310. package/resources/beta/external-plan-id.js.map +1 -1
  311. package/resources/beta/external-plan-id.mjs +7 -5
  312. package/resources/beta/external-plan-id.mjs.map +1 -1
  313. package/resources/beta/index.d.mts +3 -0
  314. package/resources/beta/index.d.mts.map +1 -0
  315. package/resources/beta/index.d.ts +2 -2
  316. package/resources/beta/index.d.ts.map +1 -1
  317. package/resources/beta/index.js.map +1 -1
  318. package/resources/beta/index.mjs.map +1 -1
  319. package/resources/beta.d.mts +2 -0
  320. package/resources/beta.d.mts.map +1 -0
  321. package/resources/beta.d.ts.map +1 -1
  322. package/resources/beta.js +2 -15
  323. package/resources/beta.js.map +1 -1
  324. package/resources/beta.mjs.map +1 -1
  325. package/resources/coupons/coupons.d.mts +148 -0
  326. package/resources/coupons/coupons.d.mts.map +1 -0
  327. package/resources/coupons/coupons.d.ts +10 -11
  328. package/resources/coupons/coupons.d.ts.map +1 -1
  329. package/resources/coupons/coupons.js +24 -38
  330. package/resources/coupons/coupons.js.map +1 -1
  331. package/resources/coupons/coupons.mjs +21 -12
  332. package/resources/coupons/coupons.mjs.map +1 -1
  333. package/resources/coupons/index.d.mts +3 -0
  334. package/resources/coupons/index.d.mts.map +1 -0
  335. package/resources/coupons/index.d.ts +1 -1
  336. package/resources/coupons/index.d.ts.map +1 -1
  337. package/resources/coupons/index.js +1 -2
  338. package/resources/coupons/index.js.map +1 -1
  339. package/resources/coupons/index.mjs +1 -1
  340. package/resources/coupons/index.mjs.map +1 -1
  341. package/resources/coupons/subscriptions.d.mts +34 -0
  342. package/resources/coupons/subscriptions.d.mts.map +1 -0
  343. package/resources/coupons/subscriptions.d.ts +5 -6
  344. package/resources/coupons/subscriptions.d.ts.map +1 -1
  345. package/resources/coupons/subscriptions.js +21 -12
  346. package/resources/coupons/subscriptions.js.map +1 -1
  347. package/resources/coupons/subscriptions.mjs +20 -11
  348. package/resources/coupons/subscriptions.mjs.map +1 -1
  349. package/resources/coupons.d.mts +2 -0
  350. package/resources/coupons.d.mts.map +1 -0
  351. package/resources/coupons.d.ts.map +1 -1
  352. package/resources/coupons.js +2 -15
  353. package/resources/coupons.js.map +1 -1
  354. package/resources/coupons.mjs.map +1 -1
  355. package/resources/credit-blocks.d.mts +275 -0
  356. package/resources/credit-blocks.d.mts.map +1 -0
  357. package/resources/credit-blocks.d.ts +50 -9
  358. package/resources/credit-blocks.d.ts.map +1 -1
  359. package/resources/credit-blocks.js +7 -5
  360. package/resources/credit-blocks.js.map +1 -1
  361. package/resources/credit-blocks.mjs +7 -5
  362. package/resources/credit-blocks.mjs.map +1 -1
  363. package/resources/credit-notes.d.mts +144 -0
  364. package/resources/credit-notes.d.mts.map +1 -0
  365. package/resources/credit-notes.d.ts +8 -8
  366. package/resources/credit-notes.d.ts.map +1 -1
  367. package/resources/credit-notes.js +19 -10
  368. package/resources/credit-notes.js.map +1 -1
  369. package/resources/credit-notes.mjs +18 -9
  370. package/resources/credit-notes.mjs.map +1 -1
  371. package/resources/customers/balance-transactions.d.mts +135 -0
  372. package/resources/customers/balance-transactions.d.mts.map +1 -0
  373. package/resources/customers/balance-transactions.d.ts +8 -9
  374. package/resources/customers/balance-transactions.d.ts.map +1 -1
  375. package/resources/customers/balance-transactions.js +29 -13
  376. package/resources/customers/balance-transactions.js.map +1 -1
  377. package/resources/customers/balance-transactions.mjs +28 -11
  378. package/resources/customers/balance-transactions.mjs.map +1 -1
  379. package/resources/customers/costs.d.mts +314 -0
  380. package/resources/customers/costs.d.mts.map +1 -0
  381. package/resources/customers/costs.d.ts +5 -6
  382. package/resources/customers/costs.d.ts.map +1 -1
  383. package/resources/customers/costs.js +243 -11
  384. package/resources/customers/costs.js.map +1 -1
  385. package/resources/customers/costs.mjs +243 -11
  386. package/resources/customers/costs.mjs.map +1 -1
  387. package/resources/customers/credits/credits.d.mts +287 -0
  388. package/resources/customers/credits/credits.d.mts.map +1 -0
  389. package/resources/customers/credits/credits.d.ts +55 -19
  390. package/resources/customers/credits/credits.d.ts.map +1 -1
  391. package/resources/customers/credits/credits.js +38 -50
  392. package/resources/customers/credits/credits.js.map +1 -1
  393. package/resources/customers/credits/credits.mjs +36 -24
  394. package/resources/customers/credits/credits.mjs.map +1 -1
  395. package/resources/customers/credits/index.d.mts +4 -0
  396. package/resources/customers/credits/index.d.mts.map +1 -0
  397. package/resources/customers/credits/index.d.ts +3 -3
  398. package/resources/customers/credits/index.d.ts.map +1 -1
  399. package/resources/customers/credits/index.js +1 -7
  400. package/resources/customers/credits/index.js.map +1 -1
  401. package/resources/customers/credits/index.mjs +3 -3
  402. package/resources/customers/credits/index.mjs.map +1 -1
  403. package/resources/customers/credits/ledger.d.mts +1202 -0
  404. package/resources/customers/credits/ledger.d.mts.map +1 -0
  405. package/resources/customers/credits/ledger.d.ts +11 -14
  406. package/resources/customers/credits/ledger.d.ts.map +1 -1
  407. package/resources/customers/credits/ledger.js +172 -27
  408. package/resources/customers/credits/ledger.js.map +1 -1
  409. package/resources/customers/credits/ledger.mjs +171 -24
  410. package/resources/customers/credits/ledger.mjs.map +1 -1
  411. package/resources/customers/credits/top-ups.d.mts +357 -0
  412. package/resources/customers/credits/top-ups.d.mts.map +1 -0
  413. package/resources/customers/credits/top-ups.d.ts +19 -16
  414. package/resources/customers/credits/top-ups.d.ts.map +1 -1
  415. package/resources/customers/credits/top-ups.js +24 -29
  416. package/resources/customers/credits/top-ups.js.map +1 -1
  417. package/resources/customers/credits/top-ups.mjs +23 -26
  418. package/resources/customers/credits/top-ups.mjs.map +1 -1
  419. package/resources/customers/credits.d.mts +2 -0
  420. package/resources/customers/credits.d.mts.map +1 -0
  421. package/resources/customers/credits.d.ts.map +1 -1
  422. package/resources/customers/credits.js +2 -15
  423. package/resources/customers/credits.js.map +1 -1
  424. package/resources/customers/credits.mjs.map +1 -1
  425. package/resources/customers/customers.d.mts +1453 -0
  426. package/resources/customers/customers.d.mts.map +1 -0
  427. package/resources/customers/customers.d.ts +17 -18
  428. package/resources/customers/customers.d.ts.map +1 -1
  429. package/resources/customers/customers.js +30 -53
  430. package/resources/customers/customers.js.map +1 -1
  431. package/resources/customers/customers.mjs +27 -27
  432. package/resources/customers/customers.mjs.map +1 -1
  433. package/resources/customers/index.d.mts +5 -0
  434. package/resources/customers/index.d.mts.map +1 -0
  435. package/resources/customers/index.d.ts +3 -3
  436. package/resources/customers/index.d.ts.map +1 -1
  437. package/resources/customers/index.js +1 -5
  438. package/resources/customers/index.js.map +1 -1
  439. package/resources/customers/index.mjs +3 -3
  440. package/resources/customers/index.mjs.map +1 -1
  441. package/resources/customers.d.mts +2 -0
  442. package/resources/customers.d.mts.map +1 -0
  443. package/resources/customers.d.ts.map +1 -1
  444. package/resources/customers.js +2 -15
  445. package/resources/customers.js.map +1 -1
  446. package/resources/customers.mjs.map +1 -1
  447. package/resources/dimensional-price-groups/dimensional-price-groups.d.mts +150 -0
  448. package/resources/dimensional-price-groups/dimensional-price-groups.d.mts.map +1 -0
  449. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +11 -12
  450. package/resources/dimensional-price-groups/dimensional-price-groups.d.ts.map +1 -1
  451. package/resources/dimensional-price-groups/dimensional-price-groups.js +21 -39
  452. package/resources/dimensional-price-groups/dimensional-price-groups.js.map +1 -1
  453. package/resources/dimensional-price-groups/dimensional-price-groups.mjs +18 -13
  454. package/resources/dimensional-price-groups/dimensional-price-groups.mjs.map +1 -1
  455. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.mts +53 -0
  456. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.mts.map +1 -0
  457. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +7 -6
  458. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts.map +1 -1
  459. package/resources/dimensional-price-groups/external-dimensional-price-group-id.js +6 -5
  460. package/resources/dimensional-price-groups/external-dimensional-price-group-id.js.map +1 -1
  461. package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs +6 -5
  462. package/resources/dimensional-price-groups/external-dimensional-price-group-id.mjs.map +1 -1
  463. package/resources/dimensional-price-groups/index.d.mts +3 -0
  464. package/resources/dimensional-price-groups/index.d.mts.map +1 -0
  465. package/resources/dimensional-price-groups/index.d.ts +1 -1
  466. package/resources/dimensional-price-groups/index.d.ts.map +1 -1
  467. package/resources/dimensional-price-groups/index.js +1 -2
  468. package/resources/dimensional-price-groups/index.js.map +1 -1
  469. package/resources/dimensional-price-groups/index.mjs +1 -1
  470. package/resources/dimensional-price-groups/index.mjs.map +1 -1
  471. package/resources/dimensional-price-groups.d.mts +2 -0
  472. package/resources/dimensional-price-groups.d.mts.map +1 -0
  473. package/resources/dimensional-price-groups.d.ts.map +1 -1
  474. package/resources/dimensional-price-groups.js +2 -15
  475. package/resources/dimensional-price-groups.js.map +1 -1
  476. package/resources/dimensional-price-groups.mjs.map +1 -1
  477. package/resources/events/backfills.d.mts +389 -0
  478. package/resources/events/backfills.d.mts.map +1 -0
  479. package/resources/events/backfills.d.ts +11 -12
  480. package/resources/events/backfills.d.ts.map +1 -1
  481. package/resources/events/backfills.js +24 -15
  482. package/resources/events/backfills.js.map +1 -1
  483. package/resources/events/backfills.mjs +23 -13
  484. package/resources/events/backfills.mjs.map +1 -1
  485. package/resources/events/events.d.mts +536 -0
  486. package/resources/events/events.d.mts.map +1 -0
  487. package/resources/events/events.d.ts +10 -11
  488. package/resources/events/events.d.ts.map +1 -1
  489. package/resources/events/events.js +7 -29
  490. package/resources/events/events.js.map +1 -1
  491. package/resources/events/events.mjs +5 -5
  492. package/resources/events/events.mjs.map +1 -1
  493. package/resources/events/index.d.mts +4 -0
  494. package/resources/events/index.d.mts.map +1 -0
  495. package/resources/events/index.d.ts +1 -1
  496. package/resources/events/index.d.ts.map +1 -1
  497. package/resources/events/index.js +1 -2
  498. package/resources/events/index.js.map +1 -1
  499. package/resources/events/index.mjs +1 -1
  500. package/resources/events/index.mjs.map +1 -1
  501. package/resources/events/volume.d.mts +79 -0
  502. package/resources/events/volume.d.mts.map +1 -0
  503. package/resources/events/volume.d.ts +4 -3
  504. package/resources/events/volume.d.ts.map +1 -1
  505. package/resources/events/volume.js +1 -1
  506. package/resources/events/volume.js.map +1 -1
  507. package/resources/events/volume.mjs +1 -1
  508. package/resources/events/volume.mjs.map +1 -1
  509. package/resources/events.d.mts +2 -0
  510. package/resources/events.d.mts.map +1 -0
  511. package/resources/events.d.ts.map +1 -1
  512. package/resources/events.js +2 -15
  513. package/resources/events.js.map +1 -1
  514. package/resources/events.mjs.map +1 -1
  515. package/resources/index.d.mts +22 -0
  516. package/resources/index.d.mts.map +1 -0
  517. package/resources/index.d.ts +13 -13
  518. package/resources/index.d.ts.map +1 -1
  519. package/resources/index.js +7 -33
  520. package/resources/index.js.map +1 -1
  521. package/resources/index.mjs +12 -12
  522. package/resources/index.mjs.map +1 -1
  523. package/resources/invoice-line-items.d.mts +245 -0
  524. package/resources/invoice-line-items.d.mts.map +1 -0
  525. package/resources/invoice-line-items.d.ts +4 -3
  526. package/resources/invoice-line-items.d.ts.map +1 -1
  527. package/resources/invoice-line-items.js +1 -1
  528. package/resources/invoice-line-items.js.map +1 -1
  529. package/resources/invoice-line-items.mjs +1 -1
  530. package/resources/invoice-line-items.mjs.map +1 -1
  531. package/resources/invoices.d.mts +1795 -0
  532. package/resources/invoices.d.mts.map +1 -0
  533. package/resources/invoices.d.ts +25 -27
  534. package/resources/invoices.d.ts.map +1 -1
  535. package/resources/invoices.js +105 -38
  536. package/resources/invoices.js.map +1 -1
  537. package/resources/invoices.mjs +104 -36
  538. package/resources/invoices.mjs.map +1 -1
  539. package/resources/items.d.mts +163 -0
  540. package/resources/items.d.mts.map +1 -0
  541. package/resources/items.d.ts +11 -12
  542. package/resources/items.d.ts.map +1 -1
  543. package/resources/items.js +20 -15
  544. package/resources/items.js.map +1 -1
  545. package/resources/items.mjs +19 -13
  546. package/resources/items.mjs.map +1 -1
  547. package/resources/license-types.d.mts +112 -0
  548. package/resources/license-types.d.mts.map +1 -0
  549. package/resources/license-types.d.ts +9 -10
  550. package/resources/license-types.d.ts.map +1 -1
  551. package/resources/license-types.js +14 -13
  552. package/resources/license-types.js.map +1 -1
  553. package/resources/license-types.mjs +13 -11
  554. package/resources/license-types.mjs.map +1 -1
  555. package/resources/licenses/external-licenses.d.mts +127 -0
  556. package/resources/licenses/external-licenses.d.mts.map +1 -0
  557. package/resources/licenses/external-licenses.d.ts +4 -3
  558. package/resources/licenses/external-licenses.d.ts.map +1 -1
  559. package/resources/licenses/external-licenses.js +6 -2
  560. package/resources/licenses/external-licenses.js.map +1 -1
  561. package/resources/licenses/external-licenses.mjs +6 -2
  562. package/resources/licenses/external-licenses.mjs.map +1 -1
  563. package/resources/licenses/index.d.mts +4 -0
  564. package/resources/licenses/index.d.mts.map +1 -0
  565. package/resources/licenses/index.d.ts +1 -1
  566. package/resources/licenses/index.d.ts.map +1 -1
  567. package/resources/licenses/index.js +1 -2
  568. package/resources/licenses/index.js.map +1 -1
  569. package/resources/licenses/index.mjs +1 -1
  570. package/resources/licenses/index.mjs.map +1 -1
  571. package/resources/licenses/licenses.d.mts +177 -0
  572. package/resources/licenses/licenses.d.mts.map +1 -0
  573. package/resources/licenses/licenses.d.ts +12 -12
  574. package/resources/licenses/licenses.d.ts.map +1 -1
  575. package/resources/licenses/licenses.js +13 -38
  576. package/resources/licenses/licenses.js.map +1 -1
  577. package/resources/licenses/licenses.mjs +9 -11
  578. package/resources/licenses/licenses.mjs.map +1 -1
  579. package/resources/licenses/usage.d.mts +226 -0
  580. package/resources/licenses/usage.d.mts.map +1 -0
  581. package/resources/licenses/usage.d.ts +5 -5
  582. package/resources/licenses/usage.d.ts.map +1 -1
  583. package/resources/licenses/usage.js +15 -6
  584. package/resources/licenses/usage.js.map +1 -1
  585. package/resources/licenses/usage.mjs +15 -6
  586. package/resources/licenses/usage.mjs.map +1 -1
  587. package/resources/licenses.d.mts +2 -0
  588. package/resources/licenses.d.mts.map +1 -0
  589. package/resources/licenses.d.ts.map +1 -1
  590. package/resources/licenses.js +2 -15
  591. package/resources/licenses.js.map +1 -1
  592. package/resources/licenses.mjs.map +1 -1
  593. package/resources/metrics.d.mts +147 -0
  594. package/resources/metrics.d.mts.map +1 -0
  595. package/resources/metrics.d.ts +15 -11
  596. package/resources/metrics.d.ts.map +1 -1
  597. package/resources/metrics.js +19 -14
  598. package/resources/metrics.js.map +1 -1
  599. package/resources/metrics.mjs +18 -12
  600. package/resources/metrics.mjs.map +1 -1
  601. package/resources/plans/external-plan-id.d.mts +61 -0
  602. package/resources/plans/external-plan-id.d.mts.map +1 -0
  603. package/resources/plans/external-plan-id.d.ts +5 -4
  604. package/resources/plans/external-plan-id.d.ts.map +1 -1
  605. package/resources/plans/external-plan-id.js +4 -3
  606. package/resources/plans/external-plan-id.js.map +1 -1
  607. package/resources/plans/external-plan-id.mjs +4 -3
  608. package/resources/plans/external-plan-id.mjs.map +1 -1
  609. package/resources/plans/index.d.mts +4 -0
  610. package/resources/plans/index.d.mts.map +1 -0
  611. package/resources/plans/index.d.ts +2 -2
  612. package/resources/plans/index.d.ts.map +1 -1
  613. package/resources/plans/index.js +1 -3
  614. package/resources/plans/index.js.map +1 -1
  615. package/resources/plans/index.mjs +2 -2
  616. package/resources/plans/index.mjs.map +1 -1
  617. package/resources/plans/migrations.d.mts +99 -0
  618. package/resources/plans/migrations.d.mts.map +1 -0
  619. package/resources/plans/migrations.d.ts +15 -10
  620. package/resources/plans/migrations.d.ts.map +1 -1
  621. package/resources/plans/migrations.js +17 -16
  622. package/resources/plans/migrations.js.map +1 -1
  623. package/resources/plans/migrations.mjs +16 -14
  624. package/resources/plans/migrations.mjs.map +1 -1
  625. package/resources/plans/plans.d.mts +1682 -0
  626. package/resources/plans/plans.d.mts.map +1 -0
  627. package/resources/plans/plans.d.ts +13 -14
  628. package/resources/plans/plans.d.ts.map +1 -1
  629. package/resources/plans/plans.js +18 -41
  630. package/resources/plans/plans.js.map +1 -1
  631. package/resources/plans/plans.mjs +15 -15
  632. package/resources/plans/plans.mjs.map +1 -1
  633. package/resources/plans.d.mts +2 -0
  634. package/resources/plans.d.mts.map +1 -0
  635. package/resources/plans.d.ts.map +1 -1
  636. package/resources/plans.js +2 -15
  637. package/resources/plans.js.map +1 -1
  638. package/resources/plans.mjs.map +1 -1
  639. package/resources/prices/external-price-id.d.mts +55 -0
  640. package/resources/prices/external-price-id.d.mts.map +1 -0
  641. package/resources/prices/external-price-id.d.ts +7 -6
  642. package/resources/prices/external-price-id.d.ts.map +1 -1
  643. package/resources/prices/external-price-id.js +6 -5
  644. package/resources/prices/external-price-id.js.map +1 -1
  645. package/resources/prices/external-price-id.mjs +6 -5
  646. package/resources/prices/external-price-id.mjs.map +1 -1
  647. package/resources/prices/index.d.mts +3 -0
  648. package/resources/prices/index.d.mts.map +1 -0
  649. package/resources/prices/index.d.ts.map +1 -1
  650. package/resources/prices/index.mjs.map +1 -1
  651. package/resources/prices/prices.d.mts +5950 -0
  652. package/resources/prices/prices.d.mts.map +1 -0
  653. package/resources/prices/prices.d.ts +13 -13
  654. package/resources/prices/prices.d.ts.map +1 -1
  655. package/resources/prices/prices.js +23 -37
  656. package/resources/prices/prices.js.map +1 -1
  657. package/resources/prices/prices.mjs +20 -12
  658. package/resources/prices/prices.mjs.map +1 -1
  659. package/resources/prices.d.mts +2 -0
  660. package/resources/prices.d.mts.map +1 -0
  661. package/resources/prices.d.ts.map +1 -1
  662. package/resources/prices.js +2 -15
  663. package/resources/prices.js.map +1 -1
  664. package/resources/prices.mjs.map +1 -1
  665. package/resources/shared.d.mts +13354 -0
  666. package/resources/shared.d.mts.map +1 -0
  667. package/resources/shared.d.ts +4 -7
  668. package/resources/shared.d.ts.map +1 -1
  669. package/resources/shared.js +0 -11
  670. package/resources/shared.js.map +1 -1
  671. package/resources/shared.mjs +1 -7
  672. package/resources/shared.mjs.map +1 -1
  673. package/resources/subscription-changes.d.mts +434 -0
  674. package/resources/subscription-changes.d.mts.map +1 -0
  675. package/resources/subscription-changes.d.ts +10 -12
  676. package/resources/subscription-changes.d.ts.map +1 -1
  677. package/resources/subscription-changes.js +18 -18
  678. package/resources/subscription-changes.js.map +1 -1
  679. package/resources/subscription-changes.mjs +17 -16
  680. package/resources/subscription-changes.mjs.map +1 -1
  681. package/resources/subscriptions.d.mts +10821 -0
  682. package/resources/subscriptions.d.mts.map +1 -0
  683. package/resources/subscriptions.d.ts +24 -29
  684. package/resources/subscriptions.d.ts.map +1 -1
  685. package/resources/subscriptions.js +284 -40
  686. package/resources/subscriptions.js.map +1 -1
  687. package/resources/subscriptions.mjs +283 -37
  688. package/resources/subscriptions.mjs.map +1 -1
  689. package/resources/top-level.d.mts +21 -0
  690. package/resources/top-level.d.mts.map +1 -0
  691. package/resources/top-level.d.ts +4 -3
  692. package/resources/top-level.d.ts.map +1 -1
  693. package/resources/top-level.js +1 -1
  694. package/resources/top-level.js.map +1 -1
  695. package/resources/top-level.mjs +1 -1
  696. package/resources/top-level.mjs.map +1 -1
  697. package/resources/webhooks.d.mts +24 -0
  698. package/resources/webhooks.d.mts.map +1 -0
  699. package/resources/webhooks.d.ts +2 -2
  700. package/resources/webhooks.d.ts.map +1 -1
  701. package/resources/webhooks.js +18 -5
  702. package/resources/webhooks.js.map +1 -1
  703. package/resources/webhooks.mjs +16 -3
  704. package/resources/webhooks.mjs.map +1 -1
  705. package/resources.d.mts +2 -0
  706. package/resources.d.mts.map +1 -0
  707. package/resources.d.ts.map +1 -1
  708. package/resources.js +2 -15
  709. package/resources.js.map +1 -1
  710. package/resources.mjs.map +1 -1
  711. package/src/api-promise.ts +2 -0
  712. package/src/client.ts +1499 -0
  713. package/src/core/README.md +3 -0
  714. package/src/core/api-promise.ts +92 -0
  715. package/src/core/error.ts +456 -0
  716. package/src/core/pagination.ts +167 -0
  717. package/src/core/resource.ts +11 -0
  718. package/src/core/uploads.ts +2 -0
  719. package/src/error.ts +2 -456
  720. package/src/index.ts +6 -923
  721. package/src/internal/README.md +3 -0
  722. package/src/internal/builtin-types.ts +93 -0
  723. package/src/internal/detect-platform.ts +196 -0
  724. package/src/internal/errors.ts +33 -0
  725. package/src/internal/headers.ts +97 -0
  726. package/src/internal/parse.ts +56 -0
  727. package/src/internal/qs/formats.ts +2 -1
  728. package/src/internal/qs/stringify.ts +17 -20
  729. package/src/internal/qs/utils.ts +14 -14
  730. package/src/internal/request-options.ts +91 -0
  731. package/src/internal/shim-types.ts +26 -0
  732. package/src/internal/shims.ts +107 -0
  733. package/src/internal/to-file.ts +154 -0
  734. package/src/internal/types.ts +93 -0
  735. package/src/internal/uploads.ts +187 -0
  736. package/src/internal/utils/base64.ts +40 -0
  737. package/src/internal/utils/bytes.ts +32 -0
  738. package/src/internal/utils/env.ts +18 -0
  739. package/src/internal/utils/log.ts +128 -0
  740. package/src/internal/utils/path.ts +88 -0
  741. package/src/internal/utils/sleep.ts +3 -0
  742. package/src/internal/utils/uuid.ts +17 -0
  743. package/src/internal/utils/values.ts +105 -0
  744. package/src/internal/utils.ts +9 -0
  745. package/src/pagination.ts +2 -70
  746. package/src/resource.ts +2 -11
  747. package/src/resources/alerts.ts +34 -62
  748. package/src/resources/beta/beta.ts +23 -13
  749. package/src/resources/beta/external-plan-id.ts +20 -12
  750. package/src/resources/beta/index.ts +2 -0
  751. package/src/resources/coupons/coupons.ts +16 -21
  752. package/src/resources/coupons/index.ts +7 -1
  753. package/src/resources/coupons/subscriptions.ts +13 -24
  754. package/src/resources/credit-blocks.ts +62 -16
  755. package/src/resources/credit-notes.ts +13 -20
  756. package/src/resources/customers/balance-transactions.ts +15 -28
  757. package/src/resources/customers/costs.ts +13 -33
  758. package/src/resources/customers/credits/credits.ts +76 -56
  759. package/src/resources/customers/credits/index.ts +8 -6
  760. package/src/resources/customers/credits/ledger.ts +29 -55
  761. package/src/resources/customers/credits/top-ups.ts +48 -61
  762. package/src/resources/customers/customers.ts +37 -48
  763. package/src/resources/customers/index.ts +4 -4
  764. package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +19 -30
  765. package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +12 -10
  766. package/src/resources/dimensional-price-groups/index.ts +1 -1
  767. package/src/resources/events/backfills.ts +18 -27
  768. package/src/resources/events/events.ts +14 -15
  769. package/src/resources/events/index.ts +1 -1
  770. package/src/resources/events/volume.ts +4 -3
  771. package/src/resources/index.ts +29 -28
  772. package/src/resources/invoice-line-items.ts +5 -4
  773. package/src/resources/invoices.ts +53 -95
  774. package/src/resources/items.ts +18 -24
  775. package/src/resources/license-types.ts +14 -31
  776. package/src/resources/licenses/external-licenses.ts +10 -5
  777. package/src/resources/licenses/index.ts +1 -1
  778. package/src/resources/licenses/licenses.ts +21 -20
  779. package/src/resources/licenses/usage.ts +9 -20
  780. package/src/resources/metrics.ts +22 -29
  781. package/src/resources/plans/external-plan-id.ts +9 -7
  782. package/src/resources/plans/index.ts +4 -2
  783. package/src/resources/plans/migrations.ts +30 -31
  784. package/src/resources/plans/plans.ts +22 -24
  785. package/src/resources/prices/external-price-id.ts +11 -9
  786. package/src/resources/prices/prices.ts +23 -31
  787. package/src/resources/shared.ts +4 -4
  788. package/src/resources/subscription-changes.ts +21 -44
  789. package/src/resources/subscriptions.ts +66 -106
  790. package/src/resources/top-level.ts +4 -3
  791. package/src/resources/webhooks.ts +17 -3
  792. package/src/tsconfig.json +2 -2
  793. package/src/uploads.ts +2 -255
  794. package/src/version.ts +1 -1
  795. package/uploads.d.mts +3 -0
  796. package/uploads.d.mts.map +1 -0
  797. package/uploads.d.ts +2 -74
  798. package/uploads.d.ts.map +1 -1
  799. package/uploads.js +3 -168
  800. package/uploads.js.map +1 -1
  801. package/uploads.mjs +2 -157
  802. package/uploads.mjs.map +1 -1
  803. package/version.d.mts +2 -0
  804. package/version.d.mts.map +1 -0
  805. package/version.d.ts +1 -1
  806. package/version.d.ts.map +1 -1
  807. package/version.js +1 -1
  808. package/version.js.map +1 -1
  809. package/version.mjs +1 -1
  810. package/version.mjs.map +1 -1
  811. package/_shims/MultipartBody.d.ts +0 -9
  812. package/_shims/MultipartBody.d.ts.map +0 -1
  813. package/_shims/MultipartBody.js +0 -16
  814. package/_shims/MultipartBody.js.map +0 -1
  815. package/_shims/MultipartBody.mjs +0 -12
  816. package/_shims/MultipartBody.mjs.map +0 -1
  817. package/_shims/README.md +0 -46
  818. package/_shims/auto/runtime-bun.d.ts +0 -5
  819. package/_shims/auto/runtime-bun.d.ts.map +0 -1
  820. package/_shims/auto/runtime-bun.js +0 -21
  821. package/_shims/auto/runtime-bun.js.map +0 -1
  822. package/_shims/auto/runtime-bun.mjs +0 -2
  823. package/_shims/auto/runtime-bun.mjs.map +0 -1
  824. package/_shims/auto/runtime-node.d.ts +0 -5
  825. package/_shims/auto/runtime-node.d.ts.map +0 -1
  826. package/_shims/auto/runtime-node.js +0 -21
  827. package/_shims/auto/runtime-node.js.map +0 -1
  828. package/_shims/auto/runtime-node.mjs +0 -2
  829. package/_shims/auto/runtime-node.mjs.map +0 -1
  830. package/_shims/auto/runtime.d.ts +0 -5
  831. package/_shims/auto/runtime.d.ts.map +0 -1
  832. package/_shims/auto/runtime.js +0 -21
  833. package/_shims/auto/runtime.js.map +0 -1
  834. package/_shims/auto/runtime.mjs +0 -2
  835. package/_shims/auto/runtime.mjs.map +0 -1
  836. package/_shims/auto/types-node.d.ts +0 -5
  837. package/_shims/auto/types-node.d.ts.map +0 -1
  838. package/_shims/auto/types-node.js +0 -21
  839. package/_shims/auto/types-node.js.map +0 -1
  840. package/_shims/auto/types-node.mjs +0 -2
  841. package/_shims/auto/types-node.mjs.map +0 -1
  842. package/_shims/auto/types.d.ts +0 -101
  843. package/_shims/auto/types.js +0 -3
  844. package/_shims/auto/types.mjs +0 -3
  845. package/_shims/bun-runtime.d.ts +0 -6
  846. package/_shims/bun-runtime.d.ts.map +0 -1
  847. package/_shims/bun-runtime.js +0 -14
  848. package/_shims/bun-runtime.js.map +0 -1
  849. package/_shims/bun-runtime.mjs +0 -10
  850. package/_shims/bun-runtime.mjs.map +0 -1
  851. package/_shims/index.d.ts +0 -83
  852. package/_shims/index.js +0 -17
  853. package/_shims/index.mjs +0 -11
  854. package/_shims/manual-types.d.ts +0 -12
  855. package/_shims/manual-types.js +0 -3
  856. package/_shims/manual-types.mjs +0 -3
  857. package/_shims/node-runtime.d.ts +0 -3
  858. package/_shims/node-runtime.d.ts.map +0 -1
  859. package/_shims/node-runtime.js +0 -89
  860. package/_shims/node-runtime.js.map +0 -1
  861. package/_shims/node-runtime.mjs +0 -56
  862. package/_shims/node-runtime.mjs.map +0 -1
  863. package/_shims/node-types.d.ts +0 -42
  864. package/_shims/node-types.js +0 -3
  865. package/_shims/node-types.mjs +0 -3
  866. package/_shims/registry.d.ts +0 -37
  867. package/_shims/registry.d.ts.map +0 -1
  868. package/_shims/registry.js +0 -41
  869. package/_shims/registry.js.map +0 -1
  870. package/_shims/registry.mjs +0 -37
  871. package/_shims/registry.mjs.map +0 -1
  872. package/_shims/web-runtime.d.ts +0 -5
  873. package/_shims/web-runtime.d.ts.map +0 -1
  874. package/_shims/web-runtime.js +0 -78
  875. package/_shims/web-runtime.js.map +0 -1
  876. package/_shims/web-runtime.mjs +0 -71
  877. package/_shims/web-runtime.mjs.map +0 -1
  878. package/_shims/web-types.d.ts +0 -83
  879. package/_shims/web-types.js +0 -3
  880. package/_shims/web-types.mjs +0 -3
  881. package/core.d.ts +0 -255
  882. package/core.d.ts.map +0 -1
  883. package/core.js +0 -920
  884. package/core.js.map +0 -1
  885. package/core.mjs +0 -888
  886. package/core.mjs.map +0 -1
  887. package/shims/node.d.ts +0 -30
  888. package/shims/node.d.ts.map +0 -1
  889. package/shims/node.js +0 -31
  890. package/shims/node.js.map +0 -1
  891. package/shims/node.mjs +0 -5
  892. package/shims/node.mjs.map +0 -1
  893. package/shims/web.d.ts +0 -26
  894. package/shims/web.d.ts.map +0 -1
  895. package/shims/web.js +0 -31
  896. package/shims/web.js.map +0 -1
  897. package/shims/web.mjs +0 -5
  898. package/shims/web.mjs.map +0 -1
  899. package/src/_shims/MultipartBody.ts +0 -9
  900. package/src/_shims/README.md +0 -46
  901. package/src/_shims/auto/runtime-bun.ts +0 -4
  902. package/src/_shims/auto/runtime-node.ts +0 -4
  903. package/src/_shims/auto/runtime.ts +0 -4
  904. package/src/_shims/auto/types-node.ts +0 -4
  905. package/src/_shims/auto/types.d.ts +0 -101
  906. package/src/_shims/auto/types.js +0 -3
  907. package/src/_shims/auto/types.mjs +0 -3
  908. package/src/_shims/bun-runtime.ts +0 -14
  909. package/src/_shims/index.d.ts +0 -83
  910. package/src/_shims/index.js +0 -17
  911. package/src/_shims/index.mjs +0 -11
  912. package/src/_shims/manual-types.d.ts +0 -12
  913. package/src/_shims/manual-types.js +0 -3
  914. package/src/_shims/manual-types.mjs +0 -3
  915. package/src/_shims/node-runtime.ts +0 -81
  916. package/src/_shims/node-types.d.ts +0 -42
  917. package/src/_shims/node-types.js +0 -3
  918. package/src/_shims/node-types.mjs +0 -3
  919. package/src/_shims/registry.ts +0 -67
  920. package/src/_shims/web-runtime.ts +0 -103
  921. package/src/_shims/web-types.d.ts +0 -83
  922. package/src/_shims/web-types.js +0 -3
  923. package/src/_shims/web-types.mjs +0 -3
  924. package/src/core.ts +0 -1231
  925. package/src/shims/node.ts +0 -50
  926. package/src/shims/web.ts +0 -50
@@ -0,0 +1,1202 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import * as Shared from "../../shared.mjs";
3
+ import { APIPromise } from "../../../core/api-promise.mjs";
4
+ import { Page, type PageParams, PagePromise } from "../../../core/pagination.mjs";
5
+ import { RequestOptions } from "../../../internal/request-options.mjs";
6
+ /**
7
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within Orb.
8
+ */
9
+ export declare class Ledger extends APIResource {
10
+ /**
11
+ * The credits ledger provides _auditing_ functionality over Orb's credits system
12
+ * with a list of actions that have taken place to modify a customer's credit
13
+ * balance. This [paginated endpoint](/api-reference/pagination) lists these
14
+ * entries, starting from the most recent ledger entry.
15
+ *
16
+ * More details on using Orb's real-time credit feature are
17
+ * [here](/product-catalog/prepurchase).
18
+ *
19
+ * There are four major types of modifications to credit balance, detailed below.
20
+ *
21
+ * ## Increment
22
+ *
23
+ * Credits (which optionally expire on a future date) can be added via the API
24
+ * ([Add Ledger Entry](create-ledger-entry)). The ledger entry for such an action
25
+ * will always contain the total eligible starting and ending balance for the
26
+ * customer at the time the entry was added to the ledger.
27
+ *
28
+ * ## Decrement
29
+ *
30
+ * Deductions can occur as a result of an API call to create a ledger entry (see
31
+ * [Add Ledger Entry](create-ledger-entry)), or automatically as a result of
32
+ * incurring usage. Both ledger entries present the `decrement` entry type.
33
+ *
34
+ * As usage for a customer is reported into Orb, credits may be deducted according
35
+ * to the customer's plan configuration. An automated deduction of this type will
36
+ * result in a ledger entry, also with a starting and ending balance. Each day's
37
+ * usage for a particular price, invoice, and block will be grouped into a single
38
+ * entry.
39
+ *
40
+ * By default, Orb uses an algorithm that automatically deducts from the _soonest
41
+ * expiring credit block_ first in order to ensure that all credits are utilized
42
+ * appropriately. As an example, if trial credits with an expiration date of 2
43
+ * weeks from now are present for a customer, they will be used before any
44
+ * deductions take place from a non-expiring credit block.
45
+ *
46
+ * If there are multiple blocks with the same expiration date, Orb will deduct from
47
+ * the block with the _lower cost basis_ first (e.g. trial credits with a \$0 cost
48
+ * basis before paid credits with a \$5.00 cost basis).
49
+ *
50
+ * It's also possible for a single usage event's deduction to _span_ credit blocks.
51
+ * In this case, Orb will deduct from the next block, ending at the credit block
52
+ * which consists of unexpiring credits. Each of these deductions will lead to a
53
+ * _separate_ ledger entry, one per credit block that is deducted from. By default,
54
+ * the customer's total credit balance in Orb can be negative as a result of a
55
+ * decrement.
56
+ *
57
+ * ## Expiration change
58
+ *
59
+ * The expiry of credits can be changed as a result of the API (See
60
+ * [Add Ledger Entry](create-ledger-entry)). This will create a ledger entry that
61
+ * specifies the balance as well as the initial and target expiry dates.
62
+ *
63
+ * Note that for this entry type, `starting_balance` will equal `ending_balance`,
64
+ * and the `amount` represents the balance transferred. The credit block linked to
65
+ * the ledger entry is the source credit block from which there was an expiration
66
+ * change.
67
+ *
68
+ * ## Credits expiry
69
+ *
70
+ * When a set of credits expire on pre-set expiration date, the customer's balance
71
+ * automatically reflects this change and adds an entry to the ledger indicating
72
+ * this event. Note that credit expiry should always happen close to a date
73
+ * boundary in the customer's timezone.
74
+ *
75
+ * ## Void initiated
76
+ *
77
+ * Credit blocks can be voided via the API. The `amount` on this entry corresponds
78
+ * to the number of credits that were remaining in the block at time of void.
79
+ * `void_reason` will be populated if the void is created with a reason.
80
+ *
81
+ * ## Void
82
+ *
83
+ * When a set of credits is voided, the customer's balance automatically reflects
84
+ * this change and adds an entry to the ledger indicating this event.
85
+ *
86
+ * ## Amendment
87
+ *
88
+ * When credits are added to a customer's balance as a result of a correction, this
89
+ * entry will be added to the ledger to indicate the adjustment of credits.
90
+ */
91
+ list(customerId: string, query?: LedgerListParams | null | undefined, options?: RequestOptions): PagePromise<LedgerListResponsesPage, LedgerListResponse>;
92
+ /**
93
+ * This endpoint allows you to create a new ledger entry for a specified customer's
94
+ * balance. This can be used to increment balance, deduct credits, and change the
95
+ * expiry date of existing credits.
96
+ *
97
+ * ## Effects of adding a ledger entry
98
+ *
99
+ * 1. After calling this endpoint, [Fetch Credit Balance](fetch-customer-credits)
100
+ * will return a credit block that represents the changes (i.e. balance changes
101
+ * or transfers).
102
+ * 2. A ledger entry will be added to the credits ledger for this customer, and
103
+ * therefore returned in the
104
+ * [View Credits Ledger](fetch-customer-credits-ledger) response as well as
105
+ * serialized in the response to this request. In the case of deductions without
106
+ * a specified block, multiple ledger entries may be created if the deduction
107
+ * spans credit blocks.
108
+ * 3. If `invoice_settings` is specified, an invoice will be created that reflects
109
+ * the cost of the credits (based on `amount` and `per_unit_cost_basis`).
110
+ *
111
+ * ## Adding credits
112
+ *
113
+ * Adding credits is done by creating an entry of type `increment`. This requires
114
+ * the caller to specify a number of credits as well as an optional expiry date in
115
+ * `YYYY-MM-DD` format. Orb also recommends specifying a description to assist with
116
+ * auditing. When adding credits, the caller can also specify a cost basis
117
+ * per-credit, to indicate how much in USD a customer paid for a single credit in a
118
+ * block. This can later be used for revenue recognition.
119
+ *
120
+ * The following snippet illustrates a sample request body to increment credits
121
+ * which will expire in January of 2022.
122
+ *
123
+ * ```json
124
+ * {
125
+ * "entry_type": "increment",
126
+ * "amount": 100,
127
+ * "expiry_date": "2022-12-28",
128
+ * "per_unit_cost_basis": "0.20",
129
+ * "description": "Purchased 100 credits"
130
+ * }
131
+ * ```
132
+ *
133
+ * Note that an `increment` entry always creates a new credit block (defined by the
134
+ * optional `effective_date` and `expiry_date`); it never modifies an existing
135
+ * block.
136
+ *
137
+ * ### Invoicing for credits
138
+ *
139
+ * By default, Orb manipulates the credit ledger but does not charge for credits.
140
+ * However, if you pass `invoice_settings` in the body of this request, Orb will
141
+ * also generate a one-off invoice for the customer for the credits pre-purchase.
142
+ * Note that you _must_ provide the `per_unit_cost_basis`, since the total charges
143
+ * on the invoice are calculated by multiplying the cost basis with the number of
144
+ * credit units added. If you invoice or handle payment of credits outside of Orb
145
+ * (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to
146
+ * `true` to prevent duplicate invoicing effects.
147
+ *
148
+ * - if `per_unit_cost_basis` is greater than zero, an invoice will be generated
149
+ * and `invoice_settings` must be included
150
+ * - if `invoice_settings` is passed, one of either `custom_due_date` or
151
+ * `net_terms` is required to determine the due date
152
+ *
153
+ * ## Deducting Credits
154
+ *
155
+ * Orb allows you to deduct credits from a customer by creating an entry of type
156
+ * `decrement`. A `decrement` entry records credits as usage and immediately
157
+ * recognizes revenue at the block's `per_unit_cost_basis`.
158
+ *
159
+ * For most credit removals, use `void` (no revenue impact) or `expiration_change`
160
+ * (revenue recognized on expiration) instead. Only use `decrement` when credits
161
+ * were genuinely consumed outside of normal event ingestion.
162
+ *
163
+ * Orb matches the algorithm for automatic deductions for determining which credit
164
+ * blocks to decrement from. In the case that the deduction leads to multiple
165
+ * ledger entries, the response from this endpoint will be the final deduction. Orb
166
+ * also optionally allows specifying a description to assist with auditing.
167
+ *
168
+ * The following snippet illustrates a sample request body to decrement credits.
169
+ *
170
+ * ```json
171
+ * {
172
+ * "entry_type": "decrement",
173
+ * "amount": 20,
174
+ * "description": "Removing excess credits"
175
+ * }
176
+ * ```
177
+ *
178
+ * ## Changing credits expiry
179
+ *
180
+ * If you'd like to change when existing credits expire, you should create a ledger
181
+ * entry of type `expiration_change`. For this entry, the required parameter
182
+ * `expiry_date` identifies the _originating_ block, and the required parameter
183
+ * `target_expiry_date` identifies when the transferred credits should now expire.
184
+ * A new credit block will be created with expiry date `target_expiry_date`, with
185
+ * the same cost basis data as the original credit block, if present.
186
+ *
187
+ * Note that the balance of the block with the given `expiry_date` must be at least
188
+ * equal to the desired transfer amount determined by the `amount` parameter.
189
+ *
190
+ * The following snippet illustrates a sample request body to extend the expiration
191
+ * date of credits by one year:
192
+ *
193
+ * ```json
194
+ * {
195
+ * "entry_type": "expiration_change",
196
+ * "amount": 10,
197
+ * "expiry_date": "2022-12-28",
198
+ * "block_id": "UiUhFWeLHPrBY4Ad",
199
+ * "target_expiry_date": "2023-12-28",
200
+ * "description": "Extending credit validity"
201
+ * }
202
+ * ```
203
+ *
204
+ * ## Voiding credits
205
+ *
206
+ * If you'd like to void a credit block, create a ledger entry of type `void`. For
207
+ * this entry, `block_id` is required to identify the block, and `amount` indicates
208
+ * how many credits to void, up to the block's initial balance. Pass in a
209
+ * `void_reason` of `refund` if the void is due to a refund.
210
+ *
211
+ * ## Amendment
212
+ *
213
+ * If you'd like to undo a decrement on a credit block, create a ledger entry of
214
+ * type `amendment`. For this entry, `block_id` is required to identify the block
215
+ * that was originally decremented from, and `amount` indicates how many credits to
216
+ * return to the customer, up to the block's initial balance.
217
+ */
218
+ createEntry(customerId: string, body: LedgerCreateEntryParams, options?: RequestOptions): APIPromise<LedgerCreateEntryResponse>;
219
+ /**
220
+ * This endpoint allows you to create a new ledger entry for a specified customer's
221
+ * balance. This can be used to increment balance, deduct credits, and change the
222
+ * expiry date of existing credits.
223
+ *
224
+ * ## Effects of adding a ledger entry
225
+ *
226
+ * 1. After calling this endpoint, [Fetch Credit Balance](fetch-customer-credits)
227
+ * will return a credit block that represents the changes (i.e. balance changes
228
+ * or transfers).
229
+ * 2. A ledger entry will be added to the credits ledger for this customer, and
230
+ * therefore returned in the
231
+ * [View Credits Ledger](fetch-customer-credits-ledger) response as well as
232
+ * serialized in the response to this request. In the case of deductions without
233
+ * a specified block, multiple ledger entries may be created if the deduction
234
+ * spans credit blocks.
235
+ * 3. If `invoice_settings` is specified, an invoice will be created that reflects
236
+ * the cost of the credits (based on `amount` and `per_unit_cost_basis`).
237
+ *
238
+ * ## Adding credits
239
+ *
240
+ * Adding credits is done by creating an entry of type `increment`. This requires
241
+ * the caller to specify a number of credits as well as an optional expiry date in
242
+ * `YYYY-MM-DD` format. Orb also recommends specifying a description to assist with
243
+ * auditing. When adding credits, the caller can also specify a cost basis
244
+ * per-credit, to indicate how much in USD a customer paid for a single credit in a
245
+ * block. This can later be used for revenue recognition.
246
+ *
247
+ * The following snippet illustrates a sample request body to increment credits
248
+ * which will expire in January of 2022.
249
+ *
250
+ * ```json
251
+ * {
252
+ * "entry_type": "increment",
253
+ * "amount": 100,
254
+ * "expiry_date": "2022-12-28",
255
+ * "per_unit_cost_basis": "0.20",
256
+ * "description": "Purchased 100 credits"
257
+ * }
258
+ * ```
259
+ *
260
+ * Note that an `increment` entry always creates a new credit block (defined by the
261
+ * optional `effective_date` and `expiry_date`); it never modifies an existing
262
+ * block.
263
+ *
264
+ * ### Invoicing for credits
265
+ *
266
+ * By default, Orb manipulates the credit ledger but does not charge for credits.
267
+ * However, if you pass `invoice_settings` in the body of this request, Orb will
268
+ * also generate a one-off invoice for the customer for the credits pre-purchase.
269
+ * Note that you _must_ provide the `per_unit_cost_basis`, since the total charges
270
+ * on the invoice are calculated by multiplying the cost basis with the number of
271
+ * credit units added. If you invoice or handle payment of credits outside of Orb
272
+ * (i.e. marketplace customers), set `mark_as_paid` in the `invoice_settings` to
273
+ * `true` to prevent duplicate invoicing effects.
274
+ *
275
+ * - if `per_unit_cost_basis` is greater than zero, an invoice will be generated
276
+ * and `invoice_settings` must be included
277
+ * - if `invoice_settings` is passed, one of either `custom_due_date` or
278
+ * `net_terms` is required to determine the due date
279
+ *
280
+ * ## Deducting Credits
281
+ *
282
+ * Orb allows you to deduct credits from a customer by creating an entry of type
283
+ * `decrement`. A `decrement` entry records credits as usage and immediately
284
+ * recognizes revenue at the block's `per_unit_cost_basis`.
285
+ *
286
+ * For most credit removals, use `void` (no revenue impact) or `expiration_change`
287
+ * (revenue recognized on expiration) instead. Only use `decrement` when credits
288
+ * were genuinely consumed outside of normal event ingestion.
289
+ *
290
+ * Orb matches the algorithm for automatic deductions for determining which credit
291
+ * blocks to decrement from. In the case that the deduction leads to multiple
292
+ * ledger entries, the response from this endpoint will be the final deduction. Orb
293
+ * also optionally allows specifying a description to assist with auditing.
294
+ *
295
+ * The following snippet illustrates a sample request body to decrement credits.
296
+ *
297
+ * ```json
298
+ * {
299
+ * "entry_type": "decrement",
300
+ * "amount": 20,
301
+ * "description": "Removing excess credits"
302
+ * }
303
+ * ```
304
+ *
305
+ * ## Changing credits expiry
306
+ *
307
+ * If you'd like to change when existing credits expire, you should create a ledger
308
+ * entry of type `expiration_change`. For this entry, the required parameter
309
+ * `expiry_date` identifies the _originating_ block, and the required parameter
310
+ * `target_expiry_date` identifies when the transferred credits should now expire.
311
+ * A new credit block will be created with expiry date `target_expiry_date`, with
312
+ * the same cost basis data as the original credit block, if present.
313
+ *
314
+ * Note that the balance of the block with the given `expiry_date` must be at least
315
+ * equal to the desired transfer amount determined by the `amount` parameter.
316
+ *
317
+ * The following snippet illustrates a sample request body to extend the expiration
318
+ * date of credits by one year:
319
+ *
320
+ * ```json
321
+ * {
322
+ * "entry_type": "expiration_change",
323
+ * "amount": 10,
324
+ * "expiry_date": "2022-12-28",
325
+ * "block_id": "UiUhFWeLHPrBY4Ad",
326
+ * "target_expiry_date": "2023-12-28",
327
+ * "description": "Extending credit validity"
328
+ * }
329
+ * ```
330
+ *
331
+ * ## Voiding credits
332
+ *
333
+ * If you'd like to void a credit block, create a ledger entry of type `void`. For
334
+ * this entry, `block_id` is required to identify the block, and `amount` indicates
335
+ * how many credits to void, up to the block's initial balance. Pass in a
336
+ * `void_reason` of `refund` if the void is due to a refund.
337
+ *
338
+ * ## Amendment
339
+ *
340
+ * If you'd like to undo a decrement on a credit block, create a ledger entry of
341
+ * type `amendment`. For this entry, `block_id` is required to identify the block
342
+ * that was originally decremented from, and `amount` indicates how many credits to
343
+ * return to the customer, up to the block's initial balance.
344
+ */
345
+ createEntryByExternalID(externalCustomerId: string, body: LedgerCreateEntryByExternalIDParams, options?: RequestOptions): APIPromise<LedgerCreateEntryByExternalIDResponse>;
346
+ /**
347
+ * The credits ledger provides _auditing_ functionality over Orb's credits system
348
+ * with a list of actions that have taken place to modify a customer's credit
349
+ * balance. This [paginated endpoint](/api-reference/pagination) lists these
350
+ * entries, starting from the most recent ledger entry.
351
+ *
352
+ * More details on using Orb's real-time credit feature are
353
+ * [here](/product-catalog/prepurchase).
354
+ *
355
+ * There are four major types of modifications to credit balance, detailed below.
356
+ *
357
+ * ## Increment
358
+ *
359
+ * Credits (which optionally expire on a future date) can be added via the API
360
+ * ([Add Ledger Entry](create-ledger-entry)). The ledger entry for such an action
361
+ * will always contain the total eligible starting and ending balance for the
362
+ * customer at the time the entry was added to the ledger.
363
+ *
364
+ * ## Decrement
365
+ *
366
+ * Deductions can occur as a result of an API call to create a ledger entry (see
367
+ * [Add Ledger Entry](create-ledger-entry)), or automatically as a result of
368
+ * incurring usage. Both ledger entries present the `decrement` entry type.
369
+ *
370
+ * As usage for a customer is reported into Orb, credits may be deducted according
371
+ * to the customer's plan configuration. An automated deduction of this type will
372
+ * result in a ledger entry, also with a starting and ending balance. Each day's
373
+ * usage for a particular price, invoice, and block will be grouped into a single
374
+ * entry.
375
+ *
376
+ * By default, Orb uses an algorithm that automatically deducts from the _soonest
377
+ * expiring credit block_ first in order to ensure that all credits are utilized
378
+ * appropriately. As an example, if trial credits with an expiration date of 2
379
+ * weeks from now are present for a customer, they will be used before any
380
+ * deductions take place from a non-expiring credit block.
381
+ *
382
+ * If there are multiple blocks with the same expiration date, Orb will deduct from
383
+ * the block with the _lower cost basis_ first (e.g. trial credits with a \$0 cost
384
+ * basis before paid credits with a \$5.00 cost basis).
385
+ *
386
+ * It's also possible for a single usage event's deduction to _span_ credit blocks.
387
+ * In this case, Orb will deduct from the next block, ending at the credit block
388
+ * which consists of unexpiring credits. Each of these deductions will lead to a
389
+ * _separate_ ledger entry, one per credit block that is deducted from. By default,
390
+ * the customer's total credit balance in Orb can be negative as a result of a
391
+ * decrement.
392
+ *
393
+ * ## Expiration change
394
+ *
395
+ * The expiry of credits can be changed as a result of the API (See
396
+ * [Add Ledger Entry](create-ledger-entry)). This will create a ledger entry that
397
+ * specifies the balance as well as the initial and target expiry dates.
398
+ *
399
+ * Note that for this entry type, `starting_balance` will equal `ending_balance`,
400
+ * and the `amount` represents the balance transferred. The credit block linked to
401
+ * the ledger entry is the source credit block from which there was an expiration
402
+ * change.
403
+ *
404
+ * ## Credits expiry
405
+ *
406
+ * When a set of credits expire on pre-set expiration date, the customer's balance
407
+ * automatically reflects this change and adds an entry to the ledger indicating
408
+ * this event. Note that credit expiry should always happen close to a date
409
+ * boundary in the customer's timezone.
410
+ *
411
+ * ## Void initiated
412
+ *
413
+ * Credit blocks can be voided via the API. The `amount` on this entry corresponds
414
+ * to the number of credits that were remaining in the block at time of void.
415
+ * `void_reason` will be populated if the void is created with a reason.
416
+ *
417
+ * ## Void
418
+ *
419
+ * When a set of credits is voided, the customer's balance automatically reflects
420
+ * this change and adds an entry to the ledger indicating this event.
421
+ *
422
+ * ## Amendment
423
+ *
424
+ * When credits are added to a customer's balance as a result of a correction, this
425
+ * entry will be added to the ledger to indicate the adjustment of credits.
426
+ */
427
+ listByExternalID(externalCustomerId: string, query?: LedgerListByExternalIDParams | null | undefined, options?: RequestOptions): PagePromise<LedgerListByExternalIDResponsesPage, LedgerListByExternalIDResponse>;
428
+ }
429
+ export type LedgerListResponsesPage = Page<LedgerListResponse>;
430
+ export type LedgerListByExternalIDResponsesPage = Page<LedgerListByExternalIDResponse>;
431
+ export interface AffectedBlock {
432
+ id: string;
433
+ expiry_date: string | null;
434
+ filters: Array<AffectedBlock.Filter>;
435
+ per_unit_cost_basis: string | null;
436
+ }
437
+ export declare namespace AffectedBlock {
438
+ interface Filter {
439
+ /**
440
+ * The property of the price to filter on.
441
+ */
442
+ field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
443
+ /**
444
+ * Should prices that match the filter be included or excluded.
445
+ */
446
+ operator: 'includes' | 'excludes';
447
+ /**
448
+ * The IDs or values that match this filter.
449
+ */
450
+ values: Array<string>;
451
+ }
452
+ }
453
+ export interface AmendmentLedgerEntry {
454
+ id: string;
455
+ amount: number;
456
+ created_at: string;
457
+ credit_block: AffectedBlock;
458
+ currency: string;
459
+ customer: Shared.CustomerMinified;
460
+ description: string | null;
461
+ ending_balance: number;
462
+ entry_status: 'committed' | 'pending';
463
+ entry_type: 'amendment';
464
+ ledger_sequence_number: number;
465
+ /**
466
+ * User specified key-value pairs for the resource. If not present, this defaults
467
+ * to an empty dictionary. Individual keys can be removed by setting the value to
468
+ * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
469
+ * `null`.
470
+ */
471
+ metadata: {
472
+ [key: string]: string;
473
+ };
474
+ starting_balance: number;
475
+ }
476
+ export interface CreditBlockExpiryLedgerEntry {
477
+ id: string;
478
+ amount: number;
479
+ created_at: string;
480
+ credit_block: AffectedBlock;
481
+ currency: string;
482
+ customer: Shared.CustomerMinified;
483
+ description: string | null;
484
+ ending_balance: number;
485
+ entry_status: 'committed' | 'pending';
486
+ entry_type: 'credit_block_expiry';
487
+ ledger_sequence_number: number;
488
+ /**
489
+ * User specified key-value pairs for the resource. If not present, this defaults
490
+ * to an empty dictionary. Individual keys can be removed by setting the value to
491
+ * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
492
+ * `null`.
493
+ */
494
+ metadata: {
495
+ [key: string]: string;
496
+ };
497
+ starting_balance: number;
498
+ }
499
+ export interface DecrementLedgerEntry {
500
+ id: string;
501
+ amount: number;
502
+ created_at: string;
503
+ credit_block: AffectedBlock;
504
+ currency: string;
505
+ customer: Shared.CustomerMinified;
506
+ description: string | null;
507
+ ending_balance: number;
508
+ entry_status: 'committed' | 'pending';
509
+ entry_type: 'decrement';
510
+ ledger_sequence_number: number;
511
+ /**
512
+ * User specified key-value pairs for the resource. If not present, this defaults
513
+ * to an empty dictionary. Individual keys can be removed by setting the value to
514
+ * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
515
+ * `null`.
516
+ */
517
+ metadata: {
518
+ [key: string]: string;
519
+ };
520
+ starting_balance: number;
521
+ /**
522
+ * @deprecated This field is deprecated and will always be null. Decrements are not
523
+ * associated with individual events.
524
+ */
525
+ event_id?: string | null;
526
+ invoice_id?: string | null;
527
+ price_id?: string | null;
528
+ }
529
+ export interface ExpirationChangeLedgerEntry {
530
+ id: string;
531
+ amount: number;
532
+ created_at: string;
533
+ credit_block: AffectedBlock;
534
+ currency: string;
535
+ customer: Shared.CustomerMinified;
536
+ description: string | null;
537
+ ending_balance: number;
538
+ entry_status: 'committed' | 'pending';
539
+ entry_type: 'expiration_change';
540
+ ledger_sequence_number: number;
541
+ /**
542
+ * User specified key-value pairs for the resource. If not present, this defaults
543
+ * to an empty dictionary. Individual keys can be removed by setting the value to
544
+ * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
545
+ * `null`.
546
+ */
547
+ metadata: {
548
+ [key: string]: string;
549
+ };
550
+ new_block_expiry_date: string | null;
551
+ starting_balance: number;
552
+ }
553
+ export interface IncrementLedgerEntry {
554
+ id: string;
555
+ amount: number;
556
+ created_at: string;
557
+ credit_block: AffectedBlock;
558
+ currency: string;
559
+ customer: Shared.CustomerMinified;
560
+ description: string | null;
561
+ ending_balance: number;
562
+ entry_status: 'committed' | 'pending';
563
+ entry_type: 'increment';
564
+ ledger_sequence_number: number;
565
+ /**
566
+ * User specified key-value pairs for the resource. If not present, this defaults
567
+ * to an empty dictionary. Individual keys can be removed by setting the value to
568
+ * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
569
+ * `null`.
570
+ */
571
+ metadata: {
572
+ [key: string]: string;
573
+ };
574
+ starting_balance: number;
575
+ /**
576
+ * If the increment resulted in invoice creation, the list of created invoices
577
+ */
578
+ created_invoices?: Array<Shared.Invoice> | null;
579
+ }
580
+ export interface VoidInitiatedLedgerEntry {
581
+ id: string;
582
+ amount: number;
583
+ created_at: string;
584
+ credit_block: AffectedBlock;
585
+ currency: string;
586
+ customer: Shared.CustomerMinified;
587
+ description: string | null;
588
+ ending_balance: number;
589
+ entry_status: 'committed' | 'pending';
590
+ entry_type: 'void_initiated';
591
+ ledger_sequence_number: number;
592
+ /**
593
+ * User specified key-value pairs for the resource. If not present, this defaults
594
+ * to an empty dictionary. Individual keys can be removed by setting the value to
595
+ * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
596
+ * `null`.
597
+ */
598
+ metadata: {
599
+ [key: string]: string;
600
+ };
601
+ new_block_expiry_date: string;
602
+ starting_balance: number;
603
+ void_amount: number;
604
+ void_reason: string | null;
605
+ }
606
+ export interface VoidLedgerEntry {
607
+ id: string;
608
+ amount: number;
609
+ created_at: string;
610
+ credit_block: AffectedBlock;
611
+ currency: string;
612
+ customer: Shared.CustomerMinified;
613
+ description: string | null;
614
+ ending_balance: number;
615
+ entry_status: 'committed' | 'pending';
616
+ entry_type: 'void';
617
+ ledger_sequence_number: number;
618
+ /**
619
+ * User specified key-value pairs for the resource. If not present, this defaults
620
+ * to an empty dictionary. Individual keys can be removed by setting the value to
621
+ * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
622
+ * `null`.
623
+ */
624
+ metadata: {
625
+ [key: string]: string;
626
+ };
627
+ starting_balance: number;
628
+ void_amount: number;
629
+ void_reason: string | null;
630
+ }
631
+ /**
632
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
633
+ * credits within Orb.
634
+ */
635
+ export type LedgerListResponse = IncrementLedgerEntry | DecrementLedgerEntry | ExpirationChangeLedgerEntry | CreditBlockExpiryLedgerEntry | VoidLedgerEntry | VoidInitiatedLedgerEntry | AmendmentLedgerEntry;
636
+ /**
637
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
638
+ * credits within Orb.
639
+ */
640
+ export type LedgerCreateEntryResponse = IncrementLedgerEntry | DecrementLedgerEntry | ExpirationChangeLedgerEntry | CreditBlockExpiryLedgerEntry | VoidLedgerEntry | VoidInitiatedLedgerEntry | AmendmentLedgerEntry;
641
+ /**
642
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
643
+ * credits within Orb.
644
+ */
645
+ export type LedgerCreateEntryByExternalIDResponse = IncrementLedgerEntry | DecrementLedgerEntry | ExpirationChangeLedgerEntry | CreditBlockExpiryLedgerEntry | VoidLedgerEntry | VoidInitiatedLedgerEntry | AmendmentLedgerEntry;
646
+ /**
647
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid
648
+ * credits within Orb.
649
+ */
650
+ export type LedgerListByExternalIDResponse = IncrementLedgerEntry | DecrementLedgerEntry | ExpirationChangeLedgerEntry | CreditBlockExpiryLedgerEntry | VoidLedgerEntry | VoidInitiatedLedgerEntry | AmendmentLedgerEntry;
651
+ export interface LedgerListParams extends PageParams {
652
+ 'created_at[gt]'?: string | null;
653
+ 'created_at[gte]'?: string | null;
654
+ 'created_at[lt]'?: string | null;
655
+ 'created_at[lte]'?: string | null;
656
+ /**
657
+ * The ledger currency or custom pricing unit to use.
658
+ */
659
+ currency?: string | null;
660
+ entry_status?: 'committed' | 'pending' | null;
661
+ entry_type?: 'increment' | 'decrement' | 'expiration_change' | 'credit_block_expiry' | 'void' | 'void_initiated' | 'amendment' | null;
662
+ minimum_amount?: string | null;
663
+ }
664
+ export type LedgerCreateEntryParams = LedgerCreateEntryParams.AddIncrementCreditLedgerEntryRequestParams | LedgerCreateEntryParams.AddDecrementCreditLedgerEntryRequestParams | LedgerCreateEntryParams.AddExpirationChangeCreditLedgerEntryRequestParams | LedgerCreateEntryParams.AddVoidCreditLedgerEntryRequestParams | LedgerCreateEntryParams.AddAmendmentCreditLedgerEntryRequestParams;
665
+ export declare namespace LedgerCreateEntryParams {
666
+ interface AddIncrementCreditLedgerEntryRequestParams {
667
+ /**
668
+ * The number of credits to effect. Note that this is required for increment,
669
+ * decrement, void, or undo operations.
670
+ */
671
+ amount: number;
672
+ entry_type: 'increment';
673
+ /**
674
+ * The currency or custom pricing unit to use for this ledger entry. If this is a
675
+ * real-world currency, it must match the customer's invoicing currency.
676
+ */
677
+ currency?: string | null;
678
+ /**
679
+ * Optional metadata that can be specified when adding ledger results via the API.
680
+ * For example, this can be used to note an increment refers to trial credits, or
681
+ * for noting corrections as a result of an incident, etc.
682
+ */
683
+ description?: string | null;
684
+ /**
685
+ * An ISO 8601 format date that denotes when this credit balance should become
686
+ * available for use.
687
+ */
688
+ effective_date?: string | null;
689
+ /**
690
+ * An ISO 8601 format date that denotes when this credit balance should expire.
691
+ */
692
+ expiry_date?: string | null;
693
+ /**
694
+ * Optional filter to specify which items this credit block applies to. If not
695
+ * specified, the block will apply to all items for the pricing unit.
696
+ */
697
+ filters?: Array<AddIncrementCreditLedgerEntryRequestParams.Filter> | null;
698
+ /**
699
+ * Passing `invoice_settings` automatically generates an invoice for the newly
700
+ * added credits. If `invoice_settings` is passed, you must specify
701
+ * per_unit_cost_basis, as the calculation of the invoice total is done on that
702
+ * basis.
703
+ */
704
+ invoice_settings?: AddIncrementCreditLedgerEntryRequestParams.InvoiceSettings | null;
705
+ /**
706
+ * User-specified key/value pairs for the resource. Individual keys can be removed
707
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
708
+ * by setting `metadata` to `null`.
709
+ */
710
+ metadata?: {
711
+ [key: string]: string | null;
712
+ } | null;
713
+ /**
714
+ * Can only be specified when entry_type=increment. How much, in the customer's
715
+ * currency, a customer paid for a single credit in this block
716
+ */
717
+ per_unit_cost_basis?: string | null;
718
+ }
719
+ namespace AddIncrementCreditLedgerEntryRequestParams {
720
+ /**
721
+ * A PriceFilter that only allows item_id field for block filters.
722
+ */
723
+ interface Filter {
724
+ /**
725
+ * The property of the price the block applies to. Only item_id is supported.
726
+ */
727
+ field: 'item_id';
728
+ /**
729
+ * Should prices that match the filter be included or excluded.
730
+ */
731
+ operator: 'includes' | 'excludes';
732
+ /**
733
+ * The IDs or values that match this filter.
734
+ */
735
+ values: Array<string>;
736
+ }
737
+ /**
738
+ * Passing `invoice_settings` automatically generates an invoice for the newly
739
+ * added credits. If `invoice_settings` is passed, you must specify
740
+ * per_unit_cost_basis, as the calculation of the invoice total is done on that
741
+ * basis.
742
+ */
743
+ interface InvoiceSettings {
744
+ /**
745
+ * Whether the credits purchase invoice should auto collect with the customer's
746
+ * saved payment method.
747
+ */
748
+ auto_collection: boolean;
749
+ /**
750
+ * An optional custom due date for the invoice. If not set, the due date will be
751
+ * calculated based on the `net_terms` value.
752
+ */
753
+ custom_due_date?: (string & {}) | (string & {}) | null;
754
+ /**
755
+ * An ISO 8601 format date that denotes when this invoice should be dated in the
756
+ * customer's timezone. If not provided, the invoice date will default to the
757
+ * credit block's effective date.
758
+ */
759
+ invoice_date?: (string & {}) | (string & {}) | null;
760
+ /**
761
+ * The ID of the Item to be used for the invoice line item. If not provided, a
762
+ * default 'Credits' item will be used.
763
+ */
764
+ item_id?: string | null;
765
+ /**
766
+ * If true, the new credits purchase invoice will be marked as paid.
767
+ */
768
+ mark_as_paid?: boolean;
769
+ /**
770
+ * An optional memo to display on the invoice.
771
+ */
772
+ memo?: string | null;
773
+ /**
774
+ * The net terms determines the due date of the invoice. Due date is calculated
775
+ * based on the invoice or issuance date, depending on the account's configured due
776
+ * date calculation method. A value of '0' here represents that the invoice is due
777
+ * on issue, whereas a value of '30' represents that the customer has 30 days to
778
+ * pay the invoice. You must set either `net_terms` or `custom_due_date`, but not
779
+ * both.
780
+ */
781
+ net_terms?: number | null;
782
+ /**
783
+ * If true, the new credit block will require that the corresponding invoice is
784
+ * paid before it can be drawn down from.
785
+ */
786
+ require_successful_payment?: boolean;
787
+ }
788
+ }
789
+ interface AddDecrementCreditLedgerEntryRequestParams {
790
+ /**
791
+ * The number of credits to effect. Note that this is required for increment,
792
+ * decrement, void, or undo operations.
793
+ */
794
+ amount: number;
795
+ entry_type: 'decrement';
796
+ /**
797
+ * The currency or custom pricing unit to use for this ledger entry. If this is a
798
+ * real-world currency, it must match the customer's invoicing currency.
799
+ */
800
+ currency?: string | null;
801
+ /**
802
+ * Optional metadata that can be specified when adding ledger results via the API.
803
+ * For example, this can be used to note an increment refers to trial credits, or
804
+ * for noting corrections as a result of an incident, etc.
805
+ */
806
+ description?: string | null;
807
+ /**
808
+ * User-specified key/value pairs for the resource. Individual keys can be removed
809
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
810
+ * by setting `metadata` to `null`.
811
+ */
812
+ metadata?: {
813
+ [key: string]: string | null;
814
+ } | null;
815
+ }
816
+ interface AddExpirationChangeCreditLedgerEntryRequestParams {
817
+ entry_type: 'expiration_change';
818
+ /**
819
+ * A date (specified in YYYY-MM-DD format) used for expiration change, denoting
820
+ * when credits transferred (as part of a partial block expiration) should expire.
821
+ * This date must be on or after the effective date of the credit block.
822
+ */
823
+ target_expiry_date: string;
824
+ /**
825
+ * The number of credits to effect. Note that this is required for increment,
826
+ * decrement, void, or undo operations.
827
+ */
828
+ amount?: number | null;
829
+ /**
830
+ * The ID of the block affected by an expiration_change, used to differentiate
831
+ * between multiple blocks with the same `expiry_date`.
832
+ */
833
+ block_id?: string | null;
834
+ /**
835
+ * The currency or custom pricing unit to use for this ledger entry. If this is a
836
+ * real-world currency, it must match the customer's invoicing currency.
837
+ */
838
+ currency?: string | null;
839
+ /**
840
+ * Optional metadata that can be specified when adding ledger results via the API.
841
+ * For example, this can be used to note an increment refers to trial credits, or
842
+ * for noting corrections as a result of an incident, etc.
843
+ */
844
+ description?: string | null;
845
+ /**
846
+ * An ISO 8601 format date that identifies the origination credit block to expire
847
+ */
848
+ expiry_date?: string | null;
849
+ /**
850
+ * User-specified key/value pairs for the resource. Individual keys can be removed
851
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
852
+ * by setting `metadata` to `null`.
853
+ */
854
+ metadata?: {
855
+ [key: string]: string | null;
856
+ } | null;
857
+ }
858
+ interface AddVoidCreditLedgerEntryRequestParams {
859
+ /**
860
+ * The number of credits to effect. Note that this is required for increment,
861
+ * decrement, void, or undo operations.
862
+ */
863
+ amount: number;
864
+ /**
865
+ * The ID of the block to void.
866
+ */
867
+ block_id: string;
868
+ entry_type: 'void';
869
+ /**
870
+ * The currency or custom pricing unit to use for this ledger entry. If this is a
871
+ * real-world currency, it must match the customer's invoicing currency.
872
+ */
873
+ currency?: string | null;
874
+ /**
875
+ * Optional metadata that can be specified when adding ledger results via the API.
876
+ * For example, this can be used to note an increment refers to trial credits, or
877
+ * for noting corrections as a result of an incident, etc.
878
+ */
879
+ description?: string | null;
880
+ /**
881
+ * User-specified key/value pairs for the resource. Individual keys can be removed
882
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
883
+ * by setting `metadata` to `null`.
884
+ */
885
+ metadata?: {
886
+ [key: string]: string | null;
887
+ } | null;
888
+ /**
889
+ * Can only be specified when `entry_type=void`. The reason for the void.
890
+ */
891
+ void_reason?: 'refund' | null;
892
+ }
893
+ interface AddAmendmentCreditLedgerEntryRequestParams {
894
+ /**
895
+ * The number of credits to effect. Note that this is required for increment,
896
+ * decrement or void operations.
897
+ */
898
+ amount: number;
899
+ /**
900
+ * The ID of the block to reverse a decrement from.
901
+ */
902
+ block_id: string;
903
+ entry_type: 'amendment';
904
+ /**
905
+ * The currency or custom pricing unit to use for this ledger entry. If this is a
906
+ * real-world currency, it must match the customer's invoicing currency.
907
+ */
908
+ currency?: string | null;
909
+ /**
910
+ * Optional metadata that can be specified when adding ledger results via the API.
911
+ * For example, this can be used to note an increment refers to trial credits, or
912
+ * for noting corrections as a result of an incident, etc.
913
+ */
914
+ description?: string | null;
915
+ /**
916
+ * User-specified key/value pairs for the resource. Individual keys can be removed
917
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
918
+ * by setting `metadata` to `null`.
919
+ */
920
+ metadata?: {
921
+ [key: string]: string | null;
922
+ } | null;
923
+ }
924
+ }
925
+ export type LedgerCreateEntryByExternalIDParams = LedgerCreateEntryByExternalIDParams.AddIncrementCreditLedgerEntryRequestParams | LedgerCreateEntryByExternalIDParams.AddDecrementCreditLedgerEntryRequestParams | LedgerCreateEntryByExternalIDParams.AddExpirationChangeCreditLedgerEntryRequestParams | LedgerCreateEntryByExternalIDParams.AddVoidCreditLedgerEntryRequestParams | LedgerCreateEntryByExternalIDParams.AddAmendmentCreditLedgerEntryRequestParams;
926
+ export declare namespace LedgerCreateEntryByExternalIDParams {
927
+ interface AddIncrementCreditLedgerEntryRequestParams {
928
+ /**
929
+ * The number of credits to effect. Note that this is required for increment,
930
+ * decrement, void, or undo operations.
931
+ */
932
+ amount: number;
933
+ entry_type: 'increment';
934
+ /**
935
+ * The currency or custom pricing unit to use for this ledger entry. If this is a
936
+ * real-world currency, it must match the customer's invoicing currency.
937
+ */
938
+ currency?: string | null;
939
+ /**
940
+ * Optional metadata that can be specified when adding ledger results via the API.
941
+ * For example, this can be used to note an increment refers to trial credits, or
942
+ * for noting corrections as a result of an incident, etc.
943
+ */
944
+ description?: string | null;
945
+ /**
946
+ * An ISO 8601 format date that denotes when this credit balance should become
947
+ * available for use.
948
+ */
949
+ effective_date?: string | null;
950
+ /**
951
+ * An ISO 8601 format date that denotes when this credit balance should expire.
952
+ */
953
+ expiry_date?: string | null;
954
+ /**
955
+ * Optional filter to specify which items this credit block applies to. If not
956
+ * specified, the block will apply to all items for the pricing unit.
957
+ */
958
+ filters?: Array<AddIncrementCreditLedgerEntryRequestParams.Filter> | null;
959
+ /**
960
+ * Passing `invoice_settings` automatically generates an invoice for the newly
961
+ * added credits. If `invoice_settings` is passed, you must specify
962
+ * per_unit_cost_basis, as the calculation of the invoice total is done on that
963
+ * basis.
964
+ */
965
+ invoice_settings?: AddIncrementCreditLedgerEntryRequestParams.InvoiceSettings | null;
966
+ /**
967
+ * User-specified key/value pairs for the resource. Individual keys can be removed
968
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
969
+ * by setting `metadata` to `null`.
970
+ */
971
+ metadata?: {
972
+ [key: string]: string | null;
973
+ } | null;
974
+ /**
975
+ * Can only be specified when entry_type=increment. How much, in the customer's
976
+ * currency, a customer paid for a single credit in this block
977
+ */
978
+ per_unit_cost_basis?: string | null;
979
+ }
980
+ namespace AddIncrementCreditLedgerEntryRequestParams {
981
+ /**
982
+ * A PriceFilter that only allows item_id field for block filters.
983
+ */
984
+ interface Filter {
985
+ /**
986
+ * The property of the price the block applies to. Only item_id is supported.
987
+ */
988
+ field: 'item_id';
989
+ /**
990
+ * Should prices that match the filter be included or excluded.
991
+ */
992
+ operator: 'includes' | 'excludes';
993
+ /**
994
+ * The IDs or values that match this filter.
995
+ */
996
+ values: Array<string>;
997
+ }
998
+ /**
999
+ * Passing `invoice_settings` automatically generates an invoice for the newly
1000
+ * added credits. If `invoice_settings` is passed, you must specify
1001
+ * per_unit_cost_basis, as the calculation of the invoice total is done on that
1002
+ * basis.
1003
+ */
1004
+ interface InvoiceSettings {
1005
+ /**
1006
+ * Whether the credits purchase invoice should auto collect with the customer's
1007
+ * saved payment method.
1008
+ */
1009
+ auto_collection: boolean;
1010
+ /**
1011
+ * An optional custom due date for the invoice. If not set, the due date will be
1012
+ * calculated based on the `net_terms` value.
1013
+ */
1014
+ custom_due_date?: (string & {}) | (string & {}) | null;
1015
+ /**
1016
+ * An ISO 8601 format date that denotes when this invoice should be dated in the
1017
+ * customer's timezone. If not provided, the invoice date will default to the
1018
+ * credit block's effective date.
1019
+ */
1020
+ invoice_date?: (string & {}) | (string & {}) | null;
1021
+ /**
1022
+ * The ID of the Item to be used for the invoice line item. If not provided, a
1023
+ * default 'Credits' item will be used.
1024
+ */
1025
+ item_id?: string | null;
1026
+ /**
1027
+ * If true, the new credits purchase invoice will be marked as paid.
1028
+ */
1029
+ mark_as_paid?: boolean;
1030
+ /**
1031
+ * An optional memo to display on the invoice.
1032
+ */
1033
+ memo?: string | null;
1034
+ /**
1035
+ * The net terms determines the due date of the invoice. Due date is calculated
1036
+ * based on the invoice or issuance date, depending on the account's configured due
1037
+ * date calculation method. A value of '0' here represents that the invoice is due
1038
+ * on issue, whereas a value of '30' represents that the customer has 30 days to
1039
+ * pay the invoice. You must set either `net_terms` or `custom_due_date`, but not
1040
+ * both.
1041
+ */
1042
+ net_terms?: number | null;
1043
+ /**
1044
+ * If true, the new credit block will require that the corresponding invoice is
1045
+ * paid before it can be drawn down from.
1046
+ */
1047
+ require_successful_payment?: boolean;
1048
+ }
1049
+ }
1050
+ interface AddDecrementCreditLedgerEntryRequestParams {
1051
+ /**
1052
+ * The number of credits to effect. Note that this is required for increment,
1053
+ * decrement, void, or undo operations.
1054
+ */
1055
+ amount: number;
1056
+ entry_type: 'decrement';
1057
+ /**
1058
+ * The currency or custom pricing unit to use for this ledger entry. If this is a
1059
+ * real-world currency, it must match the customer's invoicing currency.
1060
+ */
1061
+ currency?: string | null;
1062
+ /**
1063
+ * Optional metadata that can be specified when adding ledger results via the API.
1064
+ * For example, this can be used to note an increment refers to trial credits, or
1065
+ * for noting corrections as a result of an incident, etc.
1066
+ */
1067
+ description?: string | null;
1068
+ /**
1069
+ * User-specified key/value pairs for the resource. Individual keys can be removed
1070
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
1071
+ * by setting `metadata` to `null`.
1072
+ */
1073
+ metadata?: {
1074
+ [key: string]: string | null;
1075
+ } | null;
1076
+ }
1077
+ interface AddExpirationChangeCreditLedgerEntryRequestParams {
1078
+ entry_type: 'expiration_change';
1079
+ /**
1080
+ * A date (specified in YYYY-MM-DD format) used for expiration change, denoting
1081
+ * when credits transferred (as part of a partial block expiration) should expire.
1082
+ * This date must be on or after the effective date of the credit block.
1083
+ */
1084
+ target_expiry_date: string;
1085
+ /**
1086
+ * The number of credits to effect. Note that this is required for increment,
1087
+ * decrement, void, or undo operations.
1088
+ */
1089
+ amount?: number | null;
1090
+ /**
1091
+ * The ID of the block affected by an expiration_change, used to differentiate
1092
+ * between multiple blocks with the same `expiry_date`.
1093
+ */
1094
+ block_id?: string | null;
1095
+ /**
1096
+ * The currency or custom pricing unit to use for this ledger entry. If this is a
1097
+ * real-world currency, it must match the customer's invoicing currency.
1098
+ */
1099
+ currency?: string | null;
1100
+ /**
1101
+ * Optional metadata that can be specified when adding ledger results via the API.
1102
+ * For example, this can be used to note an increment refers to trial credits, or
1103
+ * for noting corrections as a result of an incident, etc.
1104
+ */
1105
+ description?: string | null;
1106
+ /**
1107
+ * An ISO 8601 format date that identifies the origination credit block to expire
1108
+ */
1109
+ expiry_date?: string | null;
1110
+ /**
1111
+ * User-specified key/value pairs for the resource. Individual keys can be removed
1112
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
1113
+ * by setting `metadata` to `null`.
1114
+ */
1115
+ metadata?: {
1116
+ [key: string]: string | null;
1117
+ } | null;
1118
+ }
1119
+ interface AddVoidCreditLedgerEntryRequestParams {
1120
+ /**
1121
+ * The number of credits to effect. Note that this is required for increment,
1122
+ * decrement, void, or undo operations.
1123
+ */
1124
+ amount: number;
1125
+ /**
1126
+ * The ID of the block to void.
1127
+ */
1128
+ block_id: string;
1129
+ entry_type: 'void';
1130
+ /**
1131
+ * The currency or custom pricing unit to use for this ledger entry. If this is a
1132
+ * real-world currency, it must match the customer's invoicing currency.
1133
+ */
1134
+ currency?: string | null;
1135
+ /**
1136
+ * Optional metadata that can be specified when adding ledger results via the API.
1137
+ * For example, this can be used to note an increment refers to trial credits, or
1138
+ * for noting corrections as a result of an incident, etc.
1139
+ */
1140
+ description?: string | null;
1141
+ /**
1142
+ * User-specified key/value pairs for the resource. Individual keys can be removed
1143
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
1144
+ * by setting `metadata` to `null`.
1145
+ */
1146
+ metadata?: {
1147
+ [key: string]: string | null;
1148
+ } | null;
1149
+ /**
1150
+ * Can only be specified when `entry_type=void`. The reason for the void.
1151
+ */
1152
+ void_reason?: 'refund' | null;
1153
+ }
1154
+ interface AddAmendmentCreditLedgerEntryRequestParams {
1155
+ /**
1156
+ * The number of credits to effect. Note that this is required for increment,
1157
+ * decrement or void operations.
1158
+ */
1159
+ amount: number;
1160
+ /**
1161
+ * The ID of the block to reverse a decrement from.
1162
+ */
1163
+ block_id: string;
1164
+ entry_type: 'amendment';
1165
+ /**
1166
+ * The currency or custom pricing unit to use for this ledger entry. If this is a
1167
+ * real-world currency, it must match the customer's invoicing currency.
1168
+ */
1169
+ currency?: string | null;
1170
+ /**
1171
+ * Optional metadata that can be specified when adding ledger results via the API.
1172
+ * For example, this can be used to note an increment refers to trial credits, or
1173
+ * for noting corrections as a result of an incident, etc.
1174
+ */
1175
+ description?: string | null;
1176
+ /**
1177
+ * User-specified key/value pairs for the resource. Individual keys can be removed
1178
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
1179
+ * by setting `metadata` to `null`.
1180
+ */
1181
+ metadata?: {
1182
+ [key: string]: string | null;
1183
+ } | null;
1184
+ }
1185
+ }
1186
+ export interface LedgerListByExternalIDParams extends PageParams {
1187
+ 'created_at[gt]'?: string | null;
1188
+ 'created_at[gte]'?: string | null;
1189
+ 'created_at[lt]'?: string | null;
1190
+ 'created_at[lte]'?: string | null;
1191
+ /**
1192
+ * The ledger currency or custom pricing unit to use.
1193
+ */
1194
+ currency?: string | null;
1195
+ entry_status?: 'committed' | 'pending' | null;
1196
+ entry_type?: 'increment' | 'decrement' | 'expiration_change' | 'credit_block_expiry' | 'void' | 'void_initiated' | 'amendment' | null;
1197
+ minimum_amount?: string | null;
1198
+ }
1199
+ export declare namespace Ledger {
1200
+ export { type AffectedBlock as AffectedBlock, type AmendmentLedgerEntry as AmendmentLedgerEntry, type CreditBlockExpiryLedgerEntry as CreditBlockExpiryLedgerEntry, type DecrementLedgerEntry as DecrementLedgerEntry, type ExpirationChangeLedgerEntry as ExpirationChangeLedgerEntry, type IncrementLedgerEntry as IncrementLedgerEntry, type VoidInitiatedLedgerEntry as VoidInitiatedLedgerEntry, type VoidLedgerEntry as VoidLedgerEntry, type LedgerListResponse as LedgerListResponse, type LedgerCreateEntryResponse as LedgerCreateEntryResponse, type LedgerCreateEntryByExternalIDResponse as LedgerCreateEntryByExternalIDResponse, type LedgerListByExternalIDResponse as LedgerListByExternalIDResponse, type LedgerListResponsesPage as LedgerListResponsesPage, type LedgerListByExternalIDResponsesPage as LedgerListByExternalIDResponsesPage, type LedgerListParams as LedgerListParams, type LedgerCreateEntryParams as LedgerCreateEntryParams, type LedgerCreateEntryByExternalIDParams as LedgerCreateEntryByExternalIDParams, type LedgerListByExternalIDParams as LedgerListByExternalIDParams, };
1201
+ }
1202
+ //# sourceMappingURL=ledger.d.mts.map