orb-billing 5.76.0 → 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 +23 -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 +6 -5
  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 +11 -15
  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 +10 -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 +12 -12
  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 +26 -52
  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 +16 -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,1795 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import * as Shared from "./shared.mjs";
3
+ import { InvoicesPage } from "./shared.mjs";
4
+ import { APIPromise } from "../core/api-promise.mjs";
5
+ import { Page, type PageParams, PagePromise } from "../core/pagination.mjs";
6
+ import { RequestOptions } from "../internal/request-options.mjs";
7
+ /**
8
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the request for payment for
9
+ * a single subscription. This includes a set of line items, which correspond to prices in the subscription's plan and
10
+ * can represent fixed recurring fees or usage-based fees. They are generated at the end of a billing period, or as
11
+ * the result of an action, such as a cancellation.
12
+ */
13
+ export declare class Invoices extends APIResource {
14
+ /**
15
+ * This endpoint is used to create a one-off invoice for a customer.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const invoice = await client.invoices.create({
20
+ * currency: 'USD',
21
+ * invoice_date: '2019-12-27T18:11:19.117Z',
22
+ * line_items: [
23
+ * {
24
+ * end_date: '2023-09-22',
25
+ * item_id: '4khy3nwzktxv7',
26
+ * model_type: 'unit',
27
+ * name: 'Line Item Name',
28
+ * quantity: 1,
29
+ * start_date: '2023-09-22',
30
+ * unit_config: { unit_amount: 'unit_amount' },
31
+ * },
32
+ * ],
33
+ * });
34
+ * ```
35
+ */
36
+ create(body: InvoiceCreateParams, options?: RequestOptions): APIPromise<Shared.Invoice>;
37
+ /**
38
+ * This endpoint allows you to update the `metadata`, `net_terms`, `due_date`,
39
+ * `invoice_date`, and `auto_collection` properties on an invoice. If you pass null
40
+ * for the metadata value, it will clear any existing metadata for that invoice.
41
+ *
42
+ * `metadata` can be modified regardless of invoice state. `net_terms`, `due_date`,
43
+ * `invoice_date`, and `auto_collection` can only be modified if the invoice is in
44
+ * a `draft` state. `invoice_date` can only be modified for non-subscription
45
+ * invoices.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const invoice = await client.invoices.update('invoice_id');
50
+ * ```
51
+ */
52
+ update(invoiceId: string, body: InvoiceUpdateParams, options?: RequestOptions): APIPromise<Shared.Invoice>;
53
+ /**
54
+ * This endpoint returns a list of all [`Invoice`](/core-concepts#invoice)s for an
55
+ * account in a list format.
56
+ *
57
+ * The list of invoices is ordered starting from the most recently issued invoice
58
+ * date. The response also includes
59
+ * [`pagination_metadata`](/api-reference/pagination), which lets the caller
60
+ * retrieve the next page of results if they exist.
61
+ *
62
+ * By default, this only returns invoices that are `issued`, `paid`, or `synced`.
63
+ *
64
+ * When fetching any `draft` invoices, this returns the last-computed invoice
65
+ * values for each draft invoice, which may not always be up-to-date since Orb
66
+ * regularly refreshes invoices asynchronously.
67
+ *
68
+ * If you don't need line item details, minimums, maximums, or discounts, prefer
69
+ * the [list invoices summary](/api-reference/invoice/list-invoices-summary)
70
+ * endpoint for better performance.
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * // Automatically fetches more pages as needed.
75
+ * for await (const invoice of client.invoices.list()) {
76
+ * // ...
77
+ * }
78
+ * ```
79
+ */
80
+ list(query?: InvoiceListParams | null | undefined, options?: RequestOptions): PagePromise<InvoicesPage, Shared.Invoice>;
81
+ /**
82
+ * This endpoint deletes an invoice line item from a draft invoice.
83
+ *
84
+ * This endpoint only allows deletion of one-off line items (not subscription-based
85
+ * line items). The invoice must be in a draft status for this operation to
86
+ * succeed.
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * await client.invoices.deleteLineItem('line_item_id', {
91
+ * invoice_id: 'invoice_id',
92
+ * });
93
+ * ```
94
+ */
95
+ deleteLineItem(lineItemId: string, params: InvoiceDeleteLineItemParams, options?: RequestOptions): APIPromise<void>;
96
+ /**
97
+ * This endpoint is used to fetch an [`Invoice`](/core-concepts#invoice) given an
98
+ * identifier.
99
+ *
100
+ * @example
101
+ * ```ts
102
+ * const invoice = await client.invoices.fetch('invoice_id');
103
+ * ```
104
+ */
105
+ fetch(invoiceId: string, options?: RequestOptions): APIPromise<Shared.Invoice>;
106
+ /**
107
+ * This endpoint can be used to fetch the upcoming
108
+ * [invoice](/core-concepts#invoice) for the current billing period given a
109
+ * subscription.
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * const response = await client.invoices.fetchUpcoming({
114
+ * subscription_id: 'subscription_id',
115
+ * });
116
+ * ```
117
+ */
118
+ fetchUpcoming(query: InvoiceFetchUpcomingParams, options?: RequestOptions): APIPromise<InvoiceFetchUpcomingResponse>;
119
+ /**
120
+ * This endpoint allows an eligible invoice to be issued manually. This is only
121
+ * possible with invoices where status is `draft`, `will_auto_issue` is false, and
122
+ * an `eligible_to_issue_at` is a time in the past. Issuing an invoice could
123
+ * possibly trigger side effects, some of which could be customer-visible (e.g.
124
+ * sending emails, auto-collecting payment, syncing the invoice to external
125
+ * providers, etc).
126
+ *
127
+ * @example
128
+ * ```ts
129
+ * const invoice = await client.invoices.issue('invoice_id');
130
+ * ```
131
+ */
132
+ issue(invoiceId: string, body?: InvoiceIssueParams | null | undefined, options?: RequestOptions): APIPromise<Shared.Invoice>;
133
+ /**
134
+ * This endpoint allows an eligible invoice to be issued manually. This is only
135
+ * possible with invoices where status is `draft`, `will_auto_issue` is false, and
136
+ * an `eligible_to_issue_at` is a time in the past. Issuing an invoice could
137
+ * possibly trigger side effects, some of which could be customer-visible (e.g.
138
+ * sending emails, auto-collecting payment, syncing the invoice to external
139
+ * providers, etc).
140
+ *
141
+ * This is a lighter-weight alternative to the issue invoice endpoint, returning an
142
+ * invoice summary without any line item details.
143
+ *
144
+ * @example
145
+ * ```ts
146
+ * const response = await client.invoices.issueSummary(
147
+ * 'invoice_id',
148
+ * );
149
+ * ```
150
+ */
151
+ issueSummary(invoiceId: string, body?: InvoiceIssueSummaryParams | null | undefined, options?: RequestOptions): APIPromise<InvoiceIssueSummaryResponse>;
152
+ /**
153
+ * This is a lighter-weight endpoint that returns a list of all
154
+ * [`Invoice`](/core-concepts#invoice) summaries for an account in a list format.
155
+ *
156
+ * These invoice summaries do not include line item details, minimums, maximums,
157
+ * and discounts, making this endpoint more efficient.
158
+ *
159
+ * The list of invoices is ordered starting from the most recently issued invoice
160
+ * date. The response also includes
161
+ * [`pagination_metadata`](/api-reference/pagination), which lets the caller
162
+ * retrieve the next page of results if they exist.
163
+ *
164
+ * By default, this only returns invoices that are `issued`, `paid`, or `synced`.
165
+ *
166
+ * When fetching any `draft` invoices, this returns the last-computed invoice
167
+ * values for each draft invoice, which may not always be up-to-date since Orb
168
+ * regularly refreshes invoices asynchronously.
169
+ *
170
+ * @example
171
+ * ```ts
172
+ * // Automatically fetches more pages as needed.
173
+ * for await (const invoiceListSummaryResponse of client.invoices.listSummary()) {
174
+ * // ...
175
+ * }
176
+ * ```
177
+ */
178
+ listSummary(query?: InvoiceListSummaryParams | null | undefined, options?: RequestOptions): PagePromise<InvoiceListSummaryResponsesPage, InvoiceListSummaryResponse>;
179
+ /**
180
+ * This endpoint allows an invoice's status to be set to the `paid` status. This
181
+ * can only be done to invoices that are in the `issued` or `synced` status.
182
+ *
183
+ * @example
184
+ * ```ts
185
+ * const invoice = await client.invoices.markPaid(
186
+ * 'invoice_id',
187
+ * { payment_received_date: '2023-09-22' },
188
+ * );
189
+ * ```
190
+ */
191
+ markPaid(invoiceId: string, body: InvoiceMarkPaidParams, options?: RequestOptions): APIPromise<Shared.Invoice>;
192
+ /**
193
+ * This endpoint collects payment for an invoice. By default, it uses the
194
+ * customer's default payment method. Optionally, a shared payment token (SPT) can
195
+ * be provided to pay using agent-granted credentials instead. This action can only
196
+ * be taken on invoices with status "issued".
197
+ *
198
+ * @example
199
+ * ```ts
200
+ * const invoice = await client.invoices.pay('invoice_id', {
201
+ * shared_payment_token_id: 'shared_payment_token_id',
202
+ * });
203
+ * ```
204
+ */
205
+ pay(invoiceId: string, body: InvoicePayParams, options?: RequestOptions): APIPromise<Shared.Invoice>;
206
+ /**
207
+ * This endpoint allows an invoice's status to be set to the `void` status. This
208
+ * can only be done to invoices that are in the `issued` status.
209
+ *
210
+ * If the associated invoice has used the customer balance to change the amount
211
+ * due, the customer balance operation will be reverted. For example, if the
212
+ * invoice used \$10 of customer balance, that amount will be added back to the
213
+ * customer balance upon voiding.
214
+ *
215
+ * If the invoice was used to purchase a credit block, but the invoice is not yet
216
+ * paid, the credit block will be voided. If the invoice was created due to a
217
+ * top-up, the top-up will be disabled.
218
+ *
219
+ * @example
220
+ * ```ts
221
+ * const invoice = await client.invoices.void('invoice_id');
222
+ * ```
223
+ */
224
+ void(invoiceId: string, options?: RequestOptions): APIPromise<Shared.Invoice>;
225
+ }
226
+ export type InvoiceListSummaryResponsesPage = Page<InvoiceListSummaryResponse>;
227
+ export interface InvoiceFetchUpcomingResponse {
228
+ id: string;
229
+ /**
230
+ * This is the final amount required to be charged to the customer and reflects the
231
+ * application of the customer balance to the `total` of the invoice.
232
+ */
233
+ amount_due: string;
234
+ auto_collection: InvoiceFetchUpcomingResponse.AutoCollection;
235
+ billing_address: Shared.Address | null;
236
+ /**
237
+ * The creation time of the resource in Orb.
238
+ */
239
+ created_at: string;
240
+ /**
241
+ * A list of credit notes associated with the invoice
242
+ */
243
+ credit_notes: Array<InvoiceFetchUpcomingResponse.CreditNote>;
244
+ /**
245
+ * An ISO 4217 currency string or `credits`
246
+ */
247
+ currency: string;
248
+ customer: Shared.CustomerMinified;
249
+ customer_balance_transactions: Array<InvoiceFetchUpcomingResponse.CustomerBalanceTransaction>;
250
+ /**
251
+ * Tax IDs are commonly required to be displayed on customer invoices, which are
252
+ * added to the headers of invoices.
253
+ *
254
+ * ### Supported Tax ID Countries and Types
255
+ *
256
+ * | Country | Type | Description |
257
+ * | ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
258
+ * | Albania | `al_tin` | Albania Tax Identification Number |
259
+ * | Andorra | `ad_nrt` | Andorran NRT Number |
260
+ * | Angola | `ao_tin` | Angola Tax Identification Number |
261
+ * | Argentina | `ar_cuit` | Argentinian Tax ID Number |
262
+ * | Armenia | `am_tin` | Armenia Tax Identification Number |
263
+ * | Aruba | `aw_tin` | Aruba Tax Identification Number |
264
+ * | Australia | `au_abn` | Australian Business Number (AU ABN) |
265
+ * | Australia | `au_arn` | Australian Taxation Office Reference Number |
266
+ * | Austria | `eu_vat` | European VAT Number |
267
+ * | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number |
268
+ * | Bahamas | `bs_tin` | Bahamas Tax Identification Number |
269
+ * | Bahrain | `bh_vat` | Bahraini VAT Number |
270
+ * | Bangladesh | `bd_bin` | Bangladesh Business Identification Number |
271
+ * | Barbados | `bb_tin` | Barbados Tax Identification Number |
272
+ * | Belarus | `by_tin` | Belarus TIN Number |
273
+ * | Belgium | `eu_vat` | European VAT Number |
274
+ * | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) |
275
+ * | Bolivia | `bo_tin` | Bolivian Tax ID |
276
+ * | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number |
277
+ * | Brazil | `br_cnpj` | Brazilian CNPJ Number |
278
+ * | Brazil | `br_cpf` | Brazilian CPF Number |
279
+ * | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
280
+ * | Bulgaria | `eu_vat` | European VAT Number |
281
+ * | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) |
282
+ * | Cambodia | `kh_tin` | Cambodia Tax Identification Number |
283
+ * | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) |
284
+ * | Canada | `ca_bn` | Canadian BN |
285
+ * | Canada | `ca_gst_hst` | Canadian GST/HST Number |
286
+ * | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) |
287
+ * | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) |
288
+ * | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) |
289
+ * | Canada | `ca_qst` | Canadian QST Number (Québec) |
290
+ * | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) |
291
+ * | Chile | `cl_tin` | Chilean TIN |
292
+ * | China | `cn_tin` | Chinese Tax ID |
293
+ * | Colombia | `co_nit` | Colombian NIT Number |
294
+ * | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) |
295
+ * | Costa Rica | `cr_tin` | Costa Rican Tax ID |
296
+ * | Croatia | `eu_vat` | European VAT Number |
297
+ * | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) |
298
+ * | Cyprus | `eu_vat` | European VAT Number |
299
+ * | Czech Republic | `eu_vat` | European VAT Number |
300
+ * | Denmark | `eu_vat` | European VAT Number |
301
+ * | Dominican Republic | `do_rcn` | Dominican RCN Number |
302
+ * | Ecuador | `ec_ruc` | Ecuadorian RUC Number |
303
+ * | Egypt | `eg_tin` | Egyptian Tax Identification Number |
304
+ * | El Salvador | `sv_nit` | El Salvadorian NIT Number |
305
+ * | Estonia | `eu_vat` | European VAT Number |
306
+ * | Ethiopia | `et_tin` | Ethiopia Tax Identification Number |
307
+ * | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
308
+ * | Faroe Islands | `fo_vat` | Faroe Islands VAT Number |
309
+ * | Finland | `eu_vat` | European VAT Number |
310
+ * | France | `eu_vat` | European VAT Number |
311
+ * | Georgia | `ge_vat` | Georgian VAT |
312
+ * | Germany | `de_stn` | German Tax Number (Steuernummer) |
313
+ * | Germany | `eu_vat` | European VAT Number |
314
+ * | Gibraltar | `gi_tin` | Gibraltar Tax Identification Number |
315
+ * | Greece | `eu_vat` | European VAT Number |
316
+ * | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) |
317
+ * | Hong Kong | `hk_br` | Hong Kong BR Number |
318
+ * | Hungary | `eu_vat` | European VAT Number |
319
+ * | Hungary | `hu_tin` | Hungary Tax Number (adószám) |
320
+ * | Iceland | `is_vat` | Icelandic VAT |
321
+ * | India | `in_gst` | Indian GST Number |
322
+ * | Indonesia | `id_npwp` | Indonesian NPWP Number |
323
+ * | Ireland | `eu_vat` | European VAT Number |
324
+ * | Israel | `il_vat` | Israel VAT |
325
+ * | Italy | `eu_vat` | European VAT Number |
326
+ * | Italy | `it_cf` | Italian Codice Fiscale Number |
327
+ * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
328
+ * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
329
+ * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
330
+ * | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number |
331
+ * | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
332
+ * | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number |
333
+ * | Laos | `la_tin` | Laos Tax Identification Number |
334
+ * | Latvia | `eu_vat` | European VAT Number |
335
+ * | Liechtenstein | `li_uid` | Liechtensteinian UID Number |
336
+ * | Liechtenstein | `li_vat` | Liechtenstein VAT Number |
337
+ * | Lithuania | `eu_vat` | European VAT Number |
338
+ * | Luxembourg | `eu_vat` | European VAT Number |
339
+ * | Malaysia | `my_frp` | Malaysian FRP Number |
340
+ * | Malaysia | `my_itn` | Malaysian ITN |
341
+ * | Malaysia | `my_sst` | Malaysian SST Number |
342
+ * | Malta | `eu_vat` | European VAT Number |
343
+ * | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) |
344
+ * | Mexico | `mx_rfc` | Mexican RFC Number |
345
+ * | Moldova | `md_vat` | Moldova VAT Number |
346
+ * | Montenegro | `me_pib` | Montenegro PIB Number |
347
+ * | Morocco | `ma_vat` | Morocco VAT Number |
348
+ * | Nepal | `np_pan` | Nepal PAN Number |
349
+ * | Netherlands | `eu_vat` | European VAT Number |
350
+ * | New Zealand | `nz_gst` | New Zealand GST Number |
351
+ * | Nigeria | `ng_tin` | Nigerian Tax Identification Number |
352
+ * | North Macedonia | `mk_vat` | North Macedonia VAT Number |
353
+ * | Northern Ireland | `eu_vat` | Northern Ireland VAT Number |
354
+ * | Norway | `no_vat` | Norwegian VAT Number |
355
+ * | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
356
+ * | Oman | `om_vat` | Omani VAT Number |
357
+ * | Paraguay | `py_ruc` | Paraguayan RUC Number |
358
+ * | Peru | `pe_ruc` | Peruvian RUC Number |
359
+ * | Philippines | `ph_tin` | Philippines Tax Identification Number |
360
+ * | Poland | `eu_vat` | European VAT Number |
361
+ * | Poland | `pl_nip` | Polish Tax ID Number |
362
+ * | Portugal | `eu_vat` | European VAT Number |
363
+ * | Romania | `eu_vat` | European VAT Number |
364
+ * | Romania | `ro_tin` | Romanian Tax ID Number |
365
+ * | Russia | `ru_inn` | Russian INN |
366
+ * | Russia | `ru_kpp` | Russian KPP |
367
+ * | Saudi Arabia | `sa_vat` | Saudi Arabia VAT |
368
+ * | Senegal | `sn_ninea` | Senegal NINEA Number |
369
+ * | Serbia | `rs_pib` | Serbian PIB Number |
370
+ * | Singapore | `sg_gst` | Singaporean GST |
371
+ * | Singapore | `sg_uen` | Singaporean UEN |
372
+ * | Slovakia | `eu_vat` | European VAT Number |
373
+ * | Slovenia | `eu_vat` | European VAT Number |
374
+ * | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) |
375
+ * | South Africa | `za_vat` | South African VAT Number |
376
+ * | South Korea | `kr_brn` | Korean BRN |
377
+ * | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
378
+ * | Spain | `eu_vat` | European VAT Number |
379
+ * | Sri Lanka | `lk_vat` | Sri Lanka VAT Number |
380
+ * | Suriname | `sr_fin` | Suriname FIN Number |
381
+ * | Sweden | `eu_vat` | European VAT Number |
382
+ * | Switzerland | `ch_uid` | Switzerland UID Number |
383
+ * | Switzerland | `ch_vat` | Switzerland VAT Number |
384
+ * | Taiwan | `tw_vat` | Taiwanese VAT |
385
+ * | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number |
386
+ * | Tanzania | `tz_vat` | Tanzania VAT Number |
387
+ * | Thailand | `th_vat` | Thai VAT |
388
+ * | Turkey | `tr_tin` | Turkish Tax Identification Number |
389
+ * | Uganda | `ug_tin` | Uganda Tax Identification Number |
390
+ * | Ukraine | `ua_vat` | Ukrainian VAT |
391
+ * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
392
+ * | United Kingdom | `gb_vat` | United Kingdom VAT Number |
393
+ * | United States | `us_ein` | United States EIN |
394
+ * | Uruguay | `uy_ruc` | Uruguayan RUC Number |
395
+ * | Uzbekistan | `uz_tin` | Uzbekistan TIN Number |
396
+ * | Uzbekistan | `uz_vat` | Uzbekistan VAT Number |
397
+ * | Venezuela | `ve_rif` | Venezuelan RIF Number |
398
+ * | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
399
+ * | Zambia | `zm_tin` | Zambia Tax Identification Number |
400
+ * | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number |
401
+ */
402
+ customer_tax_id: Shared.CustomerTaxID | null;
403
+ /**
404
+ * @deprecated This field is deprecated in favor of `discounts`. If a `discounts`
405
+ * list is provided, the first discount in the list will be returned. If the list
406
+ * is empty, `None` will be returned.
407
+ */
408
+ discount: unknown;
409
+ discounts: Array<Shared.InvoiceLevelDiscount>;
410
+ /**
411
+ * When the invoice payment is due. The due date is null if the invoice is not yet
412
+ * finalized.
413
+ */
414
+ due_date: string | null;
415
+ /**
416
+ * If the invoice has a status of `draft`, this will be the time that the invoice
417
+ * will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is
418
+ * true, the invoice will automatically begin issuing at this time.
419
+ */
420
+ eligible_to_issue_at: string | null;
421
+ /**
422
+ * A URL for the customer-facing invoice portal. This URL expires 60 days after the
423
+ * link is generated, or 30 days after the invoice's due date — whichever is later.
424
+ */
425
+ hosted_invoice_url: string | null;
426
+ /**
427
+ * Automatically generated invoice number to help track and reconcile invoices.
428
+ * Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per
429
+ * account or customer.
430
+ */
431
+ invoice_number: string;
432
+ /**
433
+ * The link to download the PDF representation of the `Invoice`.
434
+ */
435
+ invoice_pdf: string | null;
436
+ invoice_source: 'subscription' | 'partial' | 'one_off';
437
+ /**
438
+ * If the invoice failed to issue, this will be the last time it failed to issue
439
+ * (even if it is now in a different state.)
440
+ */
441
+ issue_failed_at: string | null;
442
+ /**
443
+ * If the invoice has been issued, this will be the time it transitioned to
444
+ * `issued` (even if it is now in a different state.)
445
+ */
446
+ issued_at: string | null;
447
+ /**
448
+ * The breakdown of prices in this invoice.
449
+ */
450
+ line_items: Array<InvoiceFetchUpcomingResponse.LineItem>;
451
+ maximum: Shared.Maximum | null;
452
+ maximum_amount: string | null;
453
+ /**
454
+ * Free-form text which is available on the invoice PDF and the Orb invoice portal.
455
+ */
456
+ memo: string | null;
457
+ /**
458
+ * User specified key-value pairs for the resource. If not present, this defaults
459
+ * to an empty dictionary. Individual keys can be removed by setting the value to
460
+ * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
461
+ * `null`.
462
+ */
463
+ metadata: {
464
+ [key: string]: string;
465
+ };
466
+ minimum: Shared.Minimum | null;
467
+ minimum_amount: string | null;
468
+ /**
469
+ * If the invoice has a status of `paid`, this gives a timestamp when the invoice
470
+ * was paid.
471
+ */
472
+ paid_at: string | null;
473
+ /**
474
+ * A list of payment attempts associated with the invoice
475
+ */
476
+ payment_attempts: Array<InvoiceFetchUpcomingResponse.PaymentAttempt>;
477
+ /**
478
+ * If payment was attempted on this invoice but failed, this will be the time of
479
+ * the most recent attempt.
480
+ */
481
+ payment_failed_at: string | null;
482
+ /**
483
+ * If payment was attempted on this invoice, this will be the start time of the
484
+ * most recent attempt. This field is especially useful for delayed-notification
485
+ * payment mechanisms (like bank transfers), where payment can take 3 days or more.
486
+ */
487
+ payment_started_at: string | null;
488
+ /**
489
+ * If the invoice is in draft, this timestamp will reflect when the invoice is
490
+ * scheduled to be issued.
491
+ */
492
+ scheduled_issue_at: string | null;
493
+ shipping_address: Shared.Address | null;
494
+ status: 'issued' | 'paid' | 'synced' | 'void' | 'draft';
495
+ subscription: Shared.SubscriptionMinified | null;
496
+ /**
497
+ * The total before any discounts and minimums are applied.
498
+ */
499
+ subtotal: string;
500
+ /**
501
+ * If the invoice failed to sync, this will be the last time an external invoicing
502
+ * provider sync was attempted. This field will always be `null` for invoices using
503
+ * Orb Invoicing.
504
+ */
505
+ sync_failed_at: string | null;
506
+ /**
507
+ * The scheduled date of the invoice
508
+ */
509
+ target_date: string;
510
+ /**
511
+ * The total after any minimums and discounts have been applied.
512
+ */
513
+ total: string;
514
+ /**
515
+ * If the invoice has a status of `void`, this gives a timestamp when the invoice
516
+ * was voided.
517
+ */
518
+ voided_at: string | null;
519
+ /**
520
+ * This is true if the invoice will be automatically issued in the future, and
521
+ * false otherwise.
522
+ */
523
+ will_auto_issue: boolean;
524
+ }
525
+ export declare namespace InvoiceFetchUpcomingResponse {
526
+ interface AutoCollection {
527
+ /**
528
+ * True only if auto-collection is enabled for this invoice.
529
+ */
530
+ enabled: boolean | null;
531
+ /**
532
+ * If the invoice is scheduled for auto-collection, this field will reflect when
533
+ * the next attempt will occur. If dunning has been exhausted, or auto-collection
534
+ * is not enabled for this invoice, this field will be `null`.
535
+ */
536
+ next_attempt_at: string | null;
537
+ /**
538
+ * Number of auto-collection payment attempts.
539
+ */
540
+ num_attempts: number | null;
541
+ /**
542
+ * If Orb has ever attempted payment auto-collection for this invoice, this field
543
+ * will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
544
+ * this can be used to tell whether the invoice is currently in dunning (that is,
545
+ * `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or
546
+ * if dunning has been exhausted (`previously_attempted_at` is non-null, but
547
+ * `next_attempt_time` is null).
548
+ */
549
+ previously_attempted_at: string | null;
550
+ }
551
+ interface CreditNote {
552
+ id: string;
553
+ credit_note_number: string;
554
+ /**
555
+ * An optional memo supplied on the credit note.
556
+ */
557
+ memo: string | null;
558
+ reason: string;
559
+ total: string;
560
+ type: string;
561
+ /**
562
+ * If the credit note has a status of `void`, this gives a timestamp when the
563
+ * credit note was voided.
564
+ */
565
+ voided_at: string | null;
566
+ }
567
+ interface CustomerBalanceTransaction {
568
+ /**
569
+ * A unique id for this transaction.
570
+ */
571
+ id: string;
572
+ action: 'applied_to_invoice' | 'manual_adjustment' | 'prorated_refund' | 'revert_prorated_refund' | 'return_from_voiding' | 'credit_note_applied' | 'credit_note_voided' | 'overpayment_refund' | 'external_payment' | 'small_invoice_carryover';
573
+ /**
574
+ * The value of the amount changed in the transaction.
575
+ */
576
+ amount: string;
577
+ /**
578
+ * The creation time of this transaction.
579
+ */
580
+ created_at: string;
581
+ credit_note: Shared.CreditNoteTiny | null;
582
+ /**
583
+ * An optional description provided for manual customer balance adjustments.
584
+ */
585
+ description: string | null;
586
+ /**
587
+ * The new value of the customer's balance prior to the transaction, in the
588
+ * customer's currency.
589
+ */
590
+ ending_balance: string;
591
+ invoice: Shared.InvoiceTiny | null;
592
+ /**
593
+ * The original value of the customer's balance prior to the transaction, in the
594
+ * customer's currency.
595
+ */
596
+ starting_balance: string;
597
+ type: 'increment' | 'decrement';
598
+ }
599
+ interface LineItem {
600
+ /**
601
+ * A unique ID for this line item.
602
+ */
603
+ id: string;
604
+ /**
605
+ * The line amount after any adjustments and before overage conversion, credits and
606
+ * partial invoicing.
607
+ */
608
+ adjusted_subtotal: string;
609
+ /**
610
+ * All adjustments applied to the line item in the order they were applied based on
611
+ * invoice calculations (ie. usage discounts -> amount discounts -> percentage
612
+ * discounts -> minimums -> maximums).
613
+ */
614
+ adjustments: Array<Shared.MonetaryUsageDiscountAdjustment | Shared.MonetaryAmountDiscountAdjustment | Shared.MonetaryPercentageDiscountAdjustment | LineItem.MonetaryTieredPercentageDiscountAdjustment | Shared.MonetaryMinimumAdjustment | Shared.MonetaryMaximumAdjustment>;
615
+ /**
616
+ * The final amount for a line item after all adjustments and pre paid credits have
617
+ * been applied.
618
+ */
619
+ amount: string;
620
+ /**
621
+ * The number of prepaid credits applied.
622
+ */
623
+ credits_applied: string;
624
+ /**
625
+ * The end date of the range of time applied for this line item's price.
626
+ */
627
+ end_date: string;
628
+ /**
629
+ * An additional filter that was used to calculate the usage for this line item.
630
+ */
631
+ filter: string | null;
632
+ /**
633
+ * [DEPRECATED] For configured prices that are split by a grouping key, this will
634
+ * be populated with the key and a value. The `amount` and `subtotal` will be the
635
+ * values for this particular grouping.
636
+ */
637
+ grouping: string | null;
638
+ /**
639
+ * The name of the price associated with this line item.
640
+ */
641
+ name: string;
642
+ /**
643
+ * Any amount applied from a partial invoice
644
+ */
645
+ partially_invoiced_amount: string;
646
+ /**
647
+ * The Price resource represents a price that can be billed on a subscription,
648
+ * resulting in a charge on an invoice in the form of an invoice line item. Prices
649
+ * take a quantity and determine an amount to bill.
650
+ *
651
+ * Orb supports a few different pricing models out of the box. Each of these models
652
+ * is serialized differently in a given Price object. The model_type field
653
+ * determines the key for the configuration object that is present.
654
+ *
655
+ * For more on the types of prices, see
656
+ * [the core concepts documentation](/core-concepts#plan-and-price)
657
+ */
658
+ price: Shared.Price;
659
+ /**
660
+ * Either the fixed fee quantity or the usage during the service period.
661
+ */
662
+ quantity: number;
663
+ /**
664
+ * The start date of the range of time applied for this line item's price.
665
+ */
666
+ start_date: string;
667
+ /**
668
+ * For complex pricing structures, the line item can be broken down further in
669
+ * `sub_line_items`.
670
+ */
671
+ sub_line_items: Array<Shared.MatrixSubLineItem | Shared.TierSubLineItem | Shared.OtherSubLineItem>;
672
+ /**
673
+ * The line amount before any adjustments.
674
+ */
675
+ subtotal: string;
676
+ /**
677
+ * An array of tax rates and their incurred tax amounts. Empty if no tax
678
+ * integration is configured.
679
+ */
680
+ tax_amounts: Array<Shared.TaxAmount>;
681
+ /**
682
+ * A list of customer ids that were used to calculate the usage for this line item.
683
+ */
684
+ usage_customer_ids: Array<string> | null;
685
+ }
686
+ namespace LineItem {
687
+ interface MonetaryTieredPercentageDiscountAdjustment {
688
+ id: string;
689
+ adjustment_type: 'tiered_percentage_discount';
690
+ /**
691
+ * The value applied by an adjustment.
692
+ */
693
+ amount: string;
694
+ /**
695
+ * @deprecated The price IDs that this adjustment applies to.
696
+ */
697
+ applies_to_price_ids: Array<string>;
698
+ /**
699
+ * The filters that determine which prices to apply this adjustment to.
700
+ */
701
+ filters: Array<MonetaryTieredPercentageDiscountAdjustment.Filter>;
702
+ /**
703
+ * True for adjustments that apply to an entire invoice, false for adjustments that
704
+ * apply to only one price.
705
+ */
706
+ is_invoice_level: boolean;
707
+ /**
708
+ * The reason for the adjustment.
709
+ */
710
+ reason: string | null;
711
+ /**
712
+ * The adjustment id this adjustment replaces. This adjustment will take the place
713
+ * of the replaced adjustment in plan version migrations.
714
+ */
715
+ replaces_adjustment_id: string | null;
716
+ /**
717
+ * The ordered, contiguous bands of cumulative eligible spend, each discounted at
718
+ * its own percentage (progressive fill-a-tier), applied to the prices this
719
+ * adjustment covers in a given billing period.
720
+ */
721
+ tiers: Array<MonetaryTieredPercentageDiscountAdjustment.Tier>;
722
+ }
723
+ namespace MonetaryTieredPercentageDiscountAdjustment {
724
+ interface Filter {
725
+ /**
726
+ * The property of the price to filter on.
727
+ */
728
+ field: 'price_id' | 'item_id' | 'price_type' | 'currency' | 'pricing_unit_id';
729
+ /**
730
+ * Should prices that match the filter be included or excluded.
731
+ */
732
+ operator: 'includes' | 'excludes';
733
+ /**
734
+ * The IDs or values that match this filter.
735
+ */
736
+ values: Array<string>;
737
+ }
738
+ /**
739
+ * One band of a tiered percentage discount. Bounds are denominated in the
740
+ * discount's currency. `lower_bound` is the exclusive start of the band and
741
+ * `upper_bound` is the inclusive end; `upper_bound` is null only for the
742
+ * open-ended final tier.
743
+ */
744
+ interface Tier {
745
+ /**
746
+ * Exclusive lower bound of cumulative spend for this tier.
747
+ */
748
+ lower_bound: number;
749
+ /**
750
+ * The percentage (between 0 and 1) discounted from spend that falls within this
751
+ * tier.
752
+ */
753
+ percentage: number;
754
+ /**
755
+ * Inclusive upper bound of cumulative spend for this tier; null for the final
756
+ * open-ended tier.
757
+ */
758
+ upper_bound?: number | null;
759
+ }
760
+ }
761
+ }
762
+ interface PaymentAttempt {
763
+ /**
764
+ * The ID of the payment attempt.
765
+ */
766
+ id: string;
767
+ /**
768
+ * The amount of the payment attempt.
769
+ */
770
+ amount: string;
771
+ /**
772
+ * The time at which the payment attempt was created.
773
+ */
774
+ created_at: string;
775
+ /**
776
+ * The payment provider that attempted to collect the payment.
777
+ */
778
+ payment_provider: 'stripe' | 'adyen' | null;
779
+ /**
780
+ * The ID of the payment attempt in the payment provider.
781
+ */
782
+ payment_provider_id: string | null;
783
+ /**
784
+ * URL to the downloadable PDF version of the receipt. This field will be `null`
785
+ * for payment attempts that did not succeed.
786
+ */
787
+ receipt_pdf: string | null;
788
+ /**
789
+ * Whether the payment attempt succeeded.
790
+ */
791
+ succeeded: boolean;
792
+ }
793
+ }
794
+ /**
795
+ * #InvoiceApiResourceWithoutLineItems
796
+ */
797
+ export interface InvoiceIssueSummaryResponse {
798
+ id: string;
799
+ /**
800
+ * This is the final amount required to be charged to the customer and reflects the
801
+ * application of the customer balance to the `total` of the invoice.
802
+ */
803
+ amount_due: string;
804
+ auto_collection: InvoiceIssueSummaryResponse.AutoCollection;
805
+ billing_address: Shared.Address | null;
806
+ /**
807
+ * The creation time of the resource in Orb.
808
+ */
809
+ created_at: string;
810
+ /**
811
+ * A list of credit notes associated with the invoice
812
+ */
813
+ credit_notes: Array<InvoiceIssueSummaryResponse.CreditNote>;
814
+ /**
815
+ * An ISO 4217 currency string or `credits`
816
+ */
817
+ currency: string;
818
+ customer: Shared.CustomerMinified;
819
+ customer_balance_transactions: Array<InvoiceIssueSummaryResponse.CustomerBalanceTransaction>;
820
+ /**
821
+ * Tax IDs are commonly required to be displayed on customer invoices, which are
822
+ * added to the headers of invoices.
823
+ *
824
+ * ### Supported Tax ID Countries and Types
825
+ *
826
+ * | Country | Type | Description |
827
+ * | ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
828
+ * | Albania | `al_tin` | Albania Tax Identification Number |
829
+ * | Andorra | `ad_nrt` | Andorran NRT Number |
830
+ * | Angola | `ao_tin` | Angola Tax Identification Number |
831
+ * | Argentina | `ar_cuit` | Argentinian Tax ID Number |
832
+ * | Armenia | `am_tin` | Armenia Tax Identification Number |
833
+ * | Aruba | `aw_tin` | Aruba Tax Identification Number |
834
+ * | Australia | `au_abn` | Australian Business Number (AU ABN) |
835
+ * | Australia | `au_arn` | Australian Taxation Office Reference Number |
836
+ * | Austria | `eu_vat` | European VAT Number |
837
+ * | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number |
838
+ * | Bahamas | `bs_tin` | Bahamas Tax Identification Number |
839
+ * | Bahrain | `bh_vat` | Bahraini VAT Number |
840
+ * | Bangladesh | `bd_bin` | Bangladesh Business Identification Number |
841
+ * | Barbados | `bb_tin` | Barbados Tax Identification Number |
842
+ * | Belarus | `by_tin` | Belarus TIN Number |
843
+ * | Belgium | `eu_vat` | European VAT Number |
844
+ * | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) |
845
+ * | Bolivia | `bo_tin` | Bolivian Tax ID |
846
+ * | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number |
847
+ * | Brazil | `br_cnpj` | Brazilian CNPJ Number |
848
+ * | Brazil | `br_cpf` | Brazilian CPF Number |
849
+ * | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
850
+ * | Bulgaria | `eu_vat` | European VAT Number |
851
+ * | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) |
852
+ * | Cambodia | `kh_tin` | Cambodia Tax Identification Number |
853
+ * | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) |
854
+ * | Canada | `ca_bn` | Canadian BN |
855
+ * | Canada | `ca_gst_hst` | Canadian GST/HST Number |
856
+ * | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) |
857
+ * | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) |
858
+ * | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) |
859
+ * | Canada | `ca_qst` | Canadian QST Number (Québec) |
860
+ * | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) |
861
+ * | Chile | `cl_tin` | Chilean TIN |
862
+ * | China | `cn_tin` | Chinese Tax ID |
863
+ * | Colombia | `co_nit` | Colombian NIT Number |
864
+ * | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) |
865
+ * | Costa Rica | `cr_tin` | Costa Rican Tax ID |
866
+ * | Croatia | `eu_vat` | European VAT Number |
867
+ * | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) |
868
+ * | Cyprus | `eu_vat` | European VAT Number |
869
+ * | Czech Republic | `eu_vat` | European VAT Number |
870
+ * | Denmark | `eu_vat` | European VAT Number |
871
+ * | Dominican Republic | `do_rcn` | Dominican RCN Number |
872
+ * | Ecuador | `ec_ruc` | Ecuadorian RUC Number |
873
+ * | Egypt | `eg_tin` | Egyptian Tax Identification Number |
874
+ * | El Salvador | `sv_nit` | El Salvadorian NIT Number |
875
+ * | Estonia | `eu_vat` | European VAT Number |
876
+ * | Ethiopia | `et_tin` | Ethiopia Tax Identification Number |
877
+ * | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
878
+ * | Faroe Islands | `fo_vat` | Faroe Islands VAT Number |
879
+ * | Finland | `eu_vat` | European VAT Number |
880
+ * | France | `eu_vat` | European VAT Number |
881
+ * | Georgia | `ge_vat` | Georgian VAT |
882
+ * | Germany | `de_stn` | German Tax Number (Steuernummer) |
883
+ * | Germany | `eu_vat` | European VAT Number |
884
+ * | Gibraltar | `gi_tin` | Gibraltar Tax Identification Number |
885
+ * | Greece | `eu_vat` | European VAT Number |
886
+ * | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) |
887
+ * | Hong Kong | `hk_br` | Hong Kong BR Number |
888
+ * | Hungary | `eu_vat` | European VAT Number |
889
+ * | Hungary | `hu_tin` | Hungary Tax Number (adószám) |
890
+ * | Iceland | `is_vat` | Icelandic VAT |
891
+ * | India | `in_gst` | Indian GST Number |
892
+ * | Indonesia | `id_npwp` | Indonesian NPWP Number |
893
+ * | Ireland | `eu_vat` | European VAT Number |
894
+ * | Israel | `il_vat` | Israel VAT |
895
+ * | Italy | `eu_vat` | European VAT Number |
896
+ * | Italy | `it_cf` | Italian Codice Fiscale Number |
897
+ * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
898
+ * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
899
+ * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
900
+ * | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number |
901
+ * | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
902
+ * | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number |
903
+ * | Laos | `la_tin` | Laos Tax Identification Number |
904
+ * | Latvia | `eu_vat` | European VAT Number |
905
+ * | Liechtenstein | `li_uid` | Liechtensteinian UID Number |
906
+ * | Liechtenstein | `li_vat` | Liechtenstein VAT Number |
907
+ * | Lithuania | `eu_vat` | European VAT Number |
908
+ * | Luxembourg | `eu_vat` | European VAT Number |
909
+ * | Malaysia | `my_frp` | Malaysian FRP Number |
910
+ * | Malaysia | `my_itn` | Malaysian ITN |
911
+ * | Malaysia | `my_sst` | Malaysian SST Number |
912
+ * | Malta | `eu_vat` | European VAT Number |
913
+ * | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) |
914
+ * | Mexico | `mx_rfc` | Mexican RFC Number |
915
+ * | Moldova | `md_vat` | Moldova VAT Number |
916
+ * | Montenegro | `me_pib` | Montenegro PIB Number |
917
+ * | Morocco | `ma_vat` | Morocco VAT Number |
918
+ * | Nepal | `np_pan` | Nepal PAN Number |
919
+ * | Netherlands | `eu_vat` | European VAT Number |
920
+ * | New Zealand | `nz_gst` | New Zealand GST Number |
921
+ * | Nigeria | `ng_tin` | Nigerian Tax Identification Number |
922
+ * | North Macedonia | `mk_vat` | North Macedonia VAT Number |
923
+ * | Northern Ireland | `eu_vat` | Northern Ireland VAT Number |
924
+ * | Norway | `no_vat` | Norwegian VAT Number |
925
+ * | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
926
+ * | Oman | `om_vat` | Omani VAT Number |
927
+ * | Paraguay | `py_ruc` | Paraguayan RUC Number |
928
+ * | Peru | `pe_ruc` | Peruvian RUC Number |
929
+ * | Philippines | `ph_tin` | Philippines Tax Identification Number |
930
+ * | Poland | `eu_vat` | European VAT Number |
931
+ * | Poland | `pl_nip` | Polish Tax ID Number |
932
+ * | Portugal | `eu_vat` | European VAT Number |
933
+ * | Romania | `eu_vat` | European VAT Number |
934
+ * | Romania | `ro_tin` | Romanian Tax ID Number |
935
+ * | Russia | `ru_inn` | Russian INN |
936
+ * | Russia | `ru_kpp` | Russian KPP |
937
+ * | Saudi Arabia | `sa_vat` | Saudi Arabia VAT |
938
+ * | Senegal | `sn_ninea` | Senegal NINEA Number |
939
+ * | Serbia | `rs_pib` | Serbian PIB Number |
940
+ * | Singapore | `sg_gst` | Singaporean GST |
941
+ * | Singapore | `sg_uen` | Singaporean UEN |
942
+ * | Slovakia | `eu_vat` | European VAT Number |
943
+ * | Slovenia | `eu_vat` | European VAT Number |
944
+ * | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) |
945
+ * | South Africa | `za_vat` | South African VAT Number |
946
+ * | South Korea | `kr_brn` | Korean BRN |
947
+ * | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
948
+ * | Spain | `eu_vat` | European VAT Number |
949
+ * | Sri Lanka | `lk_vat` | Sri Lanka VAT Number |
950
+ * | Suriname | `sr_fin` | Suriname FIN Number |
951
+ * | Sweden | `eu_vat` | European VAT Number |
952
+ * | Switzerland | `ch_uid` | Switzerland UID Number |
953
+ * | Switzerland | `ch_vat` | Switzerland VAT Number |
954
+ * | Taiwan | `tw_vat` | Taiwanese VAT |
955
+ * | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number |
956
+ * | Tanzania | `tz_vat` | Tanzania VAT Number |
957
+ * | Thailand | `th_vat` | Thai VAT |
958
+ * | Turkey | `tr_tin` | Turkish Tax Identification Number |
959
+ * | Uganda | `ug_tin` | Uganda Tax Identification Number |
960
+ * | Ukraine | `ua_vat` | Ukrainian VAT |
961
+ * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
962
+ * | United Kingdom | `gb_vat` | United Kingdom VAT Number |
963
+ * | United States | `us_ein` | United States EIN |
964
+ * | Uruguay | `uy_ruc` | Uruguayan RUC Number |
965
+ * | Uzbekistan | `uz_tin` | Uzbekistan TIN Number |
966
+ * | Uzbekistan | `uz_vat` | Uzbekistan VAT Number |
967
+ * | Venezuela | `ve_rif` | Venezuelan RIF Number |
968
+ * | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
969
+ * | Zambia | `zm_tin` | Zambia Tax Identification Number |
970
+ * | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number |
971
+ */
972
+ customer_tax_id: Shared.CustomerTaxID | null;
973
+ /**
974
+ * When the invoice payment is due. The due date is null if the invoice is not yet
975
+ * finalized.
976
+ */
977
+ due_date: string | null;
978
+ /**
979
+ * If the invoice has a status of `draft`, this will be the time that the invoice
980
+ * will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is
981
+ * true, the invoice will automatically begin issuing at this time.
982
+ */
983
+ eligible_to_issue_at: string | null;
984
+ /**
985
+ * A URL for the customer-facing invoice portal. This URL expires 60 days after the
986
+ * link is generated, or 30 days after the invoice's due date — whichever is later.
987
+ */
988
+ hosted_invoice_url: string | null;
989
+ /**
990
+ * The scheduled date of the invoice
991
+ */
992
+ invoice_date: string;
993
+ /**
994
+ * Automatically generated invoice number to help track and reconcile invoices.
995
+ * Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per
996
+ * account or customer.
997
+ */
998
+ invoice_number: string;
999
+ /**
1000
+ * The link to download the PDF representation of the `Invoice`.
1001
+ */
1002
+ invoice_pdf: string | null;
1003
+ invoice_source: 'subscription' | 'partial' | 'one_off';
1004
+ /**
1005
+ * If the invoice failed to issue, this will be the last time it failed to issue
1006
+ * (even if it is now in a different state.)
1007
+ */
1008
+ issue_failed_at: string | null;
1009
+ /**
1010
+ * If the invoice has been issued, this will be the time it transitioned to
1011
+ * `issued` (even if it is now in a different state.)
1012
+ */
1013
+ issued_at: string | null;
1014
+ /**
1015
+ * Free-form text which is available on the invoice PDF and the Orb invoice portal.
1016
+ */
1017
+ memo: string | null;
1018
+ /**
1019
+ * User specified key-value pairs for the resource. If not present, this defaults
1020
+ * to an empty dictionary. Individual keys can be removed by setting the value to
1021
+ * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
1022
+ * `null`.
1023
+ */
1024
+ metadata: {
1025
+ [key: string]: string;
1026
+ };
1027
+ /**
1028
+ * If the invoice has a status of `paid`, this gives a timestamp when the invoice
1029
+ * was paid.
1030
+ */
1031
+ paid_at: string | null;
1032
+ /**
1033
+ * A list of payment attempts associated with the invoice
1034
+ */
1035
+ payment_attempts: Array<InvoiceIssueSummaryResponse.PaymentAttempt>;
1036
+ /**
1037
+ * If payment was attempted on this invoice but failed, this will be the time of
1038
+ * the most recent attempt.
1039
+ */
1040
+ payment_failed_at: string | null;
1041
+ /**
1042
+ * If payment was attempted on this invoice, this will be the start time of the
1043
+ * most recent attempt. This field is especially useful for delayed-notification
1044
+ * payment mechanisms (like bank transfers), where payment can take 3 days or more.
1045
+ */
1046
+ payment_started_at: string | null;
1047
+ /**
1048
+ * If the invoice is in draft, this timestamp will reflect when the invoice is
1049
+ * scheduled to be issued.
1050
+ */
1051
+ scheduled_issue_at: string | null;
1052
+ shipping_address: Shared.Address | null;
1053
+ status: 'issued' | 'paid' | 'synced' | 'void' | 'draft';
1054
+ subscription: Shared.SubscriptionMinified | null;
1055
+ /**
1056
+ * If the invoice failed to sync, this will be the last time an external invoicing
1057
+ * provider sync was attempted. This field will always be `null` for invoices using
1058
+ * Orb Invoicing.
1059
+ */
1060
+ sync_failed_at: string | null;
1061
+ /**
1062
+ * The total after any minimums and discounts have been applied.
1063
+ */
1064
+ total: string;
1065
+ /**
1066
+ * If the invoice has a status of `void`, this gives a timestamp when the invoice
1067
+ * was voided.
1068
+ */
1069
+ voided_at: string | null;
1070
+ /**
1071
+ * This is true if the invoice will be automatically issued in the future, and
1072
+ * false otherwise.
1073
+ */
1074
+ will_auto_issue: boolean;
1075
+ }
1076
+ export declare namespace InvoiceIssueSummaryResponse {
1077
+ interface AutoCollection {
1078
+ /**
1079
+ * True only if auto-collection is enabled for this invoice.
1080
+ */
1081
+ enabled: boolean | null;
1082
+ /**
1083
+ * If the invoice is scheduled for auto-collection, this field will reflect when
1084
+ * the next attempt will occur. If dunning has been exhausted, or auto-collection
1085
+ * is not enabled for this invoice, this field will be `null`.
1086
+ */
1087
+ next_attempt_at: string | null;
1088
+ /**
1089
+ * Number of auto-collection payment attempts.
1090
+ */
1091
+ num_attempts: number | null;
1092
+ /**
1093
+ * If Orb has ever attempted payment auto-collection for this invoice, this field
1094
+ * will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
1095
+ * this can be used to tell whether the invoice is currently in dunning (that is,
1096
+ * `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or
1097
+ * if dunning has been exhausted (`previously_attempted_at` is non-null, but
1098
+ * `next_attempt_time` is null).
1099
+ */
1100
+ previously_attempted_at: string | null;
1101
+ }
1102
+ interface CreditNote {
1103
+ id: string;
1104
+ credit_note_number: string;
1105
+ /**
1106
+ * An optional memo supplied on the credit note.
1107
+ */
1108
+ memo: string | null;
1109
+ reason: string;
1110
+ total: string;
1111
+ type: string;
1112
+ /**
1113
+ * If the credit note has a status of `void`, this gives a timestamp when the
1114
+ * credit note was voided.
1115
+ */
1116
+ voided_at: string | null;
1117
+ }
1118
+ interface CustomerBalanceTransaction {
1119
+ /**
1120
+ * A unique id for this transaction.
1121
+ */
1122
+ id: string;
1123
+ action: 'applied_to_invoice' | 'manual_adjustment' | 'prorated_refund' | 'revert_prorated_refund' | 'return_from_voiding' | 'credit_note_applied' | 'credit_note_voided' | 'overpayment_refund' | 'external_payment' | 'small_invoice_carryover';
1124
+ /**
1125
+ * The value of the amount changed in the transaction.
1126
+ */
1127
+ amount: string;
1128
+ /**
1129
+ * The creation time of this transaction.
1130
+ */
1131
+ created_at: string;
1132
+ credit_note: Shared.CreditNoteTiny | null;
1133
+ /**
1134
+ * An optional description provided for manual customer balance adjustments.
1135
+ */
1136
+ description: string | null;
1137
+ /**
1138
+ * The new value of the customer's balance prior to the transaction, in the
1139
+ * customer's currency.
1140
+ */
1141
+ ending_balance: string;
1142
+ invoice: Shared.InvoiceTiny | null;
1143
+ /**
1144
+ * The original value of the customer's balance prior to the transaction, in the
1145
+ * customer's currency.
1146
+ */
1147
+ starting_balance: string;
1148
+ type: 'increment' | 'decrement';
1149
+ }
1150
+ interface PaymentAttempt {
1151
+ /**
1152
+ * The ID of the payment attempt.
1153
+ */
1154
+ id: string;
1155
+ /**
1156
+ * The amount of the payment attempt.
1157
+ */
1158
+ amount: string;
1159
+ /**
1160
+ * The time at which the payment attempt was created.
1161
+ */
1162
+ created_at: string;
1163
+ /**
1164
+ * The payment provider that attempted to collect the payment.
1165
+ */
1166
+ payment_provider: 'stripe' | 'adyen' | null;
1167
+ /**
1168
+ * The ID of the payment attempt in the payment provider.
1169
+ */
1170
+ payment_provider_id: string | null;
1171
+ /**
1172
+ * URL to the downloadable PDF version of the receipt. This field will be `null`
1173
+ * for payment attempts that did not succeed.
1174
+ */
1175
+ receipt_pdf: string | null;
1176
+ /**
1177
+ * Whether the payment attempt succeeded.
1178
+ */
1179
+ succeeded: boolean;
1180
+ }
1181
+ }
1182
+ /**
1183
+ * #InvoiceApiResourceWithoutLineItems
1184
+ */
1185
+ export interface InvoiceListSummaryResponse {
1186
+ id: string;
1187
+ /**
1188
+ * This is the final amount required to be charged to the customer and reflects the
1189
+ * application of the customer balance to the `total` of the invoice.
1190
+ */
1191
+ amount_due: string;
1192
+ auto_collection: InvoiceListSummaryResponse.AutoCollection;
1193
+ billing_address: Shared.Address | null;
1194
+ /**
1195
+ * The creation time of the resource in Orb.
1196
+ */
1197
+ created_at: string;
1198
+ /**
1199
+ * A list of credit notes associated with the invoice
1200
+ */
1201
+ credit_notes: Array<InvoiceListSummaryResponse.CreditNote>;
1202
+ /**
1203
+ * An ISO 4217 currency string or `credits`
1204
+ */
1205
+ currency: string;
1206
+ customer: Shared.CustomerMinified;
1207
+ customer_balance_transactions: Array<InvoiceListSummaryResponse.CustomerBalanceTransaction>;
1208
+ /**
1209
+ * Tax IDs are commonly required to be displayed on customer invoices, which are
1210
+ * added to the headers of invoices.
1211
+ *
1212
+ * ### Supported Tax ID Countries and Types
1213
+ *
1214
+ * | Country | Type | Description |
1215
+ * | ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
1216
+ * | Albania | `al_tin` | Albania Tax Identification Number |
1217
+ * | Andorra | `ad_nrt` | Andorran NRT Number |
1218
+ * | Angola | `ao_tin` | Angola Tax Identification Number |
1219
+ * | Argentina | `ar_cuit` | Argentinian Tax ID Number |
1220
+ * | Armenia | `am_tin` | Armenia Tax Identification Number |
1221
+ * | Aruba | `aw_tin` | Aruba Tax Identification Number |
1222
+ * | Australia | `au_abn` | Australian Business Number (AU ABN) |
1223
+ * | Australia | `au_arn` | Australian Taxation Office Reference Number |
1224
+ * | Austria | `eu_vat` | European VAT Number |
1225
+ * | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number |
1226
+ * | Bahamas | `bs_tin` | Bahamas Tax Identification Number |
1227
+ * | Bahrain | `bh_vat` | Bahraini VAT Number |
1228
+ * | Bangladesh | `bd_bin` | Bangladesh Business Identification Number |
1229
+ * | Barbados | `bb_tin` | Barbados Tax Identification Number |
1230
+ * | Belarus | `by_tin` | Belarus TIN Number |
1231
+ * | Belgium | `eu_vat` | European VAT Number |
1232
+ * | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) |
1233
+ * | Bolivia | `bo_tin` | Bolivian Tax ID |
1234
+ * | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number |
1235
+ * | Brazil | `br_cnpj` | Brazilian CNPJ Number |
1236
+ * | Brazil | `br_cpf` | Brazilian CPF Number |
1237
+ * | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
1238
+ * | Bulgaria | `eu_vat` | European VAT Number |
1239
+ * | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) |
1240
+ * | Cambodia | `kh_tin` | Cambodia Tax Identification Number |
1241
+ * | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) |
1242
+ * | Canada | `ca_bn` | Canadian BN |
1243
+ * | Canada | `ca_gst_hst` | Canadian GST/HST Number |
1244
+ * | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) |
1245
+ * | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) |
1246
+ * | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) |
1247
+ * | Canada | `ca_qst` | Canadian QST Number (Québec) |
1248
+ * | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) |
1249
+ * | Chile | `cl_tin` | Chilean TIN |
1250
+ * | China | `cn_tin` | Chinese Tax ID |
1251
+ * | Colombia | `co_nit` | Colombian NIT Number |
1252
+ * | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) |
1253
+ * | Costa Rica | `cr_tin` | Costa Rican Tax ID |
1254
+ * | Croatia | `eu_vat` | European VAT Number |
1255
+ * | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) |
1256
+ * | Cyprus | `eu_vat` | European VAT Number |
1257
+ * | Czech Republic | `eu_vat` | European VAT Number |
1258
+ * | Denmark | `eu_vat` | European VAT Number |
1259
+ * | Dominican Republic | `do_rcn` | Dominican RCN Number |
1260
+ * | Ecuador | `ec_ruc` | Ecuadorian RUC Number |
1261
+ * | Egypt | `eg_tin` | Egyptian Tax Identification Number |
1262
+ * | El Salvador | `sv_nit` | El Salvadorian NIT Number |
1263
+ * | Estonia | `eu_vat` | European VAT Number |
1264
+ * | Ethiopia | `et_tin` | Ethiopia Tax Identification Number |
1265
+ * | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
1266
+ * | Faroe Islands | `fo_vat` | Faroe Islands VAT Number |
1267
+ * | Finland | `eu_vat` | European VAT Number |
1268
+ * | France | `eu_vat` | European VAT Number |
1269
+ * | Georgia | `ge_vat` | Georgian VAT |
1270
+ * | Germany | `de_stn` | German Tax Number (Steuernummer) |
1271
+ * | Germany | `eu_vat` | European VAT Number |
1272
+ * | Gibraltar | `gi_tin` | Gibraltar Tax Identification Number |
1273
+ * | Greece | `eu_vat` | European VAT Number |
1274
+ * | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) |
1275
+ * | Hong Kong | `hk_br` | Hong Kong BR Number |
1276
+ * | Hungary | `eu_vat` | European VAT Number |
1277
+ * | Hungary | `hu_tin` | Hungary Tax Number (adószám) |
1278
+ * | Iceland | `is_vat` | Icelandic VAT |
1279
+ * | India | `in_gst` | Indian GST Number |
1280
+ * | Indonesia | `id_npwp` | Indonesian NPWP Number |
1281
+ * | Ireland | `eu_vat` | European VAT Number |
1282
+ * | Israel | `il_vat` | Israel VAT |
1283
+ * | Italy | `eu_vat` | European VAT Number |
1284
+ * | Italy | `it_cf` | Italian Codice Fiscale Number |
1285
+ * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
1286
+ * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
1287
+ * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
1288
+ * | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number |
1289
+ * | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
1290
+ * | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number |
1291
+ * | Laos | `la_tin` | Laos Tax Identification Number |
1292
+ * | Latvia | `eu_vat` | European VAT Number |
1293
+ * | Liechtenstein | `li_uid` | Liechtensteinian UID Number |
1294
+ * | Liechtenstein | `li_vat` | Liechtenstein VAT Number |
1295
+ * | Lithuania | `eu_vat` | European VAT Number |
1296
+ * | Luxembourg | `eu_vat` | European VAT Number |
1297
+ * | Malaysia | `my_frp` | Malaysian FRP Number |
1298
+ * | Malaysia | `my_itn` | Malaysian ITN |
1299
+ * | Malaysia | `my_sst` | Malaysian SST Number |
1300
+ * | Malta | `eu_vat` | European VAT Number |
1301
+ * | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) |
1302
+ * | Mexico | `mx_rfc` | Mexican RFC Number |
1303
+ * | Moldova | `md_vat` | Moldova VAT Number |
1304
+ * | Montenegro | `me_pib` | Montenegro PIB Number |
1305
+ * | Morocco | `ma_vat` | Morocco VAT Number |
1306
+ * | Nepal | `np_pan` | Nepal PAN Number |
1307
+ * | Netherlands | `eu_vat` | European VAT Number |
1308
+ * | New Zealand | `nz_gst` | New Zealand GST Number |
1309
+ * | Nigeria | `ng_tin` | Nigerian Tax Identification Number |
1310
+ * | North Macedonia | `mk_vat` | North Macedonia VAT Number |
1311
+ * | Northern Ireland | `eu_vat` | Northern Ireland VAT Number |
1312
+ * | Norway | `no_vat` | Norwegian VAT Number |
1313
+ * | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
1314
+ * | Oman | `om_vat` | Omani VAT Number |
1315
+ * | Paraguay | `py_ruc` | Paraguayan RUC Number |
1316
+ * | Peru | `pe_ruc` | Peruvian RUC Number |
1317
+ * | Philippines | `ph_tin` | Philippines Tax Identification Number |
1318
+ * | Poland | `eu_vat` | European VAT Number |
1319
+ * | Poland | `pl_nip` | Polish Tax ID Number |
1320
+ * | Portugal | `eu_vat` | European VAT Number |
1321
+ * | Romania | `eu_vat` | European VAT Number |
1322
+ * | Romania | `ro_tin` | Romanian Tax ID Number |
1323
+ * | Russia | `ru_inn` | Russian INN |
1324
+ * | Russia | `ru_kpp` | Russian KPP |
1325
+ * | Saudi Arabia | `sa_vat` | Saudi Arabia VAT |
1326
+ * | Senegal | `sn_ninea` | Senegal NINEA Number |
1327
+ * | Serbia | `rs_pib` | Serbian PIB Number |
1328
+ * | Singapore | `sg_gst` | Singaporean GST |
1329
+ * | Singapore | `sg_uen` | Singaporean UEN |
1330
+ * | Slovakia | `eu_vat` | European VAT Number |
1331
+ * | Slovenia | `eu_vat` | European VAT Number |
1332
+ * | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) |
1333
+ * | South Africa | `za_vat` | South African VAT Number |
1334
+ * | South Korea | `kr_brn` | Korean BRN |
1335
+ * | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
1336
+ * | Spain | `eu_vat` | European VAT Number |
1337
+ * | Sri Lanka | `lk_vat` | Sri Lanka VAT Number |
1338
+ * | Suriname | `sr_fin` | Suriname FIN Number |
1339
+ * | Sweden | `eu_vat` | European VAT Number |
1340
+ * | Switzerland | `ch_uid` | Switzerland UID Number |
1341
+ * | Switzerland | `ch_vat` | Switzerland VAT Number |
1342
+ * | Taiwan | `tw_vat` | Taiwanese VAT |
1343
+ * | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number |
1344
+ * | Tanzania | `tz_vat` | Tanzania VAT Number |
1345
+ * | Thailand | `th_vat` | Thai VAT |
1346
+ * | Turkey | `tr_tin` | Turkish Tax Identification Number |
1347
+ * | Uganda | `ug_tin` | Uganda Tax Identification Number |
1348
+ * | Ukraine | `ua_vat` | Ukrainian VAT |
1349
+ * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
1350
+ * | United Kingdom | `gb_vat` | United Kingdom VAT Number |
1351
+ * | United States | `us_ein` | United States EIN |
1352
+ * | Uruguay | `uy_ruc` | Uruguayan RUC Number |
1353
+ * | Uzbekistan | `uz_tin` | Uzbekistan TIN Number |
1354
+ * | Uzbekistan | `uz_vat` | Uzbekistan VAT Number |
1355
+ * | Venezuela | `ve_rif` | Venezuelan RIF Number |
1356
+ * | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
1357
+ * | Zambia | `zm_tin` | Zambia Tax Identification Number |
1358
+ * | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number |
1359
+ */
1360
+ customer_tax_id: Shared.CustomerTaxID | null;
1361
+ /**
1362
+ * When the invoice payment is due. The due date is null if the invoice is not yet
1363
+ * finalized.
1364
+ */
1365
+ due_date: string | null;
1366
+ /**
1367
+ * If the invoice has a status of `draft`, this will be the time that the invoice
1368
+ * will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is
1369
+ * true, the invoice will automatically begin issuing at this time.
1370
+ */
1371
+ eligible_to_issue_at: string | null;
1372
+ /**
1373
+ * A URL for the customer-facing invoice portal. This URL expires 60 days after the
1374
+ * link is generated, or 30 days after the invoice's due date — whichever is later.
1375
+ */
1376
+ hosted_invoice_url: string | null;
1377
+ /**
1378
+ * The scheduled date of the invoice
1379
+ */
1380
+ invoice_date: string;
1381
+ /**
1382
+ * Automatically generated invoice number to help track and reconcile invoices.
1383
+ * Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per
1384
+ * account or customer.
1385
+ */
1386
+ invoice_number: string;
1387
+ /**
1388
+ * The link to download the PDF representation of the `Invoice`.
1389
+ */
1390
+ invoice_pdf: string | null;
1391
+ invoice_source: 'subscription' | 'partial' | 'one_off';
1392
+ /**
1393
+ * If the invoice failed to issue, this will be the last time it failed to issue
1394
+ * (even if it is now in a different state.)
1395
+ */
1396
+ issue_failed_at: string | null;
1397
+ /**
1398
+ * If the invoice has been issued, this will be the time it transitioned to
1399
+ * `issued` (even if it is now in a different state.)
1400
+ */
1401
+ issued_at: string | null;
1402
+ /**
1403
+ * Free-form text which is available on the invoice PDF and the Orb invoice portal.
1404
+ */
1405
+ memo: string | null;
1406
+ /**
1407
+ * User specified key-value pairs for the resource. If not present, this defaults
1408
+ * to an empty dictionary. Individual keys can be removed by setting the value to
1409
+ * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
1410
+ * `null`.
1411
+ */
1412
+ metadata: {
1413
+ [key: string]: string;
1414
+ };
1415
+ /**
1416
+ * If the invoice has a status of `paid`, this gives a timestamp when the invoice
1417
+ * was paid.
1418
+ */
1419
+ paid_at: string | null;
1420
+ /**
1421
+ * A list of payment attempts associated with the invoice
1422
+ */
1423
+ payment_attempts: Array<InvoiceListSummaryResponse.PaymentAttempt>;
1424
+ /**
1425
+ * If payment was attempted on this invoice but failed, this will be the time of
1426
+ * the most recent attempt.
1427
+ */
1428
+ payment_failed_at: string | null;
1429
+ /**
1430
+ * If payment was attempted on this invoice, this will be the start time of the
1431
+ * most recent attempt. This field is especially useful for delayed-notification
1432
+ * payment mechanisms (like bank transfers), where payment can take 3 days or more.
1433
+ */
1434
+ payment_started_at: string | null;
1435
+ /**
1436
+ * If the invoice is in draft, this timestamp will reflect when the invoice is
1437
+ * scheduled to be issued.
1438
+ */
1439
+ scheduled_issue_at: string | null;
1440
+ shipping_address: Shared.Address | null;
1441
+ status: 'issued' | 'paid' | 'synced' | 'void' | 'draft';
1442
+ subscription: Shared.SubscriptionMinified | null;
1443
+ /**
1444
+ * If the invoice failed to sync, this will be the last time an external invoicing
1445
+ * provider sync was attempted. This field will always be `null` for invoices using
1446
+ * Orb Invoicing.
1447
+ */
1448
+ sync_failed_at: string | null;
1449
+ /**
1450
+ * The total after any minimums and discounts have been applied.
1451
+ */
1452
+ total: string;
1453
+ /**
1454
+ * If the invoice has a status of `void`, this gives a timestamp when the invoice
1455
+ * was voided.
1456
+ */
1457
+ voided_at: string | null;
1458
+ /**
1459
+ * This is true if the invoice will be automatically issued in the future, and
1460
+ * false otherwise.
1461
+ */
1462
+ will_auto_issue: boolean;
1463
+ }
1464
+ export declare namespace InvoiceListSummaryResponse {
1465
+ interface AutoCollection {
1466
+ /**
1467
+ * True only if auto-collection is enabled for this invoice.
1468
+ */
1469
+ enabled: boolean | null;
1470
+ /**
1471
+ * If the invoice is scheduled for auto-collection, this field will reflect when
1472
+ * the next attempt will occur. If dunning has been exhausted, or auto-collection
1473
+ * is not enabled for this invoice, this field will be `null`.
1474
+ */
1475
+ next_attempt_at: string | null;
1476
+ /**
1477
+ * Number of auto-collection payment attempts.
1478
+ */
1479
+ num_attempts: number | null;
1480
+ /**
1481
+ * If Orb has ever attempted payment auto-collection for this invoice, this field
1482
+ * will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
1483
+ * this can be used to tell whether the invoice is currently in dunning (that is,
1484
+ * `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or
1485
+ * if dunning has been exhausted (`previously_attempted_at` is non-null, but
1486
+ * `next_attempt_time` is null).
1487
+ */
1488
+ previously_attempted_at: string | null;
1489
+ }
1490
+ interface CreditNote {
1491
+ id: string;
1492
+ credit_note_number: string;
1493
+ /**
1494
+ * An optional memo supplied on the credit note.
1495
+ */
1496
+ memo: string | null;
1497
+ reason: string;
1498
+ total: string;
1499
+ type: string;
1500
+ /**
1501
+ * If the credit note has a status of `void`, this gives a timestamp when the
1502
+ * credit note was voided.
1503
+ */
1504
+ voided_at: string | null;
1505
+ }
1506
+ interface CustomerBalanceTransaction {
1507
+ /**
1508
+ * A unique id for this transaction.
1509
+ */
1510
+ id: string;
1511
+ action: 'applied_to_invoice' | 'manual_adjustment' | 'prorated_refund' | 'revert_prorated_refund' | 'return_from_voiding' | 'credit_note_applied' | 'credit_note_voided' | 'overpayment_refund' | 'external_payment' | 'small_invoice_carryover';
1512
+ /**
1513
+ * The value of the amount changed in the transaction.
1514
+ */
1515
+ amount: string;
1516
+ /**
1517
+ * The creation time of this transaction.
1518
+ */
1519
+ created_at: string;
1520
+ credit_note: Shared.CreditNoteTiny | null;
1521
+ /**
1522
+ * An optional description provided for manual customer balance adjustments.
1523
+ */
1524
+ description: string | null;
1525
+ /**
1526
+ * The new value of the customer's balance prior to the transaction, in the
1527
+ * customer's currency.
1528
+ */
1529
+ ending_balance: string;
1530
+ invoice: Shared.InvoiceTiny | null;
1531
+ /**
1532
+ * The original value of the customer's balance prior to the transaction, in the
1533
+ * customer's currency.
1534
+ */
1535
+ starting_balance: string;
1536
+ type: 'increment' | 'decrement';
1537
+ }
1538
+ interface PaymentAttempt {
1539
+ /**
1540
+ * The ID of the payment attempt.
1541
+ */
1542
+ id: string;
1543
+ /**
1544
+ * The amount of the payment attempt.
1545
+ */
1546
+ amount: string;
1547
+ /**
1548
+ * The time at which the payment attempt was created.
1549
+ */
1550
+ created_at: string;
1551
+ /**
1552
+ * The payment provider that attempted to collect the payment.
1553
+ */
1554
+ payment_provider: 'stripe' | 'adyen' | null;
1555
+ /**
1556
+ * The ID of the payment attempt in the payment provider.
1557
+ */
1558
+ payment_provider_id: string | null;
1559
+ /**
1560
+ * URL to the downloadable PDF version of the receipt. This field will be `null`
1561
+ * for payment attempts that did not succeed.
1562
+ */
1563
+ receipt_pdf: string | null;
1564
+ /**
1565
+ * Whether the payment attempt succeeded.
1566
+ */
1567
+ succeeded: boolean;
1568
+ }
1569
+ }
1570
+ export interface InvoiceCreateParams {
1571
+ /**
1572
+ * An ISO 4217 currency string. Must be the same as the customer's currency if it
1573
+ * is set.
1574
+ */
1575
+ currency: string;
1576
+ /**
1577
+ * An ISO 8601 date or timestamp, interpreted in the customer's timezone. Must be
1578
+ * in the past. If a date is set without a time, `invoice_date` is set to midnight
1579
+ * on the chosen date in the customer's timezone.
1580
+ */
1581
+ invoice_date: string;
1582
+ line_items: Array<InvoiceCreateParams.LineItem>;
1583
+ /**
1584
+ * Determines whether this invoice will automatically attempt to charge a saved
1585
+ * payment method, if any. If not specified, the invoice inherits the customer's
1586
+ * auto_collection setting.
1587
+ */
1588
+ auto_collection?: boolean | null;
1589
+ /**
1590
+ * The id of the `Customer` to create this invoice for. One of `customer_id` and
1591
+ * `external_customer_id` are required.
1592
+ */
1593
+ customer_id?: string | null;
1594
+ /**
1595
+ * An optional discount to attach to the invoice.
1596
+ */
1597
+ discount?: Shared.Discount | null;
1598
+ /**
1599
+ * An optional custom due date for the invoice. If not set, the due date will be
1600
+ * calculated based on the `net_terms` value.
1601
+ */
1602
+ due_date?: (string & {}) | (string & {}) | null;
1603
+ /**
1604
+ * The `external_customer_id` of the `Customer` to create this invoice for. One of
1605
+ * `customer_id` and `external_customer_id` are required.
1606
+ */
1607
+ external_customer_id?: string | null;
1608
+ /**
1609
+ * An optional memo to attach to the invoice. If no memo is provided, we will
1610
+ * attach the default memo
1611
+ */
1612
+ memo?: string | null;
1613
+ /**
1614
+ * User-specified key/value pairs for the resource. Individual keys can be removed
1615
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
1616
+ * by setting `metadata` to `null`.
1617
+ */
1618
+ metadata?: {
1619
+ [key: string]: string | null;
1620
+ } | null;
1621
+ /**
1622
+ * The net terms determines the due date of the invoice. Due date is calculated
1623
+ * based on the invoice or issuance date, depending on the account's configured due
1624
+ * date calculation method. A value of '0' here represents that the invoice is due
1625
+ * on issue, whereas a value of '30' represents that the customer has 30 days to
1626
+ * pay the invoice. Do not set this field if you want to set a custom due date.
1627
+ */
1628
+ net_terms?: number | null;
1629
+ /**
1630
+ * When true, this invoice will be submitted for issuance upon creation. When
1631
+ * false, the resulting invoice will require manual review to issue. Defaulted to
1632
+ * false.
1633
+ */
1634
+ will_auto_issue?: boolean;
1635
+ }
1636
+ export declare namespace InvoiceCreateParams {
1637
+ interface LineItem {
1638
+ /**
1639
+ * A date string to specify the line item's end date in the customer's timezone.
1640
+ */
1641
+ end_date: string;
1642
+ item_id: string;
1643
+ model_type: 'unit';
1644
+ /**
1645
+ * The name of the line item.
1646
+ */
1647
+ name: string;
1648
+ /**
1649
+ * The number of units on the line item
1650
+ */
1651
+ quantity: number;
1652
+ /**
1653
+ * A date string to specify the line item's start date in the customer's timezone.
1654
+ */
1655
+ start_date: string;
1656
+ /**
1657
+ * Configuration for unit pricing
1658
+ */
1659
+ unit_config: Shared.UnitConfig;
1660
+ }
1661
+ }
1662
+ export interface InvoiceUpdateParams {
1663
+ /**
1664
+ * Determines whether this invoice will automatically attempt to charge a saved
1665
+ * payment method, if any. Can only be modified on draft invoices. If not
1666
+ * specified, the invoice's existing setting is unchanged.
1667
+ */
1668
+ auto_collection?: boolean | null;
1669
+ /**
1670
+ * An optional custom due date for the invoice. If not set, the due date will be
1671
+ * calculated based on the `net_terms` value.
1672
+ */
1673
+ due_date?: (string & {}) | (string & {}) | null;
1674
+ /**
1675
+ * The date of the invoice. Can only be modified for one-off draft invoices.
1676
+ */
1677
+ invoice_date?: (string & {}) | (string & {}) | null;
1678
+ /**
1679
+ * User-specified key/value pairs for the resource. Individual keys can be removed
1680
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
1681
+ * by setting `metadata` to `null`.
1682
+ */
1683
+ metadata?: {
1684
+ [key: string]: string | null;
1685
+ } | null;
1686
+ /**
1687
+ * The net terms determines the due date of the invoice. Due date is calculated
1688
+ * based on the invoice or issuance date, depending on the account's configured due
1689
+ * date calculation method. A value of '0' here represents that the invoice is due
1690
+ * on issue, whereas a value of '30' represents that the customer has 30 days to
1691
+ * pay the invoice. Do not set this field if you want to set a custom due date.
1692
+ */
1693
+ net_terms?: number | null;
1694
+ }
1695
+ export interface InvoiceListParams extends PageParams {
1696
+ amount?: string | null;
1697
+ 'amount[gt]'?: string | null;
1698
+ 'amount[lt]'?: string | null;
1699
+ customer_id?: string | null;
1700
+ date_type?: 'due_date' | 'invoice_date' | null;
1701
+ due_date?: string | null;
1702
+ /**
1703
+ * Filters invoices by their due dates within a specific time range in the past.
1704
+ * Specify the range as a number followed by 'd' (days) or 'm' (months). For
1705
+ * example, '7d' filters invoices due in the last 7 days, and '2m' filters those
1706
+ * due in the last 2 months.
1707
+ */
1708
+ due_date_window?: string | null;
1709
+ 'due_date[gt]'?: string | null;
1710
+ 'due_date[lt]'?: string | null;
1711
+ external_customer_id?: string | null;
1712
+ 'invoice_date[gt]'?: string | null;
1713
+ 'invoice_date[gte]'?: string | null;
1714
+ 'invoice_date[lt]'?: string | null;
1715
+ 'invoice_date[lte]'?: string | null;
1716
+ is_recurring?: boolean | null;
1717
+ status?: Array<'draft' | 'issued' | 'paid' | 'synced' | 'void'> | null;
1718
+ subscription_id?: string | null;
1719
+ }
1720
+ export interface InvoiceDeleteLineItemParams {
1721
+ invoice_id: string;
1722
+ }
1723
+ export interface InvoiceFetchUpcomingParams {
1724
+ subscription_id: string;
1725
+ }
1726
+ export interface InvoiceIssueParams {
1727
+ /**
1728
+ * If true, the invoice will be issued synchronously. If false, the invoice will be
1729
+ * issued asynchronously. The synchronous option is only available for invoices
1730
+ * that have no usage fees. If the invoice is configured to sync to an external
1731
+ * provider, a successful response from this endpoint guarantees the invoice is
1732
+ * present in the provider.
1733
+ */
1734
+ synchronous?: boolean;
1735
+ }
1736
+ export interface InvoiceIssueSummaryParams {
1737
+ /**
1738
+ * If true, the invoice will be issued synchronously. If false, the invoice will be
1739
+ * issued asynchronously. The synchronous option is only available for invoices
1740
+ * that have no usage fees. If the invoice is configured to sync to an external
1741
+ * provider, a successful response from this endpoint guarantees the invoice is
1742
+ * present in the provider.
1743
+ */
1744
+ synchronous?: boolean;
1745
+ }
1746
+ export interface InvoiceListSummaryParams extends PageParams {
1747
+ amount?: string | null;
1748
+ 'amount[gt]'?: string | null;
1749
+ 'amount[lt]'?: string | null;
1750
+ customer_id?: string | null;
1751
+ date_type?: 'due_date' | 'invoice_date' | null;
1752
+ due_date?: string | null;
1753
+ /**
1754
+ * Filters invoices by their due dates within a specific time range in the past.
1755
+ * Specify the range as a number followed by 'd' (days) or 'm' (months). For
1756
+ * example, '7d' filters invoices due in the last 7 days, and '2m' filters those
1757
+ * due in the last 2 months.
1758
+ */
1759
+ due_date_window?: string | null;
1760
+ 'due_date[gt]'?: string | null;
1761
+ 'due_date[lt]'?: string | null;
1762
+ external_customer_id?: string | null;
1763
+ 'invoice_date[gt]'?: string | null;
1764
+ 'invoice_date[gte]'?: string | null;
1765
+ 'invoice_date[lt]'?: string | null;
1766
+ 'invoice_date[lte]'?: string | null;
1767
+ is_recurring?: boolean | null;
1768
+ status?: 'draft' | 'issued' | 'paid' | 'synced' | 'void' | null;
1769
+ subscription_id?: string | null;
1770
+ }
1771
+ export interface InvoiceMarkPaidParams {
1772
+ /**
1773
+ * A date string to specify the date of the payment.
1774
+ */
1775
+ payment_received_date: string;
1776
+ /**
1777
+ * An optional external ID to associate with the payment.
1778
+ */
1779
+ external_id?: string | null;
1780
+ /**
1781
+ * An optional note to associate with the payment.
1782
+ */
1783
+ notes?: string | null;
1784
+ }
1785
+ export interface InvoicePayParams {
1786
+ /**
1787
+ * The ID of a shared payment token granted by an agent to use for this payment.
1788
+ */
1789
+ shared_payment_token_id: string;
1790
+ }
1791
+ export declare namespace Invoices {
1792
+ export { type InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse, type InvoiceIssueSummaryResponse as InvoiceIssueSummaryResponse, type InvoiceListSummaryResponse as InvoiceListSummaryResponse, type InvoiceListSummaryResponsesPage as InvoiceListSummaryResponsesPage, type InvoiceCreateParams as InvoiceCreateParams, type InvoiceUpdateParams as InvoiceUpdateParams, type InvoiceListParams as InvoiceListParams, type InvoiceDeleteLineItemParams as InvoiceDeleteLineItemParams, type InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams, type InvoiceIssueParams as InvoiceIssueParams, type InvoiceIssueSummaryParams as InvoiceIssueSummaryParams, type InvoiceListSummaryParams as InvoiceListSummaryParams, type InvoiceMarkPaidParams as InvoiceMarkPaidParams, type InvoicePayParams as InvoicePayParams, };
1793
+ }
1794
+ export { type InvoicesPage };
1795
+ //# sourceMappingURL=invoices.d.mts.map