modern-treasury 2.2.0 → 2.4.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 (373) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/README.md +43 -15
  3. package/_shims/ReadableStream-node.d.ts +6 -0
  4. package/_shims/ReadableStream-node.d.ts.map +1 -0
  5. package/_shims/ReadableStream-node.js +14 -0
  6. package/_shims/ReadableStream-node.js.map +1 -0
  7. package/_shims/ReadableStream-node.mjs +3 -0
  8. package/_shims/ReadableStream-node.mjs.map +1 -0
  9. package/_shims/ReadableStream.d.ts +38 -0
  10. package/_shims/ReadableStream.js +5 -0
  11. package/_shims/ReadableStream.mjs +7 -0
  12. package/_shims/{agent.node.d.ts → agent-node.d.ts} +1 -1
  13. package/_shims/agent-node.d.ts.map +1 -0
  14. package/_shims/{agent.node.js → agent-node.js} +1 -1
  15. package/_shims/{agent.node.js.map → agent-node.js.map} +1 -1
  16. package/_shims/{agent.node.mjs → agent-node.mjs} +1 -1
  17. package/_shims/{agent.node.mjs.map → agent-node.mjs.map} +1 -1
  18. package/_shims/agent.d.ts +1 -1
  19. package/_shims/agent.js +1 -1
  20. package/_shims/agent.mjs +1 -1
  21. package/_shims/{fetch.node.d.ts → fetch-node.d.ts} +12 -1
  22. package/_shims/fetch.d.ts +9 -1
  23. package/_shims/{fileFromPath.node.d.ts → fileFromPath-node.d.ts} +2 -2
  24. package/_shims/{fileFromPath.node.d.ts.map → fileFromPath-node.d.ts.map} +1 -1
  25. package/_shims/{fileFromPath.node.js → fileFromPath-node.js} +1 -1
  26. package/_shims/{fileFromPath.node.js.map → fileFromPath-node.js.map} +1 -1
  27. package/_shims/{fileFromPath.node.mjs → fileFromPath-node.mjs} +1 -1
  28. package/_shims/{fileFromPath.node.mjs.map → fileFromPath-node.mjs.map} +1 -1
  29. package/_shims/fileFromPath.d.ts +2 -2
  30. package/_shims/fileFromPath.d.ts.map +1 -1
  31. package/_shims/fileFromPath.js +1 -1
  32. package/_shims/fileFromPath.mjs +1 -1
  33. package/_shims/form-data.js +17 -0
  34. package/_shims/form-data.mjs +20 -0
  35. package/_shims/{getMultipartRequestOptions.node.d.ts → getMultipartRequestOptions-node.d.ts} +2 -2
  36. package/_shims/getMultipartRequestOptions-node.d.ts.map +1 -0
  37. package/_shims/{getMultipartRequestOptions.node.js → getMultipartRequestOptions-node.js} +1 -1
  38. package/_shims/{getMultipartRequestOptions.node.js.map → getMultipartRequestOptions-node.js.map} +1 -1
  39. package/_shims/{getMultipartRequestOptions.node.mjs → getMultipartRequestOptions-node.mjs} +1 -1
  40. package/_shims/{getMultipartRequestOptions.node.mjs.map → getMultipartRequestOptions-node.mjs.map} +1 -1
  41. package/_shims/getMultipartRequestOptions.d.ts +1 -1
  42. package/_shims/getMultipartRequestOptions.d.ts.map +1 -1
  43. package/_shims/{node-readable.node.d.ts → node-readable-node.d.ts} +1 -1
  44. package/_shims/{node-readable.node.d.ts.map → node-readable-node.d.ts.map} +1 -1
  45. package/_shims/{node-readable.node.js → node-readable-node.js} +1 -1
  46. package/_shims/node-readable-node.js.map +1 -0
  47. package/_shims/{node-readable.node.mjs → node-readable-node.mjs} +1 -1
  48. package/_shims/node-readable-node.mjs.map +1 -0
  49. package/core.d.ts +91 -34
  50. package/core.d.ts.map +1 -1
  51. package/core.js +201 -70
  52. package/core.js.map +1 -1
  53. package/core.mjs +195 -70
  54. package/core.mjs.map +1 -1
  55. package/index.d.mts +19 -7
  56. package/index.d.ts +19 -7
  57. package/index.d.ts.map +1 -1
  58. package/index.js +23 -9
  59. package/index.js.map +1 -1
  60. package/index.mjs +23 -9
  61. package/index.mjs.map +1 -1
  62. package/package.json +32 -9
  63. package/pagination.d.ts +2 -2
  64. package/pagination.d.ts.map +1 -1
  65. package/pagination.js +5 -5
  66. package/pagination.js.map +1 -1
  67. package/pagination.mjs +5 -5
  68. package/pagination.mjs.map +1 -1
  69. package/resources/account-collection-flows.d.ts +8 -33
  70. package/resources/account-collection-flows.d.ts.map +1 -1
  71. package/resources/account-collection-flows.js +22 -17
  72. package/resources/account-collection-flows.js.map +1 -1
  73. package/resources/account-collection-flows.mjs +22 -17
  74. package/resources/account-collection-flows.mjs.map +1 -1
  75. package/resources/account-details.d.ts +8 -13
  76. package/resources/account-details.d.ts.map +1 -1
  77. package/resources/account-details.js +10 -4
  78. package/resources/account-details.js.map +1 -1
  79. package/resources/account-details.mjs +10 -4
  80. package/resources/account-details.mjs.map +1 -1
  81. package/resources/connections.d.ts +5 -2
  82. package/resources/connections.d.ts.map +1 -1
  83. package/resources/connections.js +3 -3
  84. package/resources/connections.js.map +1 -1
  85. package/resources/connections.mjs +3 -3
  86. package/resources/connections.mjs.map +1 -1
  87. package/resources/counterparties.d.ts +37 -51
  88. package/resources/counterparties.d.ts.map +1 -1
  89. package/resources/counterparties.js +17 -5
  90. package/resources/counterparties.js.map +1 -1
  91. package/resources/counterparties.mjs +17 -5
  92. package/resources/counterparties.mjs.map +1 -1
  93. package/resources/documents.d.ts +6 -17
  94. package/resources/documents.d.ts.map +1 -1
  95. package/resources/documents.js +13 -7
  96. package/resources/documents.js.map +1 -1
  97. package/resources/documents.mjs +13 -7
  98. package/resources/documents.mjs.map +1 -1
  99. package/resources/events.d.ts +3 -3
  100. package/resources/events.d.ts.map +1 -1
  101. package/resources/events.js +3 -3
  102. package/resources/events.mjs +3 -3
  103. package/resources/expected-payments.d.ts +30 -39
  104. package/resources/expected-payments.d.ts.map +1 -1
  105. package/resources/expected-payments.js +10 -4
  106. package/resources/expected-payments.js.map +1 -1
  107. package/resources/expected-payments.mjs +10 -4
  108. package/resources/expected-payments.mjs.map +1 -1
  109. package/resources/external-accounts.d.ts +27 -61
  110. package/resources/external-accounts.d.ts.map +1 -1
  111. package/resources/external-accounts.js +24 -6
  112. package/resources/external-accounts.js.map +1 -1
  113. package/resources/external-accounts.mjs +24 -6
  114. package/resources/external-accounts.mjs.map +1 -1
  115. package/resources/incoming-payment-details.d.ts +20 -21
  116. package/resources/incoming-payment-details.d.ts.map +1 -1
  117. package/resources/incoming-payment-details.js +10 -4
  118. package/resources/incoming-payment-details.js.map +1 -1
  119. package/resources/incoming-payment-details.mjs +10 -4
  120. package/resources/incoming-payment-details.mjs.map +1 -1
  121. package/resources/index.d.ts +0 -3
  122. package/resources/index.d.ts.map +1 -1
  123. package/resources/index.js.map +1 -1
  124. package/resources/index.mjs.map +1 -1
  125. package/resources/internal-accounts/balance-reports.d.ts +6 -3
  126. package/resources/internal-accounts/balance-reports.d.ts.map +1 -1
  127. package/resources/internal-accounts/balance-reports.js +3 -3
  128. package/resources/internal-accounts/balance-reports.js.map +1 -1
  129. package/resources/internal-accounts/balance-reports.mjs +3 -3
  130. package/resources/internal-accounts/balance-reports.mjs.map +1 -1
  131. package/resources/internal-accounts/internal-accounts.d.ts +16 -21
  132. package/resources/internal-accounts/internal-accounts.d.ts.map +1 -1
  133. package/resources/internal-accounts/internal-accounts.js +10 -4
  134. package/resources/internal-accounts/internal-accounts.js.map +1 -1
  135. package/resources/internal-accounts/internal-accounts.mjs +10 -4
  136. package/resources/internal-accounts/internal-accounts.mjs.map +1 -1
  137. package/resources/invoices/invoices.d.ts +67 -42
  138. package/resources/invoices/invoices.d.ts.map +1 -1
  139. package/resources/invoices/invoices.js +10 -4
  140. package/resources/invoices/invoices.js.map +1 -1
  141. package/resources/invoices/invoices.mjs +10 -4
  142. package/resources/invoices/invoices.mjs.map +1 -1
  143. package/resources/invoices/line-items.d.ts +32 -185
  144. package/resources/invoices/line-items.d.ts.map +1 -1
  145. package/resources/invoices/line-items.js +10 -4
  146. package/resources/invoices/line-items.js.map +1 -1
  147. package/resources/invoices/line-items.mjs +10 -4
  148. package/resources/invoices/line-items.mjs.map +1 -1
  149. package/resources/ledger-account-categories.d.ts +47 -87
  150. package/resources/ledger-account-categories.d.ts.map +1 -1
  151. package/resources/ledger-account-categories.js +21 -17
  152. package/resources/ledger-account-categories.js.map +1 -1
  153. package/resources/ledger-account-categories.mjs +21 -17
  154. package/resources/ledger-account-categories.mjs.map +1 -1
  155. package/resources/ledger-account-payouts.d.ts +33 -22
  156. package/resources/ledger-account-payouts.d.ts.map +1 -1
  157. package/resources/ledger-account-payouts.js +10 -4
  158. package/resources/ledger-account-payouts.js.map +1 -1
  159. package/resources/ledger-account-payouts.mjs +10 -4
  160. package/resources/ledger-account-payouts.mjs.map +1 -1
  161. package/resources/ledger-account-statements.d.ts +11 -16
  162. package/resources/ledger-account-statements.d.ts.map +1 -1
  163. package/resources/ledger-account-statements.js +8 -2
  164. package/resources/ledger-account-statements.js.map +1 -1
  165. package/resources/ledger-account-statements.mjs +8 -2
  166. package/resources/ledger-account-statements.mjs.map +1 -1
  167. package/resources/ledger-accounts.d.ts +30 -30
  168. package/resources/ledger-accounts.d.ts.map +1 -1
  169. package/resources/ledger-accounts.js +10 -4
  170. package/resources/ledger-accounts.js.map +1 -1
  171. package/resources/ledger-accounts.mjs +10 -4
  172. package/resources/ledger-accounts.mjs.map +1 -1
  173. package/resources/ledger-entries.d.ts +20 -6
  174. package/resources/ledger-entries.d.ts.map +1 -1
  175. package/resources/ledger-entries.js +3 -3
  176. package/resources/ledger-entries.js.map +1 -1
  177. package/resources/ledger-entries.mjs +3 -3
  178. package/resources/ledger-entries.mjs.map +1 -1
  179. package/resources/ledger-event-handlers.d.ts +12 -24
  180. package/resources/ledger-event-handlers.d.ts.map +1 -1
  181. package/resources/ledger-event-handlers.js +10 -4
  182. package/resources/ledger-event-handlers.js.map +1 -1
  183. package/resources/ledger-event-handlers.mjs +10 -4
  184. package/resources/ledger-event-handlers.mjs.map +1 -1
  185. package/resources/ledger-transactions/ledger-transactions.d.ts +48 -37
  186. package/resources/ledger-transactions/ledger-transactions.d.ts.map +1 -1
  187. package/resources/ledger-transactions/ledger-transactions.js +13 -7
  188. package/resources/ledger-transactions/ledger-transactions.js.map +1 -1
  189. package/resources/ledger-transactions/ledger-transactions.mjs +13 -7
  190. package/resources/ledger-transactions/ledger-transactions.mjs.map +1 -1
  191. package/resources/ledger-transactions/versions.d.ts +4 -2
  192. package/resources/ledger-transactions/versions.d.ts.map +1 -1
  193. package/resources/ledger-transactions/versions.js +3 -3
  194. package/resources/ledger-transactions/versions.js.map +1 -1
  195. package/resources/ledger-transactions/versions.mjs +3 -3
  196. package/resources/ledger-transactions/versions.mjs.map +1 -1
  197. package/resources/ledgerable-events.d.ts +13 -18
  198. package/resources/ledgerable-events.d.ts.map +1 -1
  199. package/resources/ledgerable-events.js +8 -2
  200. package/resources/ledgerable-events.js.map +1 -1
  201. package/resources/ledgerable-events.mjs +8 -2
  202. package/resources/ledgerable-events.mjs.map +1 -1
  203. package/resources/ledgers.d.ts +16 -20
  204. package/resources/ledgers.d.ts.map +1 -1
  205. package/resources/ledgers.js +10 -4
  206. package/resources/ledgers.js.map +1 -1
  207. package/resources/ledgers.mjs +10 -4
  208. package/resources/ledgers.mjs.map +1 -1
  209. package/resources/line-items.d.ts +5 -5
  210. package/resources/line-items.d.ts.map +1 -1
  211. package/resources/line-items.js +3 -3
  212. package/resources/line-items.mjs +3 -3
  213. package/resources/paper-items.d.ts +6 -3
  214. package/resources/paper-items.d.ts.map +1 -1
  215. package/resources/paper-items.js +3 -3
  216. package/resources/paper-items.js.map +1 -1
  217. package/resources/paper-items.mjs +3 -3
  218. package/resources/paper-items.mjs.map +1 -1
  219. package/resources/payment-flows.d.ts +18 -42
  220. package/resources/payment-flows.d.ts.map +1 -1
  221. package/resources/payment-flows.js +22 -17
  222. package/resources/payment-flows.js.map +1 -1
  223. package/resources/payment-flows.mjs +22 -17
  224. package/resources/payment-flows.mjs.map +1 -1
  225. package/resources/payment-orders/payment-orders.d.ts +172 -191
  226. package/resources/payment-orders/payment-orders.d.ts.map +1 -1
  227. package/resources/payment-orders/payment-orders.js +21 -11
  228. package/resources/payment-orders/payment-orders.js.map +1 -1
  229. package/resources/payment-orders/payment-orders.mjs +21 -11
  230. package/resources/payment-orders/payment-orders.mjs.map +1 -1
  231. package/resources/payment-orders/reversals.d.ts +21 -22
  232. package/resources/payment-orders/reversals.d.ts.map +1 -1
  233. package/resources/payment-orders/reversals.js +10 -4
  234. package/resources/payment-orders/reversals.js.map +1 -1
  235. package/resources/payment-orders/reversals.mjs +10 -4
  236. package/resources/payment-orders/reversals.mjs.map +1 -1
  237. package/resources/payment-references.d.ts +3 -3
  238. package/resources/payment-references.d.ts.map +1 -1
  239. package/resources/payment-references.js +3 -3
  240. package/resources/payment-references.mjs +3 -3
  241. package/resources/returns.d.ts +16 -19
  242. package/resources/returns.d.ts.map +1 -1
  243. package/resources/returns.js +10 -4
  244. package/resources/returns.js.map +1 -1
  245. package/resources/returns.mjs +10 -4
  246. package/resources/returns.mjs.map +1 -1
  247. package/resources/routing-details.d.ts +9 -15
  248. package/resources/routing-details.d.ts.map +1 -1
  249. package/resources/routing-details.js +10 -4
  250. package/resources/routing-details.js.map +1 -1
  251. package/resources/routing-details.mjs +10 -4
  252. package/resources/routing-details.mjs.map +1 -1
  253. package/resources/transactions/line-items.d.ts +5 -2
  254. package/resources/transactions/line-items.d.ts.map +1 -1
  255. package/resources/transactions/line-items.js +3 -3
  256. package/resources/transactions/line-items.js.map +1 -1
  257. package/resources/transactions/line-items.mjs +3 -3
  258. package/resources/transactions/line-items.mjs.map +1 -1
  259. package/resources/transactions/transactions.d.ts +8 -5
  260. package/resources/transactions/transactions.d.ts.map +1 -1
  261. package/resources/transactions/transactions.js +3 -3
  262. package/resources/transactions/transactions.js.map +1 -1
  263. package/resources/transactions/transactions.mjs +3 -3
  264. package/resources/transactions/transactions.mjs.map +1 -1
  265. package/resources/validations.d.ts +1 -1
  266. package/resources/validations.d.ts.map +1 -1
  267. package/resources/validations.js +1 -1
  268. package/resources/validations.mjs +1 -1
  269. package/resources/virtual-accounts.d.ts +19 -28
  270. package/resources/virtual-accounts.d.ts.map +1 -1
  271. package/resources/virtual-accounts.js +10 -4
  272. package/resources/virtual-accounts.js.map +1 -1
  273. package/resources/virtual-accounts.mjs +10 -4
  274. package/resources/virtual-accounts.mjs.map +1 -1
  275. package/resources/webhooks.js +2 -2
  276. package/resources/webhooks.mjs +2 -2
  277. package/src/_shims/ReadableStream-node.ts +6 -0
  278. package/src/_shims/ReadableStream.d.ts +38 -0
  279. package/src/_shims/ReadableStream.js +5 -0
  280. package/src/_shims/ReadableStream.mjs +7 -0
  281. package/src/_shims/agent.ts +1 -1
  282. package/src/_shims/{fetch.node.d.ts → fetch-node.d.ts} +20 -9
  283. package/src/_shims/fetch.d.ts +18 -10
  284. package/src/_shims/{fileFromPath.node.ts → fileFromPath-node.ts} +1 -1
  285. package/src/_shims/fileFromPath.ts +2 -2
  286. package/src/_shims/{formdata.node.d.ts → form-data-node.d.ts} +4 -4
  287. package/src/_shims/{formdata.d.ts → form-data.d.ts} +4 -4
  288. package/src/_shims/form-data.js +17 -0
  289. package/src/_shims/form-data.mjs +20 -0
  290. package/src/_shims/{getMultipartRequestOptions.node.ts → getMultipartRequestOptions-node.ts} +3 -3
  291. package/src/_shims/getMultipartRequestOptions.ts +3 -3
  292. package/src/core.ts +275 -97
  293. package/src/error.ts +1 -1
  294. package/src/index.ts +31 -18
  295. package/src/pagination.ts +6 -6
  296. package/src/resource.ts +1 -1
  297. package/src/resources/account-collection-flows.ts +29 -57
  298. package/src/resources/account-details.ts +22 -22
  299. package/src/resources/connections.ts +11 -8
  300. package/src/resources/counterparties.ts +61 -65
  301. package/src/resources/documents.ts +21 -30
  302. package/src/resources/events.ts +9 -9
  303. package/src/resources/expected-payments.ts +45 -49
  304. package/src/resources/external-accounts.ts +59 -78
  305. package/src/resources/incoming-payment-details.ts +38 -33
  306. package/src/resources/index.ts +39 -36
  307. package/src/resources/internal-accounts/balance-reports.ts +13 -10
  308. package/src/resources/internal-accounts/index.ts +2 -2
  309. package/src/resources/internal-accounts/internal-accounts.ts +35 -35
  310. package/src/resources/invoices/index.ts +2 -2
  311. package/src/resources/invoices/invoices.ts +91 -54
  312. package/src/resources/invoices/line-items.ts +46 -228
  313. package/src/resources/ledger-account-categories.ts +67 -111
  314. package/src/resources/ledger-account-payouts.ts +49 -30
  315. package/src/resources/ledger-account-statements.ts +21 -21
  316. package/src/resources/ledger-accounts.ts +46 -40
  317. package/src/resources/ledger-entries.ts +29 -13
  318. package/src/resources/ledger-event-handlers.ts +25 -35
  319. package/src/resources/ledger-transactions/index.ts +2 -2
  320. package/src/resources/ledger-transactions/ledger-transactions.ts +73 -53
  321. package/src/resources/ledger-transactions/versions.ts +10 -8
  322. package/src/resources/ledgerable-events.ts +23 -23
  323. package/src/resources/ledgers.ts +31 -29
  324. package/src/resources/line-items.ts +12 -12
  325. package/src/resources/paper-items.ts +13 -10
  326. package/src/resources/payment-flows.ts +39 -66
  327. package/src/resources/payment-orders/index.ts +2 -2
  328. package/src/resources/payment-orders/payment-orders.ts +204 -216
  329. package/src/resources/payment-orders/reversals.ts +36 -31
  330. package/src/resources/payment-references.ts +9 -9
  331. package/src/resources/returns.ts +30 -28
  332. package/src/resources/routing-details.ts +23 -24
  333. package/src/resources/top-level.ts +1 -1
  334. package/src/resources/transactions/index.ts +7 -2
  335. package/src/resources/transactions/line-items.ts +11 -8
  336. package/src/resources/transactions/transactions.ts +17 -14
  337. package/src/resources/validations.ts +4 -4
  338. package/src/resources/virtual-accounts.ts +35 -39
  339. package/src/resources/webhooks.ts +3 -3
  340. package/src/tsconfig.json +11 -0
  341. package/src/uploads.ts +6 -6
  342. package/src/version.ts +1 -1
  343. package/uploads.d.ts +1 -1
  344. package/uploads.d.ts.map +1 -1
  345. package/uploads.js +7 -7
  346. package/uploads.js.map +1 -1
  347. package/uploads.mjs +4 -4
  348. package/uploads.mjs.map +1 -1
  349. package/version.d.ts +1 -1
  350. package/version.js +1 -1
  351. package/version.mjs +1 -1
  352. package/_shims/agent.node.d.ts.map +0 -1
  353. package/_shims/formdata.js +0 -9
  354. package/_shims/formdata.mjs +0 -11
  355. package/_shims/getMultipartRequestOptions.node.d.ts.map +0 -1
  356. package/_shims/node-readable.node.js.map +0 -1
  357. package/_shims/node-readable.node.mjs.map +0 -1
  358. package/src/_shims/fetch.deno.ts +0 -23
  359. package/src/_shims/formdata.deno.ts +0 -16
  360. package/src/_shims/formdata.js +0 -9
  361. package/src/_shims/formdata.mjs +0 -11
  362. /package/_shims/{fetch.node.js → fetch-node.js} +0 -0
  363. /package/_shims/{fetch.node.mjs → fetch-node.mjs} +0 -0
  364. /package/_shims/{formdata.node.d.ts → form-data-node.d.ts} +0 -0
  365. /package/_shims/{formdata.node.js → form-data-node.js} +0 -0
  366. /package/_shims/{formdata.node.mjs → form-data-node.mjs} +0 -0
  367. /package/_shims/{formdata.d.ts → form-data.d.ts} +0 -0
  368. /package/src/_shims/{agent.node.ts → agent-node.ts} +0 -0
  369. /package/src/_shims/{fetch.node.js → fetch-node.js} +0 -0
  370. /package/src/_shims/{fetch.node.mjs → fetch-node.mjs} +0 -0
  371. /package/src/_shims/{formdata.node.js → form-data-node.js} +0 -0
  372. /package/src/_shims/{formdata.node.mjs → form-data-node.mjs} +0 -0
  373. /package/src/_shims/{node-readable.node.ts → node-readable-node.ts} +0 -0
@@ -1,15 +1,15 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from '../../core';
4
- import { APIResource } from '../../resource';
5
- import { isRequestOptions } from '../../core';
6
- import * as Returns from '../returns';
7
- import * as ExternalAccounts from '../external-accounts';
8
- import * as Shared from '../shared';
9
- import { Reversals } from './reversals';
10
- import * as API from './index';
11
- import { type Uploadable, maybeMultipartFormRequestOptions } from '../../core';
12
- import { Page, PageParams } from '../../pagination';
3
+ import * as Core from '../../core.js';
4
+ import { APIResource } from '../../resource.js';
5
+ import { isRequestOptions } from '../../core.js';
6
+ import * as Returns from '../returns.js';
7
+ import * as ExternalAccounts from '../external-accounts.js';
8
+ import * as Shared from '../shared.js';
9
+ import { Reversals } from './reversals.js';
10
+ import * as API from './index.js';
11
+ import { type Uploadable, maybeMultipartFormRequestOptions } from '../../core.js';
12
+ import { Page, PageParams } from '../../pagination.js';
13
13
 
14
14
  export class PaymentOrders extends APIResource {
15
15
  reversals: Reversals = new Reversals(this.client);
@@ -17,21 +17,20 @@ export class PaymentOrders extends APIResource {
17
17
  /**
18
18
  * Create a new Payment Order
19
19
  */
20
- async create(
21
- params: PaymentOrderCreateParams,
22
- options?: Core.RequestOptions,
23
- ): Promise<Core.APIResponse<PaymentOrder>> {
24
- const { 'Content-Type': contentType, 'Idempotency-Key': idempotencyKey, ...body } = params;
20
+ create(params: PaymentOrderCreateParams, options?: Core.RequestOptions): Core.APIPromise<PaymentOrder> {
21
+ // @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
22
+ const { 'Idempotency-Key': idempotencyKey, ...body } = params;
23
+ if (idempotencyKey) {
24
+ console.warn(
25
+ "The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
26
+ );
27
+ }
25
28
  return this.post(
26
29
  '/api/payment_orders',
27
- await maybeMultipartFormRequestOptions({
30
+ maybeMultipartFormRequestOptions({
28
31
  body,
29
32
  ...options,
30
- headers: {
31
- 'Content-Type': contentType?.toString() || '',
32
- 'Idempotency-Key': idempotencyKey || '',
33
- ...options?.headers,
34
- },
33
+ headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
35
34
  }),
36
35
  );
37
36
  }
@@ -39,7 +38,7 @@ export class PaymentOrders extends APIResource {
39
38
  /**
40
39
  * Get details on a single payment order
41
40
  */
42
- retrieve(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<PaymentOrder>> {
41
+ retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<PaymentOrder> {
43
42
  return this.get(`/api/payment_orders/${id}`, options);
44
43
  }
45
44
 
@@ -50,13 +49,13 @@ export class PaymentOrders extends APIResource {
50
49
  id: string,
51
50
  body?: PaymentOrderUpdateParams,
52
51
  options?: Core.RequestOptions,
53
- ): Promise<Core.APIResponse<PaymentOrder>>;
54
- update(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<PaymentOrder>>;
52
+ ): Core.APIPromise<PaymentOrder>;
53
+ update(id: string, options?: Core.RequestOptions): Core.APIPromise<PaymentOrder>;
55
54
  update(
56
55
  id: string,
57
56
  body: PaymentOrderUpdateParams | Core.RequestOptions = {},
58
57
  options?: Core.RequestOptions,
59
- ): Promise<Core.APIResponse<PaymentOrder>> {
58
+ ): Core.APIPromise<PaymentOrder> {
60
59
  if (isRequestOptions(body)) {
61
60
  return this.update(id, {}, body);
62
61
  }
@@ -66,12 +65,15 @@ export class PaymentOrders extends APIResource {
66
65
  /**
67
66
  * Get a list of all payment orders
68
67
  */
69
- list(query?: PaymentOrderListParams, options?: Core.RequestOptions): Core.PagePromise<PaymentOrdersPage>;
70
- list(options?: Core.RequestOptions): Core.PagePromise<PaymentOrdersPage>;
68
+ list(
69
+ query?: PaymentOrderListParams,
70
+ options?: Core.RequestOptions,
71
+ ): Core.PagePromise<PaymentOrdersPage, PaymentOrder>;
72
+ list(options?: Core.RequestOptions): Core.PagePromise<PaymentOrdersPage, PaymentOrder>;
71
73
  list(
72
74
  query: PaymentOrderListParams | Core.RequestOptions = {},
73
75
  options?: Core.RequestOptions,
74
- ): Core.PagePromise<PaymentOrdersPage> {
76
+ ): Core.PagePromise<PaymentOrdersPage, PaymentOrder> {
75
77
  if (isRequestOptions(query)) {
76
78
  return this.list({}, query);
77
79
  }
@@ -84,12 +86,18 @@ export class PaymentOrders extends APIResource {
84
86
  createAsync(
85
87
  params: PaymentOrderCreateAsyncParams,
86
88
  options?: Core.RequestOptions,
87
- ): Promise<Core.APIResponse<Shared.AsyncResponse>> {
89
+ ): Core.APIPromise<Shared.AsyncResponse> {
90
+ // @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
88
91
  const { 'Idempotency-Key': idempotencyKey, ...body } = params;
92
+ if (idempotencyKey) {
93
+ console.warn(
94
+ "The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
95
+ );
96
+ }
89
97
  return this.post('/api/payment_orders/create_async', {
90
98
  body,
91
99
  ...options,
92
- headers: { 'Idempotency-Key': idempotencyKey || '', ...options?.headers },
100
+ headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
93
101
  });
94
102
  }
95
103
  }
@@ -491,149 +499,141 @@ export type PaymentOrderType =
491
499
 
492
500
  export interface PaymentOrderCreateParams {
493
501
  /**
494
- * Body param: Value in specified currency's smallest unit. e.g. $10 would be
495
- * represented as 1000 (cents). For RTP, the maximum amount allowed by the network
496
- * is $100,000.
502
+ * Value in specified currency's smallest unit. e.g. $10 would be represented as
503
+ * 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
497
504
  */
498
505
  amount: number;
499
506
 
500
507
  /**
501
- * Body param: One of `credit`, `debit`. Describes the direction money is flowing
502
- * in the transaction. A `credit` moves money from your account to someone else's.
503
- * A `debit` pulls money from someone else's account to your own. Note that wire,
508
+ * One of `credit`, `debit`. Describes the direction money is flowing in the
509
+ * transaction. A `credit` moves money from your account to someone else's. A
510
+ * `debit` pulls money from someone else's account to your own. Note that wire,
504
511
  * rtp, and check payments will always be `credit`.
505
512
  */
506
513
  direction: 'credit' | 'debit';
507
514
 
508
515
  /**
509
- * Body param: The ID of one of your organization's internal accounts.
516
+ * The ID of one of your organization's internal accounts.
510
517
  */
511
518
  originating_account_id: string;
512
519
 
513
520
  /**
514
- * Body param: One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`,
515
- * `bacs`, `au_becs`, `interac`, `signet`, `provexchange`.
521
+ * One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`,
522
+ * `au_becs`, `interac`, `signet`, `provexchange`.
516
523
  */
517
524
  type: PaymentOrderType;
518
525
 
519
- /**
520
- * Body param:
521
- */
522
526
  accounting?: PaymentOrderCreateParams.Accounting;
523
527
 
524
528
  /**
525
- * Body param: The ID of one of your accounting categories. Note that these will
526
- * only be accessible if your accounting system has been connected.
529
+ * The ID of one of your accounting categories. Note that these will only be
530
+ * accessible if your accounting system has been connected.
527
531
  */
528
532
  accounting_category_id?: string | null;
529
533
 
530
534
  /**
531
- * Body param: The ID of one of your accounting ledger classes. Note that these
532
- * will only be accessible if your accounting system has been connected.
535
+ * The ID of one of your accounting ledger classes. Note that these will only be
536
+ * accessible if your accounting system has been connected.
533
537
  */
534
538
  accounting_ledger_class_id?: string | null;
535
539
 
536
540
  /**
537
- * Body param: The party that will pay the fees for the payment order. Only applies
538
- * to wire payment orders. Can be one of shared, sender, or receiver, which
539
- * correspond respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
541
+ * The party that will pay the fees for the payment order. Only applies to wire
542
+ * payment orders. Can be one of shared, sender, or receiver, which correspond
543
+ * respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
540
544
  */
541
545
  charge_bearer?: 'shared' | 'sender' | 'receiver' | null;
542
546
 
543
547
  /**
544
- * Body param: Defaults to the currency of the originating account.
548
+ * Defaults to the currency of the originating account.
545
549
  */
546
550
  currency?: Shared.Currency | null;
547
551
 
548
552
  /**
549
- * Body param: An optional description for internal use.
553
+ * An optional description for internal use.
550
554
  */
551
555
  description?: string | null;
552
556
 
553
557
  /**
554
- * Body param: An array of documents to be attached to the payment order. Note that
555
- * if you attach documents, the request's content type must be
556
- * `multipart/form-data`.
558
+ * An array of documents to be attached to the payment order. Note that if you
559
+ * attach documents, the request's content type must be `multipart/form-data`.
557
560
  */
558
561
  documents?: Array<PaymentOrderCreateParams.Document>;
559
562
 
560
563
  /**
561
- * Body param: Date transactions are to be posted to the participants' account.
562
- * Defaults to the current business day or the next business day if the current day
563
- * is a bank holiday or weekend. Format: yyyy-mm-dd.
564
+ * Date transactions are to be posted to the participants' account. Defaults to the
565
+ * current business day or the next business day if the current day is a bank
566
+ * holiday or weekend. Format: yyyy-mm-dd.
564
567
  */
565
568
  effective_date?: string;
566
569
 
567
570
  /**
568
- * Body param: RFP payments require an expires_at. This value must be past the
569
- * effective_date.
571
+ * RFP payments require an expires_at. This value must be past the effective_date.
570
572
  */
571
573
  expires_at?: string | null;
572
574
 
573
575
  /**
574
- * Body param: A payment type to fallback to if the original type is not valid for
575
- * the receiving account. Currently, this only supports falling back from RTP to
576
- * ACH (type=rtp and fallback_type=ach)
576
+ * A payment type to fallback to if the original type is not valid for the
577
+ * receiving account. Currently, this only supports falling back from RTP to ACH
578
+ * (type=rtp and fallback_type=ach)
577
579
  */
578
580
  fallback_type?: 'ach';
579
581
 
580
582
  /**
581
- * Body param: If present, indicates a specific foreign exchange contract number
582
- * that has been generated by your financial institution.
583
+ * If present, indicates a specific foreign exchange contract number that has been
584
+ * generated by your financial institution.
583
585
  */
584
586
  foreign_exchange_contract?: string | null;
585
587
 
586
588
  /**
587
- * Body param: Indicates the type of FX transfer to initiate, can be either
589
+ * Indicates the type of FX transfer to initiate, can be either
588
590
  * `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order
589
591
  * currency matches the originating account currency.
590
592
  */
591
593
  foreign_exchange_indicator?: 'fixed_to_variable' | 'variable_to_fixed' | null;
592
594
 
593
595
  /**
594
- * Body param: Specifies a ledger transaction object that will be created with the
595
- * payment order. If the ledger transaction cannot be created, then the payment
596
- * order creation will fail. The resulting ledger transaction will mirror the
597
- * status of the payment order.
596
+ * Specifies a ledger transaction object that will be created with the payment
597
+ * order. If the ledger transaction cannot be created, then the payment order
598
+ * creation will fail. The resulting ledger transaction will mirror the status of
599
+ * the payment order.
598
600
  */
599
601
  ledger_transaction?: PaymentOrderCreateParams.LedgerTransaction;
600
602
 
601
603
  /**
602
- * Body param: An array of line items that must sum up to the amount of the payment
603
- * order.
604
+ * An array of line items that must sum up to the amount of the payment order.
604
605
  */
605
606
  line_items?: Array<PaymentOrderCreateParams.LineItem>;
606
607
 
607
608
  /**
608
- * Body param: Additional data represented as key-value pairs. Both the key and
609
- * value must be strings.
609
+ * Additional data represented as key-value pairs. Both the key and value must be
610
+ * strings.
610
611
  */
611
612
  metadata?: Record<string, string>;
612
613
 
613
614
  /**
614
- * Body param: A boolean to determine if NSF Protection is enabled for this payment
615
- * order. Note that this setting must also be turned on in your organization
616
- * settings page.
615
+ * A boolean to determine if NSF Protection is enabled for this payment order. Note
616
+ * that this setting must also be turned on in your organization settings page.
617
617
  */
618
618
  nsf_protected?: boolean;
619
619
 
620
620
  /**
621
- * Body param: If present, this will replace your default company name on
622
- * receiver's bank statement. This field can only be used for ACH payments
623
- * currently. For ACH, only the first 16 characters of this string will be used.
624
- * Any additional characters will be truncated.
621
+ * If present, this will replace your default company name on receiver's bank
622
+ * statement. This field can only be used for ACH payments currently. For ACH, only
623
+ * the first 16 characters of this string will be used. Any additional characters
624
+ * will be truncated.
625
625
  */
626
626
  originating_party_name?: string | null;
627
627
 
628
628
  /**
629
- * Body param: Either `normal` or `high`. For ACH and EFT payments, `high`
630
- * represents a same-day ACH or EFT transfer, respectively. For check payments,
631
- * `high` can mean an overnight check rather than standard mail.
629
+ * Either `normal` or `high`. For ACH and EFT payments, `high` represents a
630
+ * same-day ACH or EFT transfer, respectively. For check payments, `high` can mean
631
+ * an overnight check rather than standard mail.
632
632
  */
633
633
  priority?: 'high' | 'normal';
634
634
 
635
635
  /**
636
- * Body param: For `wire`, this is usually the purpose which is transmitted via the
636
+ * For `wire`, this is usually the purpose which is transmitted via the
637
637
  * "InstrForDbtrAgt" field in the ISO20022 file. If you are using Currencycloud,
638
638
  * this is the `payment.purpose_code` field. For `eft`, this field is the 3 digit
639
639
  * CPA Code that will be attached to the payment.
@@ -641,86 +641,75 @@ export interface PaymentOrderCreateParams {
641
641
  purpose?: string | null;
642
642
 
643
643
  /**
644
- * Body param: Either `receiving_account` or `receiving_account_id` must be
645
- * present. When using `receiving_account_id`, you may pass the id of an external
646
- * account or an internal account.
644
+ * Either `receiving_account` or `receiving_account_id` must be present. When using
645
+ * `receiving_account_id`, you may pass the id of an external account or an
646
+ * internal account.
647
647
  */
648
648
  receiving_account?: PaymentOrderCreateParams.ReceivingAccount;
649
649
 
650
650
  /**
651
- * Body param: Either `receiving_account` or `receiving_account_id` must be
652
- * present. When using `receiving_account_id`, you may pass the id of an external
653
- * account or an internal account.
651
+ * Either `receiving_account` or `receiving_account_id` must be present. When using
652
+ * `receiving_account_id`, you may pass the id of an external account or an
653
+ * internal account.
654
654
  */
655
655
  receiving_account_id?: string;
656
656
 
657
657
  /**
658
- * Body param: For `ach`, this field will be passed through on an addenda record.
659
- * For `wire` payments the field will be passed through as the "Originator to
660
- * Beneficiary Information", also known as OBI or Fedwire tag 6000.
658
+ * For `ach`, this field will be passed through on an addenda record. For `wire`
659
+ * payments the field will be passed through as the "Originator to Beneficiary
660
+ * Information", also known as OBI or Fedwire tag 6000.
661
661
  */
662
662
  remittance_information?: string | null;
663
663
 
664
664
  /**
665
- * Body param: Send an email to the counterparty when the payment order is sent to
666
- * the bank. If `null`, `send_remittance_advice` on the Counterparty is used.
665
+ * Send an email to the counterparty when the payment order is sent to the bank. If
666
+ * `null`, `send_remittance_advice` on the Counterparty is used.
667
667
  */
668
668
  send_remittance_advice?: boolean | null;
669
669
 
670
670
  /**
671
- * Body param: An optional descriptor which will appear in the receiver's
672
- * statement. For `check` payments this field will be used as the memo line. For
673
- * `ach` the maximum length is 10 characters. Note that for ACH payments, the name
674
- * on your bank account will be included automatically by the bank, so you can use
675
- * the characters for other useful information. For `eft` the maximum length is 15
671
+ * An optional descriptor which will appear in the receiver's statement. For
672
+ * `check` payments this field will be used as the memo line. For `ach` the maximum
673
+ * length is 10 characters. Note that for ACH payments, the name on your bank
674
+ * account will be included automatically by the bank, so you can use the
675
+ * characters for other useful information. For `eft` the maximum length is 15
676
676
  * characters.
677
677
  */
678
678
  statement_descriptor?: string | null;
679
679
 
680
680
  /**
681
- * Body param: An additional layer of classification for the type of payment order
682
- * you are doing. This field is only used for `ach` payment orders currently. For
683
- * `ach` payment orders, the `subtype` represents the SEC code. We currently
684
- * support `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
681
+ * An additional layer of classification for the type of payment order you are
682
+ * doing. This field is only used for `ach` payment orders currently. For `ach`
683
+ * payment orders, the `subtype` represents the SEC code. We currently support
684
+ * `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
685
685
  */
686
686
  subtype?: PaymentOrderSubtype | null;
687
687
 
688
688
  /**
689
- * Body param: A flag that determines whether a payment order should go through
690
- * transaction monitoring.
689
+ * A flag that determines whether a payment order should go through transaction
690
+ * monitoring.
691
691
  */
692
692
  transaction_monitoring_enabled?: boolean;
693
693
 
694
694
  /**
695
- * Body param: Identifier of the ultimate originator of the payment order.
695
+ * Identifier of the ultimate originator of the payment order.
696
696
  */
697
697
  ultimate_originating_party_identifier?: string | null;
698
698
 
699
699
  /**
700
- * Body param: Name of the ultimate originator of the payment order.
700
+ * Name of the ultimate originator of the payment order.
701
701
  */
702
702
  ultimate_originating_party_name?: string | null;
703
703
 
704
704
  /**
705
- * Body param: Identifier of the ultimate funds recipient.
705
+ * Identifier of the ultimate funds recipient.
706
706
  */
707
707
  ultimate_receiving_party_identifier?: string | null;
708
708
 
709
709
  /**
710
- * Body param: Name of the ultimate funds recipient.
710
+ * Name of the ultimate funds recipient.
711
711
  */
712
712
  ultimate_receiving_party_name?: string | null;
713
-
714
- /**
715
- * Header param:
716
- */
717
- 'Content-Type'?: 'application/json' | 'multipart/form-data';
718
-
719
- /**
720
- * Header param: This key should be something unique, preferably something like an
721
- * UUID.
722
- */
723
- 'Idempotency-Key'?: string;
724
713
  }
725
714
 
726
715
  export namespace PaymentOrderCreateParams {
@@ -773,12 +762,6 @@ export namespace PaymentOrderCreateParams {
773
762
  * the payment order.
774
763
  */
775
764
  export interface LedgerTransaction {
776
- /**
777
- * The timestamp (ISO8601 format) at which the ledger transaction happened for
778
- * reporting purposes.
779
- */
780
- effective_at: string;
781
-
782
765
  /**
783
766
  * An array of ledger entry objects.
784
767
  */
@@ -789,6 +772,12 @@ export namespace PaymentOrderCreateParams {
789
772
  */
790
773
  description?: string | null;
791
774
 
775
+ /**
776
+ * The timestamp (ISO8601 format) at which the ledger transaction happened for
777
+ * reporting purposes.
778
+ */
779
+ effective_at?: string;
780
+
792
781
  /**
793
782
  * The date (YYYY-MM-DD) on which the ledger transaction happened for reporting
794
783
  * purposes.
@@ -872,6 +861,12 @@ export namespace PaymentOrderCreateParams {
872
861
  */
873
862
  lock_version?: number | null;
874
863
 
864
+ /**
865
+ * Additional data represented as key-value pairs. Both the key and value must be
866
+ * strings.
867
+ */
868
+ metadata?: Record<string, string>;
869
+
875
870
  /**
876
871
  * Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
877
872
  * account’s pending balance. If any of these conditions would be false after the
@@ -1660,142 +1655,135 @@ export interface PaymentOrderListParams extends PageParams {
1660
1655
 
1661
1656
  export interface PaymentOrderCreateAsyncParams {
1662
1657
  /**
1663
- * Body param: Value in specified currency's smallest unit. e.g. $10 would be
1664
- * represented as 1000 (cents). For RTP, the maximum amount allowed by the network
1665
- * is $100,000.
1658
+ * Value in specified currency's smallest unit. e.g. $10 would be represented as
1659
+ * 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
1666
1660
  */
1667
1661
  amount: number;
1668
1662
 
1669
1663
  /**
1670
- * Body param: One of `credit`, `debit`. Describes the direction money is flowing
1671
- * in the transaction. A `credit` moves money from your account to someone else's.
1672
- * A `debit` pulls money from someone else's account to your own. Note that wire,
1664
+ * One of `credit`, `debit`. Describes the direction money is flowing in the
1665
+ * transaction. A `credit` moves money from your account to someone else's. A
1666
+ * `debit` pulls money from someone else's account to your own. Note that wire,
1673
1667
  * rtp, and check payments will always be `credit`.
1674
1668
  */
1675
1669
  direction: 'credit' | 'debit';
1676
1670
 
1677
1671
  /**
1678
- * Body param: The ID of one of your organization's internal accounts.
1672
+ * The ID of one of your organization's internal accounts.
1679
1673
  */
1680
1674
  originating_account_id: string;
1681
1675
 
1682
1676
  /**
1683
- * Body param: One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`,
1684
- * `bacs`, `au_becs`, `interac`, `signet`, `provexchange`.
1677
+ * One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`,
1678
+ * `au_becs`, `interac`, `signet`, `provexchange`.
1685
1679
  */
1686
1680
  type: PaymentOrderType;
1687
1681
 
1688
- /**
1689
- * Body param:
1690
- */
1691
1682
  accounting?: PaymentOrderCreateAsyncParams.Accounting;
1692
1683
 
1693
1684
  /**
1694
- * Body param: The ID of one of your accounting categories. Note that these will
1695
- * only be accessible if your accounting system has been connected.
1685
+ * The ID of one of your accounting categories. Note that these will only be
1686
+ * accessible if your accounting system has been connected.
1696
1687
  */
1697
1688
  accounting_category_id?: string | null;
1698
1689
 
1699
1690
  /**
1700
- * Body param: The ID of one of your accounting ledger classes. Note that these
1701
- * will only be accessible if your accounting system has been connected.
1691
+ * The ID of one of your accounting ledger classes. Note that these will only be
1692
+ * accessible if your accounting system has been connected.
1702
1693
  */
1703
1694
  accounting_ledger_class_id?: string | null;
1704
1695
 
1705
1696
  /**
1706
- * Body param: The party that will pay the fees for the payment order. Only applies
1707
- * to wire payment orders. Can be one of shared, sender, or receiver, which
1708
- * correspond respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
1697
+ * The party that will pay the fees for the payment order. Only applies to wire
1698
+ * payment orders. Can be one of shared, sender, or receiver, which correspond
1699
+ * respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
1709
1700
  */
1710
1701
  charge_bearer?: 'shared' | 'sender' | 'receiver' | null;
1711
1702
 
1712
1703
  /**
1713
- * Body param: Defaults to the currency of the originating account.
1704
+ * Defaults to the currency of the originating account.
1714
1705
  */
1715
1706
  currency?: Shared.Currency | null;
1716
1707
 
1717
1708
  /**
1718
- * Body param: An optional description for internal use.
1709
+ * An optional description for internal use.
1719
1710
  */
1720
1711
  description?: string | null;
1721
1712
 
1722
1713
  /**
1723
- * Body param: Date transactions are to be posted to the participants' account.
1724
- * Defaults to the current business day or the next business day if the current day
1725
- * is a bank holiday or weekend. Format: yyyy-mm-dd.
1714
+ * Date transactions are to be posted to the participants' account. Defaults to the
1715
+ * current business day or the next business day if the current day is a bank
1716
+ * holiday or weekend. Format: yyyy-mm-dd.
1726
1717
  */
1727
1718
  effective_date?: string;
1728
1719
 
1729
1720
  /**
1730
- * Body param: RFP payments require an expires_at. This value must be past the
1731
- * effective_date.
1721
+ * RFP payments require an expires_at. This value must be past the effective_date.
1732
1722
  */
1733
1723
  expires_at?: string | null;
1734
1724
 
1735
1725
  /**
1736
- * Body param: A payment type to fallback to if the original type is not valid for
1737
- * the receiving account. Currently, this only supports falling back from RTP to
1738
- * ACH (type=rtp and fallback_type=ach)
1726
+ * A payment type to fallback to if the original type is not valid for the
1727
+ * receiving account. Currently, this only supports falling back from RTP to ACH
1728
+ * (type=rtp and fallback_type=ach)
1739
1729
  */
1740
1730
  fallback_type?: 'ach';
1741
1731
 
1742
1732
  /**
1743
- * Body param: If present, indicates a specific foreign exchange contract number
1744
- * that has been generated by your financial institution.
1733
+ * If present, indicates a specific foreign exchange contract number that has been
1734
+ * generated by your financial institution.
1745
1735
  */
1746
1736
  foreign_exchange_contract?: string | null;
1747
1737
 
1748
1738
  /**
1749
- * Body param: Indicates the type of FX transfer to initiate, can be either
1739
+ * Indicates the type of FX transfer to initiate, can be either
1750
1740
  * `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order
1751
1741
  * currency matches the originating account currency.
1752
1742
  */
1753
1743
  foreign_exchange_indicator?: 'fixed_to_variable' | 'variable_to_fixed' | null;
1754
1744
 
1755
1745
  /**
1756
- * Body param: Specifies a ledger transaction object that will be created with the
1757
- * payment order. If the ledger transaction cannot be created, then the payment
1758
- * order creation will fail. The resulting ledger transaction will mirror the
1759
- * status of the payment order.
1746
+ * Specifies a ledger transaction object that will be created with the payment
1747
+ * order. If the ledger transaction cannot be created, then the payment order
1748
+ * creation will fail. The resulting ledger transaction will mirror the status of
1749
+ * the payment order.
1760
1750
  */
1761
1751
  ledger_transaction?: PaymentOrderCreateAsyncParams.LedgerTransaction;
1762
1752
 
1763
1753
  /**
1764
- * Body param: An array of line items that must sum up to the amount of the payment
1765
- * order.
1754
+ * An array of line items that must sum up to the amount of the payment order.
1766
1755
  */
1767
1756
  line_items?: Array<PaymentOrderCreateAsyncParams.LineItem>;
1768
1757
 
1769
1758
  /**
1770
- * Body param: Additional data represented as key-value pairs. Both the key and
1771
- * value must be strings.
1759
+ * Additional data represented as key-value pairs. Both the key and value must be
1760
+ * strings.
1772
1761
  */
1773
1762
  metadata?: Record<string, string>;
1774
1763
 
1775
1764
  /**
1776
- * Body param: A boolean to determine if NSF Protection is enabled for this payment
1777
- * order. Note that this setting must also be turned on in your organization
1778
- * settings page.
1765
+ * A boolean to determine if NSF Protection is enabled for this payment order. Note
1766
+ * that this setting must also be turned on in your organization settings page.
1779
1767
  */
1780
1768
  nsf_protected?: boolean;
1781
1769
 
1782
1770
  /**
1783
- * Body param: If present, this will replace your default company name on
1784
- * receiver's bank statement. This field can only be used for ACH payments
1785
- * currently. For ACH, only the first 16 characters of this string will be used.
1786
- * Any additional characters will be truncated.
1771
+ * If present, this will replace your default company name on receiver's bank
1772
+ * statement. This field can only be used for ACH payments currently. For ACH, only
1773
+ * the first 16 characters of this string will be used. Any additional characters
1774
+ * will be truncated.
1787
1775
  */
1788
1776
  originating_party_name?: string | null;
1789
1777
 
1790
1778
  /**
1791
- * Body param: Either `normal` or `high`. For ACH and EFT payments, `high`
1792
- * represents a same-day ACH or EFT transfer, respectively. For check payments,
1793
- * `high` can mean an overnight check rather than standard mail.
1779
+ * Either `normal` or `high`. For ACH and EFT payments, `high` represents a
1780
+ * same-day ACH or EFT transfer, respectively. For check payments, `high` can mean
1781
+ * an overnight check rather than standard mail.
1794
1782
  */
1795
1783
  priority?: 'high' | 'normal';
1796
1784
 
1797
1785
  /**
1798
- * Body param: For `wire`, this is usually the purpose which is transmitted via the
1786
+ * For `wire`, this is usually the purpose which is transmitted via the
1799
1787
  * "InstrForDbtrAgt" field in the ISO20022 file. If you are using Currencycloud,
1800
1788
  * this is the `payment.purpose_code` field. For `eft`, this field is the 3 digit
1801
1789
  * CPA Code that will be attached to the payment.
@@ -1803,81 +1791,75 @@ export interface PaymentOrderCreateAsyncParams {
1803
1791
  purpose?: string | null;
1804
1792
 
1805
1793
  /**
1806
- * Body param: Either `receiving_account` or `receiving_account_id` must be
1807
- * present. When using `receiving_account_id`, you may pass the id of an external
1808
- * account or an internal account.
1794
+ * Either `receiving_account` or `receiving_account_id` must be present. When using
1795
+ * `receiving_account_id`, you may pass the id of an external account or an
1796
+ * internal account.
1809
1797
  */
1810
1798
  receiving_account?: PaymentOrderCreateAsyncParams.ReceivingAccount;
1811
1799
 
1812
1800
  /**
1813
- * Body param: Either `receiving_account` or `receiving_account_id` must be
1814
- * present. When using `receiving_account_id`, you may pass the id of an external
1815
- * account or an internal account.
1801
+ * Either `receiving_account` or `receiving_account_id` must be present. When using
1802
+ * `receiving_account_id`, you may pass the id of an external account or an
1803
+ * internal account.
1816
1804
  */
1817
1805
  receiving_account_id?: string;
1818
1806
 
1819
1807
  /**
1820
- * Body param: For `ach`, this field will be passed through on an addenda record.
1821
- * For `wire` payments the field will be passed through as the "Originator to
1822
- * Beneficiary Information", also known as OBI or Fedwire tag 6000.
1808
+ * For `ach`, this field will be passed through on an addenda record. For `wire`
1809
+ * payments the field will be passed through as the "Originator to Beneficiary
1810
+ * Information", also known as OBI or Fedwire tag 6000.
1823
1811
  */
1824
1812
  remittance_information?: string | null;
1825
1813
 
1826
1814
  /**
1827
- * Body param: Send an email to the counterparty when the payment order is sent to
1828
- * the bank. If `null`, `send_remittance_advice` on the Counterparty is used.
1815
+ * Send an email to the counterparty when the payment order is sent to the bank. If
1816
+ * `null`, `send_remittance_advice` on the Counterparty is used.
1829
1817
  */
1830
1818
  send_remittance_advice?: boolean | null;
1831
1819
 
1832
1820
  /**
1833
- * Body param: An optional descriptor which will appear in the receiver's
1834
- * statement. For `check` payments this field will be used as the memo line. For
1835
- * `ach` the maximum length is 10 characters. Note that for ACH payments, the name
1836
- * on your bank account will be included automatically by the bank, so you can use
1837
- * the characters for other useful information. For `eft` the maximum length is 15
1821
+ * An optional descriptor which will appear in the receiver's statement. For
1822
+ * `check` payments this field will be used as the memo line. For `ach` the maximum
1823
+ * length is 10 characters. Note that for ACH payments, the name on your bank
1824
+ * account will be included automatically by the bank, so you can use the
1825
+ * characters for other useful information. For `eft` the maximum length is 15
1838
1826
  * characters.
1839
1827
  */
1840
1828
  statement_descriptor?: string | null;
1841
1829
 
1842
1830
  /**
1843
- * Body param: An additional layer of classification for the type of payment order
1844
- * you are doing. This field is only used for `ach` payment orders currently. For
1845
- * `ach` payment orders, the `subtype` represents the SEC code. We currently
1846
- * support `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
1831
+ * An additional layer of classification for the type of payment order you are
1832
+ * doing. This field is only used for `ach` payment orders currently. For `ach`
1833
+ * payment orders, the `subtype` represents the SEC code. We currently support
1834
+ * `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
1847
1835
  */
1848
1836
  subtype?: PaymentOrderSubtype | null;
1849
1837
 
1850
1838
  /**
1851
- * Body param: A flag that determines whether a payment order should go through
1852
- * transaction monitoring.
1839
+ * A flag that determines whether a payment order should go through transaction
1840
+ * monitoring.
1853
1841
  */
1854
1842
  transaction_monitoring_enabled?: boolean;
1855
1843
 
1856
1844
  /**
1857
- * Body param: Identifier of the ultimate originator of the payment order.
1845
+ * Identifier of the ultimate originator of the payment order.
1858
1846
  */
1859
1847
  ultimate_originating_party_identifier?: string | null;
1860
1848
 
1861
1849
  /**
1862
- * Body param: Name of the ultimate originator of the payment order.
1850
+ * Name of the ultimate originator of the payment order.
1863
1851
  */
1864
1852
  ultimate_originating_party_name?: string | null;
1865
1853
 
1866
1854
  /**
1867
- * Body param: Identifier of the ultimate funds recipient.
1855
+ * Identifier of the ultimate funds recipient.
1868
1856
  */
1869
1857
  ultimate_receiving_party_identifier?: string | null;
1870
1858
 
1871
1859
  /**
1872
- * Body param: Name of the ultimate funds recipient.
1860
+ * Name of the ultimate funds recipient.
1873
1861
  */
1874
1862
  ultimate_receiving_party_name?: string | null;
1875
-
1876
- /**
1877
- * Header param: This key should be something unique, preferably something like an
1878
- * UUID.
1879
- */
1880
- 'Idempotency-Key'?: string;
1881
1863
  }
1882
1864
 
1883
1865
  export namespace PaymentOrderCreateAsyncParams {
@@ -1903,12 +1885,6 @@ export namespace PaymentOrderCreateAsyncParams {
1903
1885
  * the payment order.
1904
1886
  */
1905
1887
  export interface LedgerTransaction {
1906
- /**
1907
- * The timestamp (ISO8601 format) at which the ledger transaction happened for
1908
- * reporting purposes.
1909
- */
1910
- effective_at: string;
1911
-
1912
1888
  /**
1913
1889
  * An array of ledger entry objects.
1914
1890
  */
@@ -1919,6 +1895,12 @@ export namespace PaymentOrderCreateAsyncParams {
1919
1895
  */
1920
1896
  description?: string | null;
1921
1897
 
1898
+ /**
1899
+ * The timestamp (ISO8601 format) at which the ledger transaction happened for
1900
+ * reporting purposes.
1901
+ */
1902
+ effective_at?: string;
1903
+
1922
1904
  /**
1923
1905
  * The date (YYYY-MM-DD) on which the ledger transaction happened for reporting
1924
1906
  * purposes.
@@ -2002,6 +1984,12 @@ export namespace PaymentOrderCreateAsyncParams {
2002
1984
  */
2003
1985
  lock_version?: number | null;
2004
1986
 
1987
+ /**
1988
+ * Additional data represented as key-value pairs. Both the key and value must be
1989
+ * strings.
1990
+ */
1991
+ metadata?: Record<string, string>;
1992
+
2005
1993
  /**
2006
1994
  * Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
2007
1995
  * account’s pending balance. If any of these conditions would be false after the