modern-treasury 0.0.1

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 (169) hide show
  1. package/.eslintrc.js +10 -0
  2. package/.prettierrc +6 -0
  3. package/LICENSE +7 -0
  4. package/README.md +198 -0
  5. package/build +10 -0
  6. package/core.ts +746 -0
  7. package/dist/cjs/core.d.ts +215 -0
  8. package/dist/cjs/core.js +815 -0
  9. package/dist/cjs/core.js.map +1 -0
  10. package/dist/cjs/index.d.ts +118 -0
  11. package/dist/cjs/index.js +128 -0
  12. package/dist/cjs/index.js.map +1 -0
  13. package/dist/cjs/pagination.d.ts +14 -0
  14. package/dist/cjs/pagination.js +22 -0
  15. package/dist/cjs/pagination.js.map +1 -0
  16. package/dist/cjs/resource.d.ts +11 -0
  17. package/dist/cjs/resource.js +16 -0
  18. package/dist/cjs/resource.js.map +1 -0
  19. package/dist/cjs/resources/counterparties.d.ts +500 -0
  20. package/dist/cjs/resources/counterparties.js +57 -0
  21. package/dist/cjs/resources/counterparties.js.map +1 -0
  22. package/dist/cjs/resources/documents.d.ts +66 -0
  23. package/dist/cjs/resources/documents.js +23 -0
  24. package/dist/cjs/resources/documents.js.map +1 -0
  25. package/dist/cjs/resources/events.d.ts +53 -0
  26. package/dist/cjs/resources/events.js +22 -0
  27. package/dist/cjs/resources/events.js.map +1 -0
  28. package/dist/cjs/resources/expected-payments.d.ts +928 -0
  29. package/dist/cjs/resources/expected-payments.js +31 -0
  30. package/dist/cjs/resources/expected-payments.js.map +1 -0
  31. package/dist/cjs/resources/external-accounts.d.ts +597 -0
  32. package/dist/cjs/resources/external-accounts.js +51 -0
  33. package/dist/cjs/resources/external-accounts.js.map +1 -0
  34. package/dist/cjs/resources/incoming-payment-details.d.ts +487 -0
  35. package/dist/cjs/resources/incoming-payment-details.js +35 -0
  36. package/dist/cjs/resources/incoming-payment-details.js.map +1 -0
  37. package/dist/cjs/resources/index.d.ts +15 -0
  38. package/dist/cjs/resources/index.js +46 -0
  39. package/dist/cjs/resources/index.js.map +1 -0
  40. package/dist/cjs/resources/internal-accounts.d.ts +666 -0
  41. package/dist/cjs/resources/internal-accounts.js +31 -0
  42. package/dist/cjs/resources/internal-accounts.js.map +1 -0
  43. package/dist/cjs/resources/line-items.d.ts +90 -0
  44. package/dist/cjs/resources/line-items.js +38 -0
  45. package/dist/cjs/resources/line-items.js.map +1 -0
  46. package/dist/cjs/resources/paper-items.d.ts +279 -0
  47. package/dist/cjs/resources/paper-items.js +25 -0
  48. package/dist/cjs/resources/paper-items.js.map +1 -0
  49. package/dist/cjs/resources/payment-orders/index.d.ts +2 -0
  50. package/dist/cjs/resources/payment-orders/index.js +33 -0
  51. package/dist/cjs/resources/payment-orders/index.js.map +1 -0
  52. package/dist/cjs/resources/payment-orders/payment-orders.d.ts +2180 -0
  53. package/dist/cjs/resources/payment-orders/payment-orders.js +56 -0
  54. package/dist/cjs/resources/payment-orders/payment-orders.js.map +1 -0
  55. package/dist/cjs/resources/payment-orders/reversals.d.ts +46 -0
  56. package/dist/cjs/resources/payment-orders/reversals.js +23 -0
  57. package/dist/cjs/resources/payment-orders/reversals.js.map +1 -0
  58. package/dist/cjs/resources/returns.d.ts +487 -0
  59. package/dist/cjs/resources/returns.js +31 -0
  60. package/dist/cjs/resources/returns.js.map +1 -0
  61. package/dist/cjs/resources/top-level.d.ts +3 -0
  62. package/dist/cjs/resources/top-level.js +4 -0
  63. package/dist/cjs/resources/top-level.js.map +1 -0
  64. package/dist/cjs/resources/transactions.d.ts +377 -0
  65. package/dist/cjs/resources/transactions.js +31 -0
  66. package/dist/cjs/resources/transactions.js.map +1 -0
  67. package/dist/cjs/resources/validations.d.ts +97 -0
  68. package/dist/cjs/resources/validations.js +16 -0
  69. package/dist/cjs/resources/validations.js.map +1 -0
  70. package/dist/cjs/resources/webhooks.d.ts +31 -0
  71. package/dist/cjs/resources/webhooks.js +44 -0
  72. package/dist/cjs/resources/webhooks.js.map +1 -0
  73. package/dist/cjs/tests/api-resources/counterparties.test.d.ts +1 -0
  74. package/dist/cjs/tests/api-resources/counterparties.test.js +275 -0
  75. package/dist/cjs/tests/api-resources/counterparties.test.js.map +1 -0
  76. package/dist/cjs/tests/api-resources/documents.test.d.ts +1 -0
  77. package/dist/cjs/tests/api-resources/documents.test.js +78 -0
  78. package/dist/cjs/tests/api-resources/documents.test.js.map +1 -0
  79. package/dist/cjs/tests/api-resources/events.test.d.ts +1 -0
  80. package/dist/cjs/tests/api-resources/events.test.js +100 -0
  81. package/dist/cjs/tests/api-resources/events.test.js.map +1 -0
  82. package/dist/cjs/tests/api-resources/expected-payments.test.d.ts +1 -0
  83. package/dist/cjs/tests/api-resources/expected-payments.test.js +176 -0
  84. package/dist/cjs/tests/api-resources/expected-payments.test.js.map +1 -0
  85. package/dist/cjs/tests/api-resources/external-accounts.test.d.ts +1 -0
  86. package/dist/cjs/tests/api-resources/external-accounts.test.js +248 -0
  87. package/dist/cjs/tests/api-resources/external-accounts.test.js.map +1 -0
  88. package/dist/cjs/tests/api-resources/incoming-payment-details.test.d.ts +1 -0
  89. package/dist/cjs/tests/api-resources/incoming-payment-details.test.js +130 -0
  90. package/dist/cjs/tests/api-resources/incoming-payment-details.test.js.map +1 -0
  91. package/dist/cjs/tests/api-resources/internal-accounts.test.d.ts +1 -0
  92. package/dist/cjs/tests/api-resources/internal-accounts.test.js +144 -0
  93. package/dist/cjs/tests/api-resources/internal-accounts.test.js.map +1 -0
  94. package/dist/cjs/tests/api-resources/line-items.test.d.ts +1 -0
  95. package/dist/cjs/tests/api-resources/line-items.test.js +123 -0
  96. package/dist/cjs/tests/api-resources/line-items.test.js.map +1 -0
  97. package/dist/cjs/tests/api-resources/paper-items.test.d.ts +1 -0
  98. package/dist/cjs/tests/api-resources/paper-items.test.js +96 -0
  99. package/dist/cjs/tests/api-resources/paper-items.test.js.map +1 -0
  100. package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.d.ts +1 -0
  101. package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.js +77 -0
  102. package/dist/cjs/tests/api-resources/payment-orders/payment-orders.test.js.map +1 -0
  103. package/dist/cjs/tests/api-resources/returns.test.d.ts +1 -0
  104. package/dist/cjs/tests/api-resources/returns.test.js +116 -0
  105. package/dist/cjs/tests/api-resources/returns.test.js.map +1 -0
  106. package/dist/cjs/tests/api-resources/top-level.test.d.ts +1 -0
  107. package/dist/cjs/tests/api-resources/top-level.test.js +59 -0
  108. package/dist/cjs/tests/api-resources/top-level.test.js.map +1 -0
  109. package/dist/cjs/tests/api-resources/transactions.test.d.ts +1 -0
  110. package/dist/cjs/tests/api-resources/transactions.test.js +134 -0
  111. package/dist/cjs/tests/api-resources/transactions.test.js.map +1 -0
  112. package/dist/cjs/tests/api-resources/validations.test.d.ts +1 -0
  113. package/dist/cjs/tests/api-resources/validations.test.js +62 -0
  114. package/dist/cjs/tests/api-resources/validations.test.js.map +1 -0
  115. package/dist/cjs/tests/api-resources/webhooks.test.d.ts +1 -0
  116. package/dist/cjs/tests/api-resources/webhooks.test.js +100 -0
  117. package/dist/cjs/tests/api-resources/webhooks.test.js.map +1 -0
  118. package/dist/cjs/tests/form.test.d.ts +1 -0
  119. package/dist/cjs/tests/form.test.js +61 -0
  120. package/dist/cjs/tests/form.test.js.map +1 -0
  121. package/dist/cjs/tests/index.test.d.ts +1 -0
  122. package/dist/cjs/tests/index.test.js +57 -0
  123. package/dist/cjs/tests/index.test.js.map +1 -0
  124. package/dist/cjs/tests/responses.test.d.ts +1 -0
  125. package/dist/cjs/tests/responses.test.js +60 -0
  126. package/dist/cjs/tests/responses.test.js.map +1 -0
  127. package/index.ts +175 -0
  128. package/jest.config.js +8 -0
  129. package/package.json +47 -0
  130. package/pagination.ts +36 -0
  131. package/resource.ts +22 -0
  132. package/resources/counterparties.ts +666 -0
  133. package/resources/documents.ts +97 -0
  134. package/resources/events.ts +86 -0
  135. package/resources/expected-payments.ts +1016 -0
  136. package/resources/external-accounts.ts +762 -0
  137. package/resources/incoming-payment-details.ts +592 -0
  138. package/resources/index.ts +16 -0
  139. package/resources/internal-accounts.ts +774 -0
  140. package/resources/line-items.ts +138 -0
  141. package/resources/paper-items.ts +317 -0
  142. package/resources/payment-orders/index.ts +3 -0
  143. package/resources/payment-orders/payment-orders.ts +2486 -0
  144. package/resources/payment-orders/reversals.ts +72 -0
  145. package/resources/returns.ts +545 -0
  146. package/resources/top-level.ts +5 -0
  147. package/resources/transactions.ts +441 -0
  148. package/resources/validations.ts +115 -0
  149. package/resources/webhooks.ts +48 -0
  150. package/tests/api-resources/counterparties.test.ts +237 -0
  151. package/tests/api-resources/documents.test.ts +40 -0
  152. package/tests/api-resources/events.test.ts +62 -0
  153. package/tests/api-resources/expected-payments.test.ts +138 -0
  154. package/tests/api-resources/external-accounts.test.ts +210 -0
  155. package/tests/api-resources/incoming-payment-details.test.ts +92 -0
  156. package/tests/api-resources/internal-accounts.test.ts +103 -0
  157. package/tests/api-resources/line-items.test.ts +85 -0
  158. package/tests/api-resources/paper-items.test.ts +58 -0
  159. package/tests/api-resources/payment-orders/payment-orders.test.ts +39 -0
  160. package/tests/api-resources/returns.test.ts +78 -0
  161. package/tests/api-resources/top-level.test.ts +21 -0
  162. package/tests/api-resources/transactions.test.ts +96 -0
  163. package/tests/api-resources/validations.test.ts +24 -0
  164. package/tests/api-resources/webhooks.test.ts +102 -0
  165. package/tests/form.test.ts +27 -0
  166. package/tests/index.test.ts +62 -0
  167. package/tests/responses.test.ts +25 -0
  168. package/tsconfig.cjs.json +8 -0
  169. package/tsconfig.json +36 -0
@@ -0,0 +1,2180 @@
1
+ import * as Core from '../../core';
2
+ import { APIResource } from '../../resource';
3
+ import { Reversals } from './reversals';
4
+ import { Page, PageParams } from '../../pagination';
5
+ import * as Returns from '../../resources/returns';
6
+ export declare class PaymentOrders extends APIResource {
7
+ reversals: Reversals;
8
+ /**
9
+ * Create a new Payment Order
10
+ */
11
+ create(
12
+ body: PaymentOrderCreateParams,
13
+ options?: Core.RequestOptions,
14
+ ): Promise<Core.APIResponse<PaymentOrder>>;
15
+ /**
16
+ * Get details on a single payment order
17
+ */
18
+ retrieve(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<PaymentOrder>>;
19
+ /**
20
+ * Update a payment order
21
+ */
22
+ update(
23
+ id: string,
24
+ body?: PaymentOrderUpdateParams,
25
+ options?: Core.RequestOptions,
26
+ ): Promise<Core.APIResponse<PaymentOrder>>;
27
+ update(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<PaymentOrder>>;
28
+ /**
29
+ * Get a list of all payment orders
30
+ */
31
+ list(query?: PaymentOrderListParams, options?: Core.RequestOptions): Core.PagePromise<PaymentOrdersPage>;
32
+ list(options?: Core.RequestOptions): Core.PagePromise<PaymentOrdersPage>;
33
+ /**
34
+ * Create a new payment order asynchronously
35
+ */
36
+ createAsync(body: PaymentOrderCreateAsyncParams, options?: Core.RequestOptions): Promise<void>;
37
+ }
38
+ export declare class PaymentOrdersPage extends Page<PaymentOrder> {}
39
+ export interface PaymentOrder {
40
+ /**
41
+ * The ID of one of your accounting categories. Note that these will only be
42
+ * accessible if your accounting system has been connected.
43
+ */
44
+ accounting_category_id?: string | null;
45
+ /**
46
+ * The ID of one of your accounting ledger classes. Note that these will only be
47
+ * accessible if your accounting system has been connected.
48
+ */
49
+ accounting_ledger_class_id?: string | null;
50
+ /**
51
+ * Value in specified currency's smallest unit. e.g. $10 would be represented as
52
+ * 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
53
+ */
54
+ amount?: number;
55
+ /**
56
+ * The party that will pay the fees for the payment order. Only applies to wire
57
+ * payment orders. Can be one of shared, sender, or receiver, which correspond
58
+ * respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
59
+ */
60
+ charge_bearer?: 'shared' | 'sender' | 'receiver' | null;
61
+ /**
62
+ * If the payment order is tied to a specific Counterparty, their id will appear,
63
+ * otherwise `null`.
64
+ */
65
+ counterparty_id?: string | null;
66
+ created_at?: string;
67
+ /**
68
+ * Defaults to the currency of the originating account.
69
+ */
70
+ currency?:
71
+ | 'AED'
72
+ | 'AFN'
73
+ | 'ALL'
74
+ | 'AMD'
75
+ | 'ANG'
76
+ | 'AOA'
77
+ | 'ARS'
78
+ | 'AUD'
79
+ | 'AWG'
80
+ | 'AZN'
81
+ | 'BAM'
82
+ | 'BBD'
83
+ | 'BCH'
84
+ | 'BDT'
85
+ | 'BGN'
86
+ | 'BHD'
87
+ | 'BIF'
88
+ | 'BMD'
89
+ | 'BND'
90
+ | 'BOB'
91
+ | 'BRL'
92
+ | 'BSD'
93
+ | 'BTC'
94
+ | 'BTN'
95
+ | 'BWP'
96
+ | 'BYN'
97
+ | 'BYR'
98
+ | 'BZD'
99
+ | 'CAD'
100
+ | 'CDF'
101
+ | 'CHF'
102
+ | 'CLF'
103
+ | 'CLP'
104
+ | 'CNH'
105
+ | 'CNY'
106
+ | 'COP'
107
+ | 'CRC'
108
+ | 'CUC'
109
+ | 'CUP'
110
+ | 'CVE'
111
+ | 'CZK'
112
+ | 'DJF'
113
+ | 'DKK'
114
+ | 'DOP'
115
+ | 'DZD'
116
+ | 'EEK'
117
+ | 'EGP'
118
+ | 'ERN'
119
+ | 'ETB'
120
+ | 'EUR'
121
+ | 'FJD'
122
+ | 'FKP'
123
+ | 'GBP'
124
+ | 'GBX'
125
+ | 'GEL'
126
+ | 'GGP'
127
+ | 'GHS'
128
+ | 'GIP'
129
+ | 'GMD'
130
+ | 'GNF'
131
+ | 'GTQ'
132
+ | 'GYD'
133
+ | 'HKD'
134
+ | 'HNL'
135
+ | 'HRK'
136
+ | 'HTG'
137
+ | 'HUF'
138
+ | 'IDR'
139
+ | 'ILS'
140
+ | 'IMP'
141
+ | 'INR'
142
+ | 'IQD'
143
+ | 'IRR'
144
+ | 'ISK'
145
+ | 'JEP'
146
+ | 'JMD'
147
+ | 'JOD'
148
+ | 'JPY'
149
+ | 'KES'
150
+ | 'KGS'
151
+ | 'KHR'
152
+ | 'KMF'
153
+ | 'KPW'
154
+ | 'KRW'
155
+ | 'KWD'
156
+ | 'KYD'
157
+ | 'KZT'
158
+ | 'LAK'
159
+ | 'LBP'
160
+ | 'LKR'
161
+ | 'LRD'
162
+ | 'LSL'
163
+ | 'LTL'
164
+ | 'LVL'
165
+ | 'LYD'
166
+ | 'MAD'
167
+ | 'MDL'
168
+ | 'MGA'
169
+ | 'MKD'
170
+ | 'MMK'
171
+ | 'MNT'
172
+ | 'MOP'
173
+ | 'MRO'
174
+ | 'MRU'
175
+ | 'MTL'
176
+ | 'MUR'
177
+ | 'MVR'
178
+ | 'MWK'
179
+ | 'MXN'
180
+ | 'MYR'
181
+ | 'MZN'
182
+ | 'NAD'
183
+ | 'NGN'
184
+ | 'NIO'
185
+ | 'NOK'
186
+ | 'NPR'
187
+ | 'NZD'
188
+ | 'OMR'
189
+ | 'PAB'
190
+ | 'PEN'
191
+ | 'PGK'
192
+ | 'PHP'
193
+ | 'PKR'
194
+ | 'PLN'
195
+ | 'PYG'
196
+ | 'QAR'
197
+ | 'RON'
198
+ | 'RSD'
199
+ | 'RUB'
200
+ | 'RWF'
201
+ | 'SAR'
202
+ | 'SBD'
203
+ | 'SCR'
204
+ | 'SDG'
205
+ | 'SEK'
206
+ | 'SGD'
207
+ | 'SHP'
208
+ | 'SKK'
209
+ | 'SLL'
210
+ | 'SOS'
211
+ | 'SRD'
212
+ | 'SSP'
213
+ | 'STD'
214
+ | 'SVC'
215
+ | 'SYP'
216
+ | 'SZL'
217
+ | 'THB'
218
+ | 'TJS'
219
+ | 'TMM'
220
+ | 'TMT'
221
+ | 'TND'
222
+ | 'TOP'
223
+ | 'TRY'
224
+ | 'TTD'
225
+ | 'TWD'
226
+ | 'TZS'
227
+ | 'UAH'
228
+ | 'UGX'
229
+ | 'USD'
230
+ | 'UYU'
231
+ | 'UZS'
232
+ | 'VEF'
233
+ | 'VES'
234
+ | 'VND'
235
+ | 'VUV'
236
+ | 'WST'
237
+ | 'XAF'
238
+ | 'XAG'
239
+ | 'XAU'
240
+ | 'XBA'
241
+ | 'XBB'
242
+ | 'XBC'
243
+ | 'XBD'
244
+ | 'XCD'
245
+ | 'XDR'
246
+ | 'XFU'
247
+ | 'XOF'
248
+ | 'XPD'
249
+ | 'XPF'
250
+ | 'XPT'
251
+ | 'XTS'
252
+ | 'YER'
253
+ | 'ZAR'
254
+ | 'ZMK'
255
+ | 'ZMW'
256
+ | 'ZWD'
257
+ | 'ZWL'
258
+ | 'ZWN'
259
+ | 'ZWR';
260
+ /**
261
+ * If the payment order's status is `returned`, this will include the return
262
+ * object's data.
263
+ */
264
+ current_return?: Returns.ReturnObject | null;
265
+ /**
266
+ * The ID of the compliance decision for the payment order, if transaction
267
+ * monitoring is enabled.
268
+ */
269
+ decision_id?: string | null;
270
+ /**
271
+ * An optional description for internal use.
272
+ */
273
+ description?: string | null;
274
+ /**
275
+ * One of `credit`, `debit`. Describes the direction money is flowing in the
276
+ * transaction. A `credit` moves money from your account to someone else's. A
277
+ * `debit` pulls money from someone else's account to your own. Note that wire,
278
+ * rtp, and check payments will always be `credit`.
279
+ */
280
+ direction?: 'credit' | 'debit';
281
+ /**
282
+ * Date transactions are to be posted to the participants' account. Defaults to the
283
+ * current business day or the next business day if the current day is a bank
284
+ * holiday or weekend. Format: yyyy-mm-dd.
285
+ */
286
+ effective_date?: string;
287
+ /**
288
+ * If present, indicates a specific foreign exchange contract number that has been
289
+ * generated by your financial institution.
290
+ */
291
+ foreign_exchange_contract?: string | null;
292
+ /**
293
+ * Indicates the type of FX transfer to initiate, can be either
294
+ * `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order
295
+ * currency matches the originating account currency.
296
+ */
297
+ foreign_exchange_indicator?: 'fixed_to_variable' | 'variable_to_fixed' | null;
298
+ id?: string;
299
+ /**
300
+ * The ID of the ledger transaction linked to the payment order.
301
+ */
302
+ ledger_transaction_id?: string | null;
303
+ /**
304
+ * This field will be true if this object exists in the live environment or false
305
+ * if it exists in the test environment.
306
+ */
307
+ live_mode?: boolean;
308
+ /**
309
+ * Additional data represented as key-value pairs. Both the key and value must be
310
+ * strings.
311
+ */
312
+ metadata?: Record<string, string>;
313
+ /**
314
+ * A boolean to determine if NSF Protection is enabled for this payment order. Note
315
+ * that this setting must also be turned on in your organization settings page.
316
+ */
317
+ nsf_protected?: boolean;
318
+ object?: string;
319
+ /**
320
+ * The ID of one of your organization's internal accounts.
321
+ */
322
+ originating_account_id?: string;
323
+ /**
324
+ * If present, this will replace your default company name on receiver's bank
325
+ * statement. This field can only be used for ACH payments currently. For ACH, only
326
+ * the first 16 characters of this string will be used. Any additional characters
327
+ * will be truncated.
328
+ */
329
+ originating_party_name?: string | null;
330
+ /**
331
+ * Either `normal` or `high`. For ACH and EFT payments, `high` represents a
332
+ * same-day ACH or EFT transfer, respectively. For check payments, `high` can mean
333
+ * an overnight check rather than standard mail.
334
+ */
335
+ priority?: 'high' | 'normal';
336
+ /**
337
+ * For `wire`, this is usually the purpose which is transmitted via the
338
+ * "InstrForDbtrAgt" field in the ISO20022 file. If you are using Currencycloud,
339
+ * this is the `payment.purpose_code` field. For `eft`, this field is the 3 digit
340
+ * CPA Code that will be attached to the payment.
341
+ */
342
+ purpose?: string | null;
343
+ /**
344
+ * The receiving account ID. Can be an `external_account` or `internal_account`.
345
+ */
346
+ receiving_account_id?: string;
347
+ receiving_account_type?: 'internal_account' | 'external_account';
348
+ reference_numbers?: Array<PaymentOrder.ReferenceNumbers>;
349
+ /**
350
+ * For `ach`, this field will be passed through on an addenda record. For `wire`
351
+ * payments the field will be passed through as the "Originator to Beneficiary
352
+ * Information", also known as OBI or Fedwire tag 6000.
353
+ */
354
+ remittance_information?: string | null;
355
+ /**
356
+ * Send an email to the counterparty when the payment order is sent to the bank. If
357
+ * `null`, `send_remittance_advice` on the Counterparty is used.
358
+ */
359
+ send_remittance_advice?: boolean | null;
360
+ /**
361
+ * An optional descriptor which will appear in the receiver's statement. For
362
+ * `check` payments this field will be used as the memo line. For `ach` the maximum
363
+ * length is 10 characters. Note that for ACH payments, the name on your bank
364
+ * account will be included automatically by the bank, so you can use the
365
+ * characters for other useful information. For `eft` the maximum length is 15
366
+ * characters.
367
+ */
368
+ statement_descriptor?: string | null;
369
+ /**
370
+ * The current status of the payment order.
371
+ */
372
+ status?:
373
+ | 'approved'
374
+ | 'cancelled'
375
+ | 'completed'
376
+ | 'denied'
377
+ | 'failed'
378
+ | 'needs_approval'
379
+ | 'pending'
380
+ | 'processing'
381
+ | 'returned'
382
+ | 'reversed'
383
+ | 'sent';
384
+ /**
385
+ * An additional layer of classification for the type of payment order you are
386
+ * doing. This field is only used for `ach` payment orders currently. For `ach`
387
+ * payment orders, the `subtype` represents the SEC code. We currently support
388
+ * `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
389
+ */
390
+ subtype?: 'CCD' | 'CIE' | 'CTX' | 'IAT' | 'PPD' | 'TEL' | 'WEB' | null;
391
+ /**
392
+ * The IDs of all the transactions associated to this payment order. Usually, you
393
+ * will only have a single transaction ID. However, if a payment order initially
394
+ * results in a Return, but gets redrafted and is later successfully completed, it
395
+ * can have many transactions.
396
+ */
397
+ transaction_ids?: Array<string>;
398
+ /**
399
+ * A flag that determines whether a payment order should go through transaction
400
+ * monitoring.
401
+ */
402
+ transaction_monitoring_enabled?: boolean;
403
+ /**
404
+ * One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`,
405
+ * `au_becs`, `interac`, `signet`, `provexchange`.
406
+ */
407
+ type?:
408
+ | 'ach'
409
+ | 'au_becs'
410
+ | 'bacs'
411
+ | 'book'
412
+ | 'card'
413
+ | 'check'
414
+ | 'eft'
415
+ | 'interac'
416
+ | 'provxchange'
417
+ | 'rtp'
418
+ | 'sen'
419
+ | 'sepa'
420
+ | 'signet'
421
+ | 'wire';
422
+ /**
423
+ * Identifier of the ultimate originator of the payment order.
424
+ */
425
+ ultimate_originating_party_identifier?: string | null;
426
+ /**
427
+ * Name of the ultimate originator of the payment order.
428
+ */
429
+ ultimate_originating_party_name?: string | null;
430
+ ultimate_receiving_party_identifier?: string | null;
431
+ ultimate_receiving_party_name?: string | null;
432
+ updated_at?: string;
433
+ /**
434
+ * This field will be populated if a vendor (e.g. Currencycloud) failure occurs.
435
+ * Logic shouldn't be built on its value as it is free-form.
436
+ */
437
+ vendor_failure_reason?: string | null;
438
+ }
439
+ export declare namespace PaymentOrder {
440
+ interface ReferenceNumbers {
441
+ created_at?: string;
442
+ id?: string;
443
+ /**
444
+ * This field will be true if this object exists in the live environment or false
445
+ * if it exists in the test environment.
446
+ */
447
+ live_mode?: boolean;
448
+ object?: string;
449
+ /**
450
+ * The vendor reference number.
451
+ */
452
+ reference_number?: string;
453
+ /**
454
+ * The type of the reference number. Referring to the vendor payment id.
455
+ */
456
+ reference_number_type?:
457
+ | 'ach_original_trace_number'
458
+ | 'ach_trace_number'
459
+ | 'bankprov_payment_id'
460
+ | 'bnk_dev_prenotification_id'
461
+ | 'bnk_dev_transfer_id'
462
+ | 'bofa_end_to_end_id'
463
+ | 'bofa_transaction_id'
464
+ | 'check_number'
465
+ | 'cross_river_payment_id'
466
+ | 'cross_river_transaction_id'
467
+ | 'currencycloud_conversion_id'
468
+ | 'currencycloud_payment_id'
469
+ | 'dwolla_transaction_id'
470
+ | 'eft_trace_number'
471
+ | 'fedwire_imad'
472
+ | 'fedwire_omad'
473
+ | 'first_republic_internal_id'
474
+ | 'goldman_sachs_collection_request_id'
475
+ | 'goldman_sachs_end_to_end_id'
476
+ | 'goldman_sachs_payment_request_id'
477
+ | 'goldman_sachs_request_id'
478
+ | 'goldman_sachs_unique_payment_id'
479
+ | 'jpmc_ccn'
480
+ | 'jpmc_end_to_end_id'
481
+ | 'jpmc_firm_root_id'
482
+ | 'jpmc_p3_id'
483
+ | 'jpmc_payment_information_id'
484
+ | 'lob_check_id'
485
+ | 'other'
486
+ | 'partial_swift_mir'
487
+ | 'pnc_clearing_reference'
488
+ | 'pnc_instruction_id'
489
+ | 'pnc_multipayment_id'
490
+ | 'pnc_payment_trace_id'
491
+ | 'rtp_instruction_id'
492
+ | 'signet_api_reference_id'
493
+ | 'signet_confirmation_id'
494
+ | 'signet_request_id'
495
+ | 'silvergate_payment_id'
496
+ | 'swift_mir'
497
+ | 'swift_uetr'
498
+ | 'usbank_transaction_id'
499
+ | 'wells_fargo_payment_id'
500
+ | 'wells_fargo_trace_number';
501
+ updated_at?: string;
502
+ }
503
+ }
504
+ export interface PaymentOrderCreateParams {
505
+ /**
506
+ * Value in specified currency's smallest unit. e.g. $10 would be represented as
507
+ * 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
508
+ */
509
+ amount: number;
510
+ /**
511
+ * One of `credit`, `debit`. Describes the direction money is flowing in the
512
+ * transaction. A `credit` moves money from your account to someone else's. A
513
+ * `debit` pulls money from someone else's account to your own. Note that wire,
514
+ * rtp, and check payments will always be `credit`.
515
+ */
516
+ direction: 'credit' | 'debit';
517
+ /**
518
+ * The ID of one of your organization's internal accounts.
519
+ */
520
+ originating_account_id: string;
521
+ /**
522
+ * One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`,
523
+ * `au_becs`, `interac`, `signet`, `provexchange`.
524
+ */
525
+ type:
526
+ | 'ach'
527
+ | 'au_becs'
528
+ | 'bacs'
529
+ | 'book'
530
+ | 'card'
531
+ | 'check'
532
+ | 'eft'
533
+ | 'interac'
534
+ | 'provxchange'
535
+ | 'rtp'
536
+ | 'sen'
537
+ | 'sepa'
538
+ | 'signet'
539
+ | 'wire';
540
+ /**
541
+ * The ID of one of your accounting categories. Note that these will only be
542
+ * accessible if your accounting system has been connected.
543
+ */
544
+ accounting_category_id?: string | null;
545
+ /**
546
+ * The ID of one of your accounting ledger classes. Note that these will only be
547
+ * accessible if your accounting system has been connected.
548
+ */
549
+ accounting_ledger_class_id?: string | null;
550
+ /**
551
+ * The party that will pay the fees for the payment order. Only applies to wire
552
+ * payment orders. Can be one of shared, sender, or receiver, which correspond
553
+ * respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
554
+ */
555
+ charge_bearer?: 'shared' | 'sender' | 'receiver' | null;
556
+ /**
557
+ * Defaults to the currency of the originating account.
558
+ */
559
+ currency?:
560
+ | 'AED'
561
+ | 'AFN'
562
+ | 'ALL'
563
+ | 'AMD'
564
+ | 'ANG'
565
+ | 'AOA'
566
+ | 'ARS'
567
+ | 'AUD'
568
+ | 'AWG'
569
+ | 'AZN'
570
+ | 'BAM'
571
+ | 'BBD'
572
+ | 'BCH'
573
+ | 'BDT'
574
+ | 'BGN'
575
+ | 'BHD'
576
+ | 'BIF'
577
+ | 'BMD'
578
+ | 'BND'
579
+ | 'BOB'
580
+ | 'BRL'
581
+ | 'BSD'
582
+ | 'BTC'
583
+ | 'BTN'
584
+ | 'BWP'
585
+ | 'BYN'
586
+ | 'BYR'
587
+ | 'BZD'
588
+ | 'CAD'
589
+ | 'CDF'
590
+ | 'CHF'
591
+ | 'CLF'
592
+ | 'CLP'
593
+ | 'CNH'
594
+ | 'CNY'
595
+ | 'COP'
596
+ | 'CRC'
597
+ | 'CUC'
598
+ | 'CUP'
599
+ | 'CVE'
600
+ | 'CZK'
601
+ | 'DJF'
602
+ | 'DKK'
603
+ | 'DOP'
604
+ | 'DZD'
605
+ | 'EEK'
606
+ | 'EGP'
607
+ | 'ERN'
608
+ | 'ETB'
609
+ | 'EUR'
610
+ | 'FJD'
611
+ | 'FKP'
612
+ | 'GBP'
613
+ | 'GBX'
614
+ | 'GEL'
615
+ | 'GGP'
616
+ | 'GHS'
617
+ | 'GIP'
618
+ | 'GMD'
619
+ | 'GNF'
620
+ | 'GTQ'
621
+ | 'GYD'
622
+ | 'HKD'
623
+ | 'HNL'
624
+ | 'HRK'
625
+ | 'HTG'
626
+ | 'HUF'
627
+ | 'IDR'
628
+ | 'ILS'
629
+ | 'IMP'
630
+ | 'INR'
631
+ | 'IQD'
632
+ | 'IRR'
633
+ | 'ISK'
634
+ | 'JEP'
635
+ | 'JMD'
636
+ | 'JOD'
637
+ | 'JPY'
638
+ | 'KES'
639
+ | 'KGS'
640
+ | 'KHR'
641
+ | 'KMF'
642
+ | 'KPW'
643
+ | 'KRW'
644
+ | 'KWD'
645
+ | 'KYD'
646
+ | 'KZT'
647
+ | 'LAK'
648
+ | 'LBP'
649
+ | 'LKR'
650
+ | 'LRD'
651
+ | 'LSL'
652
+ | 'LTL'
653
+ | 'LVL'
654
+ | 'LYD'
655
+ | 'MAD'
656
+ | 'MDL'
657
+ | 'MGA'
658
+ | 'MKD'
659
+ | 'MMK'
660
+ | 'MNT'
661
+ | 'MOP'
662
+ | 'MRO'
663
+ | 'MRU'
664
+ | 'MTL'
665
+ | 'MUR'
666
+ | 'MVR'
667
+ | 'MWK'
668
+ | 'MXN'
669
+ | 'MYR'
670
+ | 'MZN'
671
+ | 'NAD'
672
+ | 'NGN'
673
+ | 'NIO'
674
+ | 'NOK'
675
+ | 'NPR'
676
+ | 'NZD'
677
+ | 'OMR'
678
+ | 'PAB'
679
+ | 'PEN'
680
+ | 'PGK'
681
+ | 'PHP'
682
+ | 'PKR'
683
+ | 'PLN'
684
+ | 'PYG'
685
+ | 'QAR'
686
+ | 'RON'
687
+ | 'RSD'
688
+ | 'RUB'
689
+ | 'RWF'
690
+ | 'SAR'
691
+ | 'SBD'
692
+ | 'SCR'
693
+ | 'SDG'
694
+ | 'SEK'
695
+ | 'SGD'
696
+ | 'SHP'
697
+ | 'SKK'
698
+ | 'SLL'
699
+ | 'SOS'
700
+ | 'SRD'
701
+ | 'SSP'
702
+ | 'STD'
703
+ | 'SVC'
704
+ | 'SYP'
705
+ | 'SZL'
706
+ | 'THB'
707
+ | 'TJS'
708
+ | 'TMM'
709
+ | 'TMT'
710
+ | 'TND'
711
+ | 'TOP'
712
+ | 'TRY'
713
+ | 'TTD'
714
+ | 'TWD'
715
+ | 'TZS'
716
+ | 'UAH'
717
+ | 'UGX'
718
+ | 'USD'
719
+ | 'UYU'
720
+ | 'UZS'
721
+ | 'VEF'
722
+ | 'VES'
723
+ | 'VND'
724
+ | 'VUV'
725
+ | 'WST'
726
+ | 'XAF'
727
+ | 'XAG'
728
+ | 'XAU'
729
+ | 'XBA'
730
+ | 'XBB'
731
+ | 'XBC'
732
+ | 'XBD'
733
+ | 'XCD'
734
+ | 'XDR'
735
+ | 'XFU'
736
+ | 'XOF'
737
+ | 'XPD'
738
+ | 'XPF'
739
+ | 'XPT'
740
+ | 'XTS'
741
+ | 'YER'
742
+ | 'ZAR'
743
+ | 'ZMK'
744
+ | 'ZMW'
745
+ | 'ZWD'
746
+ | 'ZWL'
747
+ | 'ZWN'
748
+ | 'ZWR';
749
+ /**
750
+ * An optional description for internal use.
751
+ */
752
+ description?: string | null;
753
+ /**
754
+ * An array of documents to be attached to the payment order. Note that if you
755
+ * attach documents, the request's content type must be `multipart/form-data`.
756
+ */
757
+ documents?: Array<PaymentOrderCreateParams.Documents>;
758
+ /**
759
+ * Date transactions are to be posted to the participants' account. Defaults to the
760
+ * current business day or the next business day if the current day is a bank
761
+ * holiday or weekend. Format: yyyy-mm-dd.
762
+ */
763
+ effective_date?: string;
764
+ /**
765
+ * A payment type to fallback to if the original type is not valid for the
766
+ * receiving account. Currently, this only supports falling back from RTP to ACH
767
+ * (type=rtp and fallback_type=ach)
768
+ */
769
+ fallback_type?: 'ach';
770
+ /**
771
+ * If present, indicates a specific foreign exchange contract number that has been
772
+ * generated by your financial institution.
773
+ */
774
+ foreign_exchange_contract?: string | null;
775
+ /**
776
+ * Indicates the type of FX transfer to initiate, can be either
777
+ * `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order
778
+ * currency matches the originating account currency.
779
+ */
780
+ foreign_exchange_indicator?: 'fixed_to_variable' | 'variable_to_fixed' | null;
781
+ /**
782
+ * Specifies a ledger transaction object that will be created with the payment
783
+ * order. If the ledger transaction cannot be created, then the payment order
784
+ * creation will fail. The resulting ledger transaction will mirror the status of
785
+ * the payment order.
786
+ */
787
+ ledger_transaction?: PaymentOrderCreateParams.LedgerTransaction;
788
+ /**
789
+ * An array of line items that must sum up to the amount of the payment order.
790
+ */
791
+ line_items?: Array<PaymentOrderCreateParams.LineItems>;
792
+ /**
793
+ * Additional data represented as key-value pairs. Both the key and value must be
794
+ * strings.
795
+ */
796
+ metadata?: Record<string, string>;
797
+ /**
798
+ * A boolean to determine if NSF Protection is enabled for this payment order. Note
799
+ * that this setting must also be turned on in your organization settings page.
800
+ */
801
+ nsf_protected?: boolean;
802
+ /**
803
+ * If present, this will replace your default company name on receiver's bank
804
+ * statement. This field can only be used for ACH payments currently. For ACH, only
805
+ * the first 16 characters of this string will be used. Any additional characters
806
+ * will be truncated.
807
+ */
808
+ originating_party_name?: string | null;
809
+ /**
810
+ * Either `normal` or `high`. For ACH and EFT payments, `high` represents a
811
+ * same-day ACH or EFT transfer, respectively. For check payments, `high` can mean
812
+ * an overnight check rather than standard mail.
813
+ */
814
+ priority?: 'high' | 'normal';
815
+ /**
816
+ * For `wire`, this is usually the purpose which is transmitted via the
817
+ * "InstrForDbtrAgt" field in the ISO20022 file. If you are using Currencycloud,
818
+ * this is the `payment.purpose_code` field. For `eft`, this field is the 3 digit
819
+ * CPA Code that will be attached to the payment.
820
+ */
821
+ purpose?: string | null;
822
+ /**
823
+ * Either `receiving_account` or `receiving_account_id` must be present. When using
824
+ * `receiving_account_id`, you may pass the id of an external account or an
825
+ * internal account.
826
+ */
827
+ receiving_account?: PaymentOrderCreateParams.ReceivingAccount;
828
+ /**
829
+ * Either `receiving_account` or `receiving_account_id` must be present. When using
830
+ * `receiving_account_id`, you may pass the id of an external account or an
831
+ * internal account.
832
+ */
833
+ receiving_account_id?: string;
834
+ /**
835
+ * For `ach`, this field will be passed through on an addenda record. For `wire`
836
+ * payments the field will be passed through as the "Originator to Beneficiary
837
+ * Information", also known as OBI or Fedwire tag 6000.
838
+ */
839
+ remittance_information?: string | null;
840
+ /**
841
+ * Send an email to the counterparty when the payment order is sent to the bank. If
842
+ * `null`, `send_remittance_advice` on the Counterparty is used.
843
+ */
844
+ send_remittance_advice?: boolean | null;
845
+ /**
846
+ * An optional descriptor which will appear in the receiver's statement. For
847
+ * `check` payments this field will be used as the memo line. For `ach` the maximum
848
+ * length is 10 characters. Note that for ACH payments, the name on your bank
849
+ * account will be included automatically by the bank, so you can use the
850
+ * characters for other useful information. For `eft` the maximum length is 15
851
+ * characters.
852
+ */
853
+ statement_descriptor?: string | null;
854
+ /**
855
+ * An additional layer of classification for the type of payment order you are
856
+ * doing. This field is only used for `ach` payment orders currently. For `ach`
857
+ * payment orders, the `subtype` represents the SEC code. We currently support
858
+ * `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
859
+ */
860
+ subtype?: 'CCD' | 'CIE' | 'CTX' | 'IAT' | 'PPD' | 'TEL' | 'WEB' | null;
861
+ /**
862
+ * A flag that determines whether a payment order should go through transaction
863
+ * monitoring.
864
+ */
865
+ transaction_monitoring_enabled?: boolean;
866
+ /**
867
+ * Identifier of the ultimate originator of the payment order.
868
+ */
869
+ ultimate_originating_party_identifier?: string | null;
870
+ /**
871
+ * Name of the ultimate originator of the payment order.
872
+ */
873
+ ultimate_originating_party_name?: string | null;
874
+ /**
875
+ * Identifier of the ultimate funds recipient.
876
+ */
877
+ ultimate_receiving_party_identifier?: string | null;
878
+ /**
879
+ * Name of the ultimate funds recipient.
880
+ */
881
+ ultimate_receiving_party_name?: string | null;
882
+ }
883
+ export declare namespace PaymentOrderCreateParams {
884
+ interface ReceivingAccount {
885
+ account_details?: Array<ReceivingAccount.AccountDetails>;
886
+ /**
887
+ * Can be `checking`, `savings` or `other`.
888
+ */
889
+ account_type?: 'checking' | 'other' | 'savings';
890
+ contact_details?: Array<ReceivingAccount.ContactDetails>;
891
+ /**
892
+ * Additional data represented as key-value pairs. Both the key and value must be
893
+ * strings.
894
+ */
895
+ metadata?: Record<string, string>;
896
+ /**
897
+ * A nickname for the external account. This is only for internal usage and won't
898
+ * affect any payments
899
+ */
900
+ name?: string | null;
901
+ /**
902
+ * Required if receiving wire payments.
903
+ */
904
+ party_address?: ReceivingAccount.PartyAddress;
905
+ party_identifier?: string;
906
+ /**
907
+ * If this value isn't provided, it will be inherited from the counterparty's name.
908
+ */
909
+ party_name?: string;
910
+ /**
911
+ * Either `individual` or `business`.
912
+ */
913
+ party_type?: 'business' | 'individual' | null;
914
+ /**
915
+ * If you've enabled the Modern Treasury + Plaid integration in your Plaid account,
916
+ * you can pass the processor token in this field.
917
+ */
918
+ plaid_processor_token?: string;
919
+ routing_details?: Array<ReceivingAccount.RoutingDetails>;
920
+ }
921
+ namespace ReceivingAccount {
922
+ interface PartyAddress {
923
+ /**
924
+ * Country code conforms to [ISO 3166-1 alpha-2]
925
+ */
926
+ country?: string | null;
927
+ line1?: string | null;
928
+ line2?: string | null;
929
+ /**
930
+ * Locality or City.
931
+ */
932
+ locality?: string | null;
933
+ /**
934
+ * The postal code of the address.
935
+ */
936
+ postal_code?: string | null;
937
+ /**
938
+ * Region or State.
939
+ */
940
+ region?: string | null;
941
+ }
942
+ interface AccountDetails {
943
+ account_number: string;
944
+ account_number_type?: 'iban' | 'clabe' | 'wallet_address' | 'pan' | 'other';
945
+ }
946
+ interface RoutingDetails {
947
+ routing_number: string;
948
+ routing_number_type:
949
+ | 'aba'
950
+ | 'swift'
951
+ | 'au_bsb'
952
+ | 'ca_cpa'
953
+ | 'cnaps'
954
+ | 'gb_sort_code'
955
+ | 'in_ifsc'
956
+ | 'my_branch_code'
957
+ | 'br_codigo';
958
+ payment_type?:
959
+ | 'ach'
960
+ | 'au_becs'
961
+ | 'bacs'
962
+ | 'book'
963
+ | 'card'
964
+ | 'check'
965
+ | 'eft'
966
+ | 'interac'
967
+ | 'provxchange'
968
+ | 'rtp'
969
+ | 'sen'
970
+ | 'sepa'
971
+ | 'signet'
972
+ | 'wire';
973
+ }
974
+ interface ContactDetails {
975
+ contact_identifier?: string;
976
+ contact_identifier_type?: 'email' | 'phone_number';
977
+ }
978
+ }
979
+ interface LedgerTransaction {
980
+ /**
981
+ * Format: yyyy-mm-dd.
982
+ */
983
+ effective_date: string;
984
+ /**
985
+ * Must be unique within the ledger.
986
+ */
987
+ external_id: string;
988
+ ledger_entries: Array<LedgerTransaction.LedgerEntries>;
989
+ description?: string;
990
+ ledgerable_id?: string;
991
+ ledgerable_type?:
992
+ | 'counterparty'
993
+ | 'expected_payment'
994
+ | 'incoming_payment_detail'
995
+ | 'internal_account'
996
+ | 'line_item'
997
+ | 'paper_item'
998
+ | 'payment_order'
999
+ | 'payment_order_attempt'
1000
+ | 'return'
1001
+ | 'reversal';
1002
+ /**
1003
+ * Additional data represented as key-value pairs. Both the key and value must be
1004
+ * strings.
1005
+ */
1006
+ metadata?: Record<string, string>;
1007
+ /**
1008
+ * To post a ledger transaction at creation, use `posted`.
1009
+ */
1010
+ status?: 'archived' | 'pending' | 'posted';
1011
+ }
1012
+ namespace LedgerTransaction {
1013
+ interface LedgerEntries {
1014
+ amount?: number;
1015
+ /**
1016
+ * One of `credit`, `debit`. Describes the direction money is flowing in the
1017
+ * transaction. A `credit` moves money from your account to someone else's. A
1018
+ * `debit` pulls money from someone else's account to your own. Note that wire,
1019
+ * rtp, and check payments will always be `credit`.
1020
+ */
1021
+ direction?: 'credit' | 'debit';
1022
+ ledger_account_id?: string;
1023
+ /**
1024
+ * Lock version of the ledger account. This can be passed when creating a ledger
1025
+ * transaction to only succeed if no ledger transactions have posted since the
1026
+ * given version. See our post about Designing the Ledgers API with Optimistic
1027
+ * Locking for more details.
1028
+ */
1029
+ lock_version?: number;
1030
+ }
1031
+ }
1032
+ interface LineItems {
1033
+ /**
1034
+ * Value in specified currency's smallest unit. e.g. $10 would be represented
1035
+ * as 1000.
1036
+ */
1037
+ amount: number;
1038
+ /**
1039
+ * The ID of one of your accounting categories. Note that these will only be
1040
+ * accessible if your accounting system has been connected.
1041
+ */
1042
+ accounting_category_id?: string | null;
1043
+ /**
1044
+ * A free-form description of the line item.
1045
+ */
1046
+ description?: string | null;
1047
+ /**
1048
+ * Additional data represented as key-value pairs. Both the key and value must be
1049
+ * strings.
1050
+ */
1051
+ metadata?: Record<string, string>;
1052
+ }
1053
+ interface Documents {
1054
+ file: string;
1055
+ /**
1056
+ * A category given to the document, can be `null`.
1057
+ */
1058
+ document_type?: string;
1059
+ }
1060
+ }
1061
+ export interface PaymentOrderUpdateParams {
1062
+ /**
1063
+ * The ID of one of your accounting categories. Note that these will only be
1064
+ * accessible if your accounting system has been connected.
1065
+ */
1066
+ accounting_category_id?: string | null;
1067
+ /**
1068
+ * The ID of one of your accounting ledger classes. Note that these will only be
1069
+ * accessible if your accounting system has been connected.
1070
+ */
1071
+ accounting_ledger_class_id?: string | null;
1072
+ /**
1073
+ * Value in specified currency's smallest unit. e.g. $10 would be represented as
1074
+ * 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
1075
+ */
1076
+ amount?: number;
1077
+ /**
1078
+ * The party that will pay the fees for the payment order. Only applies to wire
1079
+ * payment orders. Can be one of shared, sender, or receiver, which correspond
1080
+ * respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
1081
+ */
1082
+ charge_bearer?: 'shared' | 'sender' | 'receiver' | null;
1083
+ /**
1084
+ * Required when receiving_account_id is passed the ID of an external account.
1085
+ */
1086
+ counterparty_id?: string | null;
1087
+ /**
1088
+ * Defaults to the currency of the originating account.
1089
+ */
1090
+ currency?:
1091
+ | 'AED'
1092
+ | 'AFN'
1093
+ | 'ALL'
1094
+ | 'AMD'
1095
+ | 'ANG'
1096
+ | 'AOA'
1097
+ | 'ARS'
1098
+ | 'AUD'
1099
+ | 'AWG'
1100
+ | 'AZN'
1101
+ | 'BAM'
1102
+ | 'BBD'
1103
+ | 'BCH'
1104
+ | 'BDT'
1105
+ | 'BGN'
1106
+ | 'BHD'
1107
+ | 'BIF'
1108
+ | 'BMD'
1109
+ | 'BND'
1110
+ | 'BOB'
1111
+ | 'BRL'
1112
+ | 'BSD'
1113
+ | 'BTC'
1114
+ | 'BTN'
1115
+ | 'BWP'
1116
+ | 'BYN'
1117
+ | 'BYR'
1118
+ | 'BZD'
1119
+ | 'CAD'
1120
+ | 'CDF'
1121
+ | 'CHF'
1122
+ | 'CLF'
1123
+ | 'CLP'
1124
+ | 'CNH'
1125
+ | 'CNY'
1126
+ | 'COP'
1127
+ | 'CRC'
1128
+ | 'CUC'
1129
+ | 'CUP'
1130
+ | 'CVE'
1131
+ | 'CZK'
1132
+ | 'DJF'
1133
+ | 'DKK'
1134
+ | 'DOP'
1135
+ | 'DZD'
1136
+ | 'EEK'
1137
+ | 'EGP'
1138
+ | 'ERN'
1139
+ | 'ETB'
1140
+ | 'EUR'
1141
+ | 'FJD'
1142
+ | 'FKP'
1143
+ | 'GBP'
1144
+ | 'GBX'
1145
+ | 'GEL'
1146
+ | 'GGP'
1147
+ | 'GHS'
1148
+ | 'GIP'
1149
+ | 'GMD'
1150
+ | 'GNF'
1151
+ | 'GTQ'
1152
+ | 'GYD'
1153
+ | 'HKD'
1154
+ | 'HNL'
1155
+ | 'HRK'
1156
+ | 'HTG'
1157
+ | 'HUF'
1158
+ | 'IDR'
1159
+ | 'ILS'
1160
+ | 'IMP'
1161
+ | 'INR'
1162
+ | 'IQD'
1163
+ | 'IRR'
1164
+ | 'ISK'
1165
+ | 'JEP'
1166
+ | 'JMD'
1167
+ | 'JOD'
1168
+ | 'JPY'
1169
+ | 'KES'
1170
+ | 'KGS'
1171
+ | 'KHR'
1172
+ | 'KMF'
1173
+ | 'KPW'
1174
+ | 'KRW'
1175
+ | 'KWD'
1176
+ | 'KYD'
1177
+ | 'KZT'
1178
+ | 'LAK'
1179
+ | 'LBP'
1180
+ | 'LKR'
1181
+ | 'LRD'
1182
+ | 'LSL'
1183
+ | 'LTL'
1184
+ | 'LVL'
1185
+ | 'LYD'
1186
+ | 'MAD'
1187
+ | 'MDL'
1188
+ | 'MGA'
1189
+ | 'MKD'
1190
+ | 'MMK'
1191
+ | 'MNT'
1192
+ | 'MOP'
1193
+ | 'MRO'
1194
+ | 'MRU'
1195
+ | 'MTL'
1196
+ | 'MUR'
1197
+ | 'MVR'
1198
+ | 'MWK'
1199
+ | 'MXN'
1200
+ | 'MYR'
1201
+ | 'MZN'
1202
+ | 'NAD'
1203
+ | 'NGN'
1204
+ | 'NIO'
1205
+ | 'NOK'
1206
+ | 'NPR'
1207
+ | 'NZD'
1208
+ | 'OMR'
1209
+ | 'PAB'
1210
+ | 'PEN'
1211
+ | 'PGK'
1212
+ | 'PHP'
1213
+ | 'PKR'
1214
+ | 'PLN'
1215
+ | 'PYG'
1216
+ | 'QAR'
1217
+ | 'RON'
1218
+ | 'RSD'
1219
+ | 'RUB'
1220
+ | 'RWF'
1221
+ | 'SAR'
1222
+ | 'SBD'
1223
+ | 'SCR'
1224
+ | 'SDG'
1225
+ | 'SEK'
1226
+ | 'SGD'
1227
+ | 'SHP'
1228
+ | 'SKK'
1229
+ | 'SLL'
1230
+ | 'SOS'
1231
+ | 'SRD'
1232
+ | 'SSP'
1233
+ | 'STD'
1234
+ | 'SVC'
1235
+ | 'SYP'
1236
+ | 'SZL'
1237
+ | 'THB'
1238
+ | 'TJS'
1239
+ | 'TMM'
1240
+ | 'TMT'
1241
+ | 'TND'
1242
+ | 'TOP'
1243
+ | 'TRY'
1244
+ | 'TTD'
1245
+ | 'TWD'
1246
+ | 'TZS'
1247
+ | 'UAH'
1248
+ | 'UGX'
1249
+ | 'USD'
1250
+ | 'UYU'
1251
+ | 'UZS'
1252
+ | 'VEF'
1253
+ | 'VES'
1254
+ | 'VND'
1255
+ | 'VUV'
1256
+ | 'WST'
1257
+ | 'XAF'
1258
+ | 'XAG'
1259
+ | 'XAU'
1260
+ | 'XBA'
1261
+ | 'XBB'
1262
+ | 'XBC'
1263
+ | 'XBD'
1264
+ | 'XCD'
1265
+ | 'XDR'
1266
+ | 'XFU'
1267
+ | 'XOF'
1268
+ | 'XPD'
1269
+ | 'XPF'
1270
+ | 'XPT'
1271
+ | 'XTS'
1272
+ | 'YER'
1273
+ | 'ZAR'
1274
+ | 'ZMK'
1275
+ | 'ZMW'
1276
+ | 'ZWD'
1277
+ | 'ZWL'
1278
+ | 'ZWN'
1279
+ | 'ZWR';
1280
+ /**
1281
+ * An optional description for internal use.
1282
+ */
1283
+ description?: string | null;
1284
+ /**
1285
+ * One of `credit`, `debit`. Describes the direction money is flowing in the
1286
+ * transaction. A `credit` moves money from your account to someone else's. A
1287
+ * `debit` pulls money from someone else's account to your own. Note that wire,
1288
+ * rtp, and check payments will always be `credit`.
1289
+ */
1290
+ direction?: 'credit' | 'debit';
1291
+ /**
1292
+ * Date transactions are to be posted to the participants' account. Defaults to the
1293
+ * current business day or the next business day if the current day is a bank
1294
+ * holiday or weekend. Format: yyyy-mm-dd.
1295
+ */
1296
+ effective_date?: string;
1297
+ /**
1298
+ * A payment type to fallback to if the original type is not valid for the
1299
+ * receiving account. Currently, this only supports falling back from RTP to ACH
1300
+ * (type=rtp and fallback_type=ach)
1301
+ */
1302
+ fallback_type?: 'ach';
1303
+ /**
1304
+ * If present, indicates a specific foreign exchange contract number that has been
1305
+ * generated by your financial institution.
1306
+ */
1307
+ foreign_exchange_contract?: string | null;
1308
+ /**
1309
+ * Indicates the type of FX transfer to initiate, can be either
1310
+ * `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order
1311
+ * currency matches the originating account currency.
1312
+ */
1313
+ foreign_exchange_indicator?: 'fixed_to_variable' | 'variable_to_fixed' | null;
1314
+ /**
1315
+ * An array of line items that must sum up to the amount of the payment order.
1316
+ */
1317
+ line_items?: Array<PaymentOrderUpdateParams.LineItems>;
1318
+ /**
1319
+ * Additional data represented as key-value pairs. Both the key and value must be
1320
+ * strings.
1321
+ */
1322
+ metadata?: Record<string, string>;
1323
+ /**
1324
+ * A boolean to determine if NSF Protection is enabled for this payment order. Note
1325
+ * that this setting must also be turned on in your organization settings page.
1326
+ */
1327
+ nsf_protected?: boolean;
1328
+ /**
1329
+ * The ID of one of your organization's internal accounts.
1330
+ */
1331
+ originating_account_id?: string;
1332
+ /**
1333
+ * If present, this will replace your default company name on receiver's bank
1334
+ * statement. This field can only be used for ACH payments currently. For ACH, only
1335
+ * the first 16 characters of this string will be used. Any additional characters
1336
+ * will be truncated.
1337
+ */
1338
+ originating_party_name?: string | null;
1339
+ /**
1340
+ * Either `normal` or `high`. For ACH and EFT payments, `high` represents a
1341
+ * same-day ACH or EFT transfer, respectively. For check payments, `high` can mean
1342
+ * an overnight check rather than standard mail.
1343
+ */
1344
+ priority?: 'high' | 'normal';
1345
+ /**
1346
+ * For `wire`, this is usually the purpose which is transmitted via the
1347
+ * "InstrForDbtrAgt" field in the ISO20022 file. If you are using Currencycloud,
1348
+ * this is the `payment.purpose_code` field. For `eft`, this field is the 3 digit
1349
+ * CPA Code that will be attached to the payment.
1350
+ */
1351
+ purpose?: string | null;
1352
+ /**
1353
+ * Either `receiving_account` or `receiving_account_id` must be present. When using
1354
+ * `receiving_account_id`, you may pass the id of an external account or an
1355
+ * internal account.
1356
+ */
1357
+ receiving_account?: PaymentOrderUpdateParams.ReceivingAccount;
1358
+ /**
1359
+ * Either `receiving_account` or `receiving_account_id` must be present. When using
1360
+ * `receiving_account_id`, you may pass the id of an external account or an
1361
+ * internal account.
1362
+ */
1363
+ receiving_account_id?: string;
1364
+ /**
1365
+ * For `ach`, this field will be passed through on an addenda record. For `wire`
1366
+ * payments the field will be passed through as the "Originator to Beneficiary
1367
+ * Information", also known as OBI or Fedwire tag 6000.
1368
+ */
1369
+ remittance_information?: string | null;
1370
+ /**
1371
+ * Send an email to the counterparty when the payment order is sent to the bank. If
1372
+ * `null`, `send_remittance_advice` on the Counterparty is used.
1373
+ */
1374
+ send_remittance_advice?: boolean | null;
1375
+ /**
1376
+ * An optional descriptor which will appear in the receiver's statement. For
1377
+ * `check` payments this field will be used as the memo line. For `ach` the maximum
1378
+ * length is 10 characters. Note that for ACH payments, the name on your bank
1379
+ * account will be included automatically by the bank, so you can use the
1380
+ * characters for other useful information. For `eft` the maximum length is 15
1381
+ * characters.
1382
+ */
1383
+ statement_descriptor?: string | null;
1384
+ /**
1385
+ * To cancel a payment order, use `cancelled`. To redraft a returned payment order,
1386
+ * use `approved`. To undo approval on a denied or approved payment order, use
1387
+ * `needs_approval`.
1388
+ */
1389
+ status?:
1390
+ | 'approved'
1391
+ | 'cancelled'
1392
+ | 'completed'
1393
+ | 'denied'
1394
+ | 'failed'
1395
+ | 'needs_approval'
1396
+ | 'pending'
1397
+ | 'processing'
1398
+ | 'returned'
1399
+ | 'reversed'
1400
+ | 'sent';
1401
+ /**
1402
+ * An additional layer of classification for the type of payment order you are
1403
+ * doing. This field is only used for `ach` payment orders currently. For `ach`
1404
+ * payment orders, the `subtype` represents the SEC code. We currently support
1405
+ * `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
1406
+ */
1407
+ subtype?: 'CCD' | 'CIE' | 'CTX' | 'IAT' | 'PPD' | 'TEL' | 'WEB' | null;
1408
+ /**
1409
+ * One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`,
1410
+ * `au_becs`, `interac`, `signet`, `provexchange`.
1411
+ */
1412
+ type?:
1413
+ | 'ach'
1414
+ | 'au_becs'
1415
+ | 'bacs'
1416
+ | 'book'
1417
+ | 'card'
1418
+ | 'check'
1419
+ | 'eft'
1420
+ | 'interac'
1421
+ | 'provxchange'
1422
+ | 'rtp'
1423
+ | 'sen'
1424
+ | 'sepa'
1425
+ | 'signet'
1426
+ | 'wire';
1427
+ /**
1428
+ * This represents the identifier by which the person is known to the receiver when
1429
+ * using the CIE subtype for ACH payments. Only the first 22 characters of this
1430
+ * string will be used. Any additional characters will be truncated.
1431
+ */
1432
+ ultimate_originating_party_identifier?: string | null;
1433
+ /**
1434
+ * This represents the name of the person that the payment is on behalf of when
1435
+ * using the CIE subtype for ACH payments. Only the first 15 characters of this
1436
+ * string will be used. Any additional characters will be truncated.
1437
+ */
1438
+ ultimate_originating_party_name?: string | null;
1439
+ /**
1440
+ * This represents the name of the merchant that the payment is being sent to when
1441
+ * using the CIE subtype for ACH payments. Only the first 22 characters of this
1442
+ * string will be used. Any additional characters will be truncated.
1443
+ */
1444
+ ultimate_receiving_party_identifier?: string | null;
1445
+ /**
1446
+ * This represents the identifier by which the merchant is known to the person
1447
+ * initiating an ACH payment with CIE subtype. Only the first 15 characters of this
1448
+ * string will be used. Any additional characters will be truncated.
1449
+ */
1450
+ ultimate_receiving_party_name?: string | null;
1451
+ }
1452
+ export declare namespace PaymentOrderUpdateParams {
1453
+ interface ReceivingAccount {
1454
+ account_details?: Array<ReceivingAccount.AccountDetails>;
1455
+ /**
1456
+ * Can be `checking`, `savings` or `other`.
1457
+ */
1458
+ account_type?: 'checking' | 'other' | 'savings';
1459
+ contact_details?: Array<ReceivingAccount.ContactDetails>;
1460
+ /**
1461
+ * Additional data represented as key-value pairs. Both the key and value must be
1462
+ * strings.
1463
+ */
1464
+ metadata?: Record<string, string>;
1465
+ /**
1466
+ * A nickname for the external account. This is only for internal usage and won't
1467
+ * affect any payments
1468
+ */
1469
+ name?: string | null;
1470
+ /**
1471
+ * Required if receiving wire payments.
1472
+ */
1473
+ party_address?: ReceivingAccount.PartyAddress;
1474
+ party_identifier?: string;
1475
+ /**
1476
+ * If this value isn't provided, it will be inherited from the counterparty's name.
1477
+ */
1478
+ party_name?: string;
1479
+ /**
1480
+ * Either `individual` or `business`.
1481
+ */
1482
+ party_type?: 'business' | 'individual' | null;
1483
+ /**
1484
+ * If you've enabled the Modern Treasury + Plaid integration in your Plaid account,
1485
+ * you can pass the processor token in this field.
1486
+ */
1487
+ plaid_processor_token?: string;
1488
+ routing_details?: Array<ReceivingAccount.RoutingDetails>;
1489
+ }
1490
+ namespace ReceivingAccount {
1491
+ interface PartyAddress {
1492
+ /**
1493
+ * Country code conforms to [ISO 3166-1 alpha-2]
1494
+ */
1495
+ country?: string | null;
1496
+ line1?: string | null;
1497
+ line2?: string | null;
1498
+ /**
1499
+ * Locality or City.
1500
+ */
1501
+ locality?: string | null;
1502
+ /**
1503
+ * The postal code of the address.
1504
+ */
1505
+ postal_code?: string | null;
1506
+ /**
1507
+ * Region or State.
1508
+ */
1509
+ region?: string | null;
1510
+ }
1511
+ interface AccountDetails {
1512
+ account_number: string;
1513
+ account_number_type?: 'iban' | 'clabe' | 'wallet_address' | 'pan' | 'other';
1514
+ }
1515
+ interface RoutingDetails {
1516
+ routing_number: string;
1517
+ routing_number_type:
1518
+ | 'aba'
1519
+ | 'swift'
1520
+ | 'au_bsb'
1521
+ | 'ca_cpa'
1522
+ | 'cnaps'
1523
+ | 'gb_sort_code'
1524
+ | 'in_ifsc'
1525
+ | 'my_branch_code'
1526
+ | 'br_codigo';
1527
+ payment_type?:
1528
+ | 'ach'
1529
+ | 'au_becs'
1530
+ | 'bacs'
1531
+ | 'book'
1532
+ | 'card'
1533
+ | 'check'
1534
+ | 'eft'
1535
+ | 'interac'
1536
+ | 'provxchange'
1537
+ | 'rtp'
1538
+ | 'sen'
1539
+ | 'sepa'
1540
+ | 'signet'
1541
+ | 'wire';
1542
+ }
1543
+ interface ContactDetails {
1544
+ contact_identifier?: string;
1545
+ contact_identifier_type?: 'email' | 'phone_number';
1546
+ }
1547
+ }
1548
+ interface LineItems {
1549
+ /**
1550
+ * Value in specified currency's smallest unit. e.g. $10 would be represented
1551
+ * as 1000.
1552
+ */
1553
+ amount: number;
1554
+ /**
1555
+ * The ID of one of your accounting categories. Note that these will only be
1556
+ * accessible if your accounting system has been connected.
1557
+ */
1558
+ accounting_category_id?: string | null;
1559
+ /**
1560
+ * A free-form description of the line item.
1561
+ */
1562
+ description?: string | null;
1563
+ /**
1564
+ * Additional data represented as key-value pairs. Both the key and value must be
1565
+ * strings.
1566
+ */
1567
+ metadata?: Record<string, string>;
1568
+ }
1569
+ }
1570
+ export interface PaymentOrderListParams extends PageParams {
1571
+ counterparty_id?: string;
1572
+ direction?: 'credit' | 'debit';
1573
+ /**
1574
+ * An inclusive upper bound for searching effective_date
1575
+ */
1576
+ effective_date_end?: string;
1577
+ /**
1578
+ * An inclusive lower bound for searching effective_date
1579
+ */
1580
+ effective_date_start?: string;
1581
+ /**
1582
+ * For example, if you want to query for records with metadata key `Type` and value
1583
+ * `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
1584
+ * parameters.
1585
+ */
1586
+ metadata?: Record<string, string>;
1587
+ originating_account_id?: string;
1588
+ /**
1589
+ * Query for records with the provided reference number
1590
+ */
1591
+ reference_number?: string;
1592
+ status?:
1593
+ | 'approved'
1594
+ | 'cancelled'
1595
+ | 'completed'
1596
+ | 'denied'
1597
+ | 'failed'
1598
+ | 'needs_approval'
1599
+ | 'pending'
1600
+ | 'processing'
1601
+ | 'returned'
1602
+ | 'reversed'
1603
+ | 'sent';
1604
+ /**
1605
+ * The ID of a transaction that the payment order has been reconciled to.
1606
+ */
1607
+ transaction_id?: string;
1608
+ type?:
1609
+ | 'ach'
1610
+ | 'au_becs'
1611
+ | 'bacs'
1612
+ | 'book'
1613
+ | 'card'
1614
+ | 'check'
1615
+ | 'eft'
1616
+ | 'interac'
1617
+ | 'provxchange'
1618
+ | 'rtp'
1619
+ | 'sen'
1620
+ | 'sepa'
1621
+ | 'signet'
1622
+ | 'wire';
1623
+ }
1624
+ export interface PaymentOrderCreateAsyncParams {
1625
+ /**
1626
+ * Value in specified currency's smallest unit. e.g. $10 would be represented as
1627
+ * 1000 (cents). For RTP, the maximum amount allowed by the network is $100,000.
1628
+ */
1629
+ amount: number;
1630
+ /**
1631
+ * One of `credit`, `debit`. Describes the direction money is flowing in the
1632
+ * transaction. A `credit` moves money from your account to someone else's. A
1633
+ * `debit` pulls money from someone else's account to your own. Note that wire,
1634
+ * rtp, and check payments will always be `credit`.
1635
+ */
1636
+ direction: 'credit' | 'debit';
1637
+ /**
1638
+ * The ID of one of your organization's internal accounts.
1639
+ */
1640
+ originating_account_id: string;
1641
+ /**
1642
+ * One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`,
1643
+ * `au_becs`, `interac`, `signet`, `provexchange`.
1644
+ */
1645
+ type:
1646
+ | 'ach'
1647
+ | 'au_becs'
1648
+ | 'bacs'
1649
+ | 'book'
1650
+ | 'card'
1651
+ | 'check'
1652
+ | 'eft'
1653
+ | 'interac'
1654
+ | 'provxchange'
1655
+ | 'rtp'
1656
+ | 'sen'
1657
+ | 'sepa'
1658
+ | 'signet'
1659
+ | 'wire';
1660
+ /**
1661
+ * The ID of one of your accounting categories. Note that these will only be
1662
+ * accessible if your accounting system has been connected.
1663
+ */
1664
+ accounting_category_id?: string | null;
1665
+ /**
1666
+ * The ID of one of your accounting ledger classes. Note that these will only be
1667
+ * accessible if your accounting system has been connected.
1668
+ */
1669
+ accounting_ledger_class_id?: string | null;
1670
+ /**
1671
+ * The party that will pay the fees for the payment order. Only applies to wire
1672
+ * payment orders. Can be one of shared, sender, or receiver, which correspond
1673
+ * respectively with the SWIFT 71A values `SHA`, `OUR`, `BEN`.
1674
+ */
1675
+ charge_bearer?: 'shared' | 'sender' | 'receiver' | null;
1676
+ /**
1677
+ * Defaults to the currency of the originating account.
1678
+ */
1679
+ currency?:
1680
+ | 'AED'
1681
+ | 'AFN'
1682
+ | 'ALL'
1683
+ | 'AMD'
1684
+ | 'ANG'
1685
+ | 'AOA'
1686
+ | 'ARS'
1687
+ | 'AUD'
1688
+ | 'AWG'
1689
+ | 'AZN'
1690
+ | 'BAM'
1691
+ | 'BBD'
1692
+ | 'BCH'
1693
+ | 'BDT'
1694
+ | 'BGN'
1695
+ | 'BHD'
1696
+ | 'BIF'
1697
+ | 'BMD'
1698
+ | 'BND'
1699
+ | 'BOB'
1700
+ | 'BRL'
1701
+ | 'BSD'
1702
+ | 'BTC'
1703
+ | 'BTN'
1704
+ | 'BWP'
1705
+ | 'BYN'
1706
+ | 'BYR'
1707
+ | 'BZD'
1708
+ | 'CAD'
1709
+ | 'CDF'
1710
+ | 'CHF'
1711
+ | 'CLF'
1712
+ | 'CLP'
1713
+ | 'CNH'
1714
+ | 'CNY'
1715
+ | 'COP'
1716
+ | 'CRC'
1717
+ | 'CUC'
1718
+ | 'CUP'
1719
+ | 'CVE'
1720
+ | 'CZK'
1721
+ | 'DJF'
1722
+ | 'DKK'
1723
+ | 'DOP'
1724
+ | 'DZD'
1725
+ | 'EEK'
1726
+ | 'EGP'
1727
+ | 'ERN'
1728
+ | 'ETB'
1729
+ | 'EUR'
1730
+ | 'FJD'
1731
+ | 'FKP'
1732
+ | 'GBP'
1733
+ | 'GBX'
1734
+ | 'GEL'
1735
+ | 'GGP'
1736
+ | 'GHS'
1737
+ | 'GIP'
1738
+ | 'GMD'
1739
+ | 'GNF'
1740
+ | 'GTQ'
1741
+ | 'GYD'
1742
+ | 'HKD'
1743
+ | 'HNL'
1744
+ | 'HRK'
1745
+ | 'HTG'
1746
+ | 'HUF'
1747
+ | 'IDR'
1748
+ | 'ILS'
1749
+ | 'IMP'
1750
+ | 'INR'
1751
+ | 'IQD'
1752
+ | 'IRR'
1753
+ | 'ISK'
1754
+ | 'JEP'
1755
+ | 'JMD'
1756
+ | 'JOD'
1757
+ | 'JPY'
1758
+ | 'KES'
1759
+ | 'KGS'
1760
+ | 'KHR'
1761
+ | 'KMF'
1762
+ | 'KPW'
1763
+ | 'KRW'
1764
+ | 'KWD'
1765
+ | 'KYD'
1766
+ | 'KZT'
1767
+ | 'LAK'
1768
+ | 'LBP'
1769
+ | 'LKR'
1770
+ | 'LRD'
1771
+ | 'LSL'
1772
+ | 'LTL'
1773
+ | 'LVL'
1774
+ | 'LYD'
1775
+ | 'MAD'
1776
+ | 'MDL'
1777
+ | 'MGA'
1778
+ | 'MKD'
1779
+ | 'MMK'
1780
+ | 'MNT'
1781
+ | 'MOP'
1782
+ | 'MRO'
1783
+ | 'MRU'
1784
+ | 'MTL'
1785
+ | 'MUR'
1786
+ | 'MVR'
1787
+ | 'MWK'
1788
+ | 'MXN'
1789
+ | 'MYR'
1790
+ | 'MZN'
1791
+ | 'NAD'
1792
+ | 'NGN'
1793
+ | 'NIO'
1794
+ | 'NOK'
1795
+ | 'NPR'
1796
+ | 'NZD'
1797
+ | 'OMR'
1798
+ | 'PAB'
1799
+ | 'PEN'
1800
+ | 'PGK'
1801
+ | 'PHP'
1802
+ | 'PKR'
1803
+ | 'PLN'
1804
+ | 'PYG'
1805
+ | 'QAR'
1806
+ | 'RON'
1807
+ | 'RSD'
1808
+ | 'RUB'
1809
+ | 'RWF'
1810
+ | 'SAR'
1811
+ | 'SBD'
1812
+ | 'SCR'
1813
+ | 'SDG'
1814
+ | 'SEK'
1815
+ | 'SGD'
1816
+ | 'SHP'
1817
+ | 'SKK'
1818
+ | 'SLL'
1819
+ | 'SOS'
1820
+ | 'SRD'
1821
+ | 'SSP'
1822
+ | 'STD'
1823
+ | 'SVC'
1824
+ | 'SYP'
1825
+ | 'SZL'
1826
+ | 'THB'
1827
+ | 'TJS'
1828
+ | 'TMM'
1829
+ | 'TMT'
1830
+ | 'TND'
1831
+ | 'TOP'
1832
+ | 'TRY'
1833
+ | 'TTD'
1834
+ | 'TWD'
1835
+ | 'TZS'
1836
+ | 'UAH'
1837
+ | 'UGX'
1838
+ | 'USD'
1839
+ | 'UYU'
1840
+ | 'UZS'
1841
+ | 'VEF'
1842
+ | 'VES'
1843
+ | 'VND'
1844
+ | 'VUV'
1845
+ | 'WST'
1846
+ | 'XAF'
1847
+ | 'XAG'
1848
+ | 'XAU'
1849
+ | 'XBA'
1850
+ | 'XBB'
1851
+ | 'XBC'
1852
+ | 'XBD'
1853
+ | 'XCD'
1854
+ | 'XDR'
1855
+ | 'XFU'
1856
+ | 'XOF'
1857
+ | 'XPD'
1858
+ | 'XPF'
1859
+ | 'XPT'
1860
+ | 'XTS'
1861
+ | 'YER'
1862
+ | 'ZAR'
1863
+ | 'ZMK'
1864
+ | 'ZMW'
1865
+ | 'ZWD'
1866
+ | 'ZWL'
1867
+ | 'ZWN'
1868
+ | 'ZWR';
1869
+ /**
1870
+ * An optional description for internal use.
1871
+ */
1872
+ description?: string | null;
1873
+ /**
1874
+ * An array of documents to be attached to the payment order. Note that if you
1875
+ * attach documents, the request's content type must be `multipart/form-data`.
1876
+ */
1877
+ documents?: Array<PaymentOrderCreateAsyncParams.Documents>;
1878
+ /**
1879
+ * Date transactions are to be posted to the participants' account. Defaults to the
1880
+ * current business day or the next business day if the current day is a bank
1881
+ * holiday or weekend. Format: yyyy-mm-dd.
1882
+ */
1883
+ effective_date?: string;
1884
+ /**
1885
+ * A payment type to fallback to if the original type is not valid for the
1886
+ * receiving account. Currently, this only supports falling back from RTP to ACH
1887
+ * (type=rtp and fallback_type=ach)
1888
+ */
1889
+ fallback_type?: 'ach';
1890
+ /**
1891
+ * If present, indicates a specific foreign exchange contract number that has been
1892
+ * generated by your financial institution.
1893
+ */
1894
+ foreign_exchange_contract?: string | null;
1895
+ /**
1896
+ * Indicates the type of FX transfer to initiate, can be either
1897
+ * `variable_to_fixed`, `fixed_to_variable`, or `null` if the payment order
1898
+ * currency matches the originating account currency.
1899
+ */
1900
+ foreign_exchange_indicator?: 'fixed_to_variable' | 'variable_to_fixed' | null;
1901
+ /**
1902
+ * Specifies a ledger transaction object that will be created with the payment
1903
+ * order. If the ledger transaction cannot be created, then the payment order
1904
+ * creation will fail. The resulting ledger transaction will mirror the status of
1905
+ * the payment order.
1906
+ */
1907
+ ledger_transaction?: PaymentOrderCreateAsyncParams.LedgerTransaction;
1908
+ /**
1909
+ * An array of line items that must sum up to the amount of the payment order.
1910
+ */
1911
+ line_items?: Array<PaymentOrderCreateAsyncParams.LineItems>;
1912
+ /**
1913
+ * Additional data represented as key-value pairs. Both the key and value must be
1914
+ * strings.
1915
+ */
1916
+ metadata?: Record<string, string>;
1917
+ /**
1918
+ * A boolean to determine if NSF Protection is enabled for this payment order. Note
1919
+ * that this setting must also be turned on in your organization settings page.
1920
+ */
1921
+ nsf_protected?: boolean;
1922
+ /**
1923
+ * If present, this will replace your default company name on receiver's bank
1924
+ * statement. This field can only be used for ACH payments currently. For ACH, only
1925
+ * the first 16 characters of this string will be used. Any additional characters
1926
+ * will be truncated.
1927
+ */
1928
+ originating_party_name?: string | null;
1929
+ /**
1930
+ * Either `normal` or `high`. For ACH and EFT payments, `high` represents a
1931
+ * same-day ACH or EFT transfer, respectively. For check payments, `high` can mean
1932
+ * an overnight check rather than standard mail.
1933
+ */
1934
+ priority?: 'high' | 'normal';
1935
+ /**
1936
+ * For `wire`, this is usually the purpose which is transmitted via the
1937
+ * "InstrForDbtrAgt" field in the ISO20022 file. If you are using Currencycloud,
1938
+ * this is the `payment.purpose_code` field. For `eft`, this field is the 3 digit
1939
+ * CPA Code that will be attached to the payment.
1940
+ */
1941
+ purpose?: string | null;
1942
+ /**
1943
+ * Either `receiving_account` or `receiving_account_id` must be present. When using
1944
+ * `receiving_account_id`, you may pass the id of an external account or an
1945
+ * internal account.
1946
+ */
1947
+ receiving_account?: PaymentOrderCreateAsyncParams.ReceivingAccount;
1948
+ /**
1949
+ * Either `receiving_account` or `receiving_account_id` must be present. When using
1950
+ * `receiving_account_id`, you may pass the id of an external account or an
1951
+ * internal account.
1952
+ */
1953
+ receiving_account_id?: string;
1954
+ /**
1955
+ * For `ach`, this field will be passed through on an addenda record. For `wire`
1956
+ * payments the field will be passed through as the "Originator to Beneficiary
1957
+ * Information", also known as OBI or Fedwire tag 6000.
1958
+ */
1959
+ remittance_information?: string | null;
1960
+ /**
1961
+ * Send an email to the counterparty when the payment order is sent to the bank. If
1962
+ * `null`, `send_remittance_advice` on the Counterparty is used.
1963
+ */
1964
+ send_remittance_advice?: boolean | null;
1965
+ /**
1966
+ * An optional descriptor which will appear in the receiver's statement. For
1967
+ * `check` payments this field will be used as the memo line. For `ach` the maximum
1968
+ * length is 10 characters. Note that for ACH payments, the name on your bank
1969
+ * account will be included automatically by the bank, so you can use the
1970
+ * characters for other useful information. For `eft` the maximum length is 15
1971
+ * characters.
1972
+ */
1973
+ statement_descriptor?: string | null;
1974
+ /**
1975
+ * An additional layer of classification for the type of payment order you are
1976
+ * doing. This field is only used for `ach` payment orders currently. For `ach`
1977
+ * payment orders, the `subtype` represents the SEC code. We currently support
1978
+ * `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`.
1979
+ */
1980
+ subtype?: 'CCD' | 'CIE' | 'CTX' | 'IAT' | 'PPD' | 'TEL' | 'WEB' | null;
1981
+ /**
1982
+ * A flag that determines whether a payment order should go through transaction
1983
+ * monitoring.
1984
+ */
1985
+ transaction_monitoring_enabled?: boolean;
1986
+ /**
1987
+ * Identifier of the ultimate originator of the payment order.
1988
+ */
1989
+ ultimate_originating_party_identifier?: string | null;
1990
+ /**
1991
+ * Name of the ultimate originator of the payment order.
1992
+ */
1993
+ ultimate_originating_party_name?: string | null;
1994
+ /**
1995
+ * Identifier of the ultimate funds recipient.
1996
+ */
1997
+ ultimate_receiving_party_identifier?: string | null;
1998
+ /**
1999
+ * Name of the ultimate funds recipient.
2000
+ */
2001
+ ultimate_receiving_party_name?: string | null;
2002
+ }
2003
+ export declare namespace PaymentOrderCreateAsyncParams {
2004
+ interface ReceivingAccount {
2005
+ account_details?: Array<ReceivingAccount.AccountDetails>;
2006
+ /**
2007
+ * Can be `checking`, `savings` or `other`.
2008
+ */
2009
+ account_type?: 'checking' | 'other' | 'savings';
2010
+ contact_details?: Array<ReceivingAccount.ContactDetails>;
2011
+ /**
2012
+ * Additional data represented as key-value pairs. Both the key and value must be
2013
+ * strings.
2014
+ */
2015
+ metadata?: Record<string, string>;
2016
+ /**
2017
+ * A nickname for the external account. This is only for internal usage and won't
2018
+ * affect any payments
2019
+ */
2020
+ name?: string | null;
2021
+ /**
2022
+ * Required if receiving wire payments.
2023
+ */
2024
+ party_address?: ReceivingAccount.PartyAddress;
2025
+ party_identifier?: string;
2026
+ /**
2027
+ * If this value isn't provided, it will be inherited from the counterparty's name.
2028
+ */
2029
+ party_name?: string;
2030
+ /**
2031
+ * Either `individual` or `business`.
2032
+ */
2033
+ party_type?: 'business' | 'individual' | null;
2034
+ /**
2035
+ * If you've enabled the Modern Treasury + Plaid integration in your Plaid account,
2036
+ * you can pass the processor token in this field.
2037
+ */
2038
+ plaid_processor_token?: string;
2039
+ routing_details?: Array<ReceivingAccount.RoutingDetails>;
2040
+ }
2041
+ namespace ReceivingAccount {
2042
+ interface PartyAddress {
2043
+ /**
2044
+ * Country code conforms to [ISO 3166-1 alpha-2]
2045
+ */
2046
+ country?: string | null;
2047
+ line1?: string | null;
2048
+ line2?: string | null;
2049
+ /**
2050
+ * Locality or City.
2051
+ */
2052
+ locality?: string | null;
2053
+ /**
2054
+ * The postal code of the address.
2055
+ */
2056
+ postal_code?: string | null;
2057
+ /**
2058
+ * Region or State.
2059
+ */
2060
+ region?: string | null;
2061
+ }
2062
+ interface AccountDetails {
2063
+ account_number: string;
2064
+ account_number_type?: 'iban' | 'clabe' | 'wallet_address' | 'pan' | 'other';
2065
+ }
2066
+ interface RoutingDetails {
2067
+ routing_number: string;
2068
+ routing_number_type:
2069
+ | 'aba'
2070
+ | 'swift'
2071
+ | 'au_bsb'
2072
+ | 'ca_cpa'
2073
+ | 'cnaps'
2074
+ | 'gb_sort_code'
2075
+ | 'in_ifsc'
2076
+ | 'my_branch_code'
2077
+ | 'br_codigo';
2078
+ payment_type?:
2079
+ | 'ach'
2080
+ | 'au_becs'
2081
+ | 'bacs'
2082
+ | 'book'
2083
+ | 'card'
2084
+ | 'check'
2085
+ | 'eft'
2086
+ | 'interac'
2087
+ | 'provxchange'
2088
+ | 'rtp'
2089
+ | 'sen'
2090
+ | 'sepa'
2091
+ | 'signet'
2092
+ | 'wire';
2093
+ }
2094
+ interface ContactDetails {
2095
+ contact_identifier?: string;
2096
+ contact_identifier_type?: 'email' | 'phone_number';
2097
+ }
2098
+ }
2099
+ interface LedgerTransaction {
2100
+ /**
2101
+ * Format: yyyy-mm-dd.
2102
+ */
2103
+ effective_date: string;
2104
+ /**
2105
+ * Must be unique within the ledger.
2106
+ */
2107
+ external_id: string;
2108
+ ledger_entries: Array<LedgerTransaction.LedgerEntries>;
2109
+ description?: string;
2110
+ ledgerable_id?: string;
2111
+ ledgerable_type?:
2112
+ | 'counterparty'
2113
+ | 'expected_payment'
2114
+ | 'incoming_payment_detail'
2115
+ | 'internal_account'
2116
+ | 'line_item'
2117
+ | 'paper_item'
2118
+ | 'payment_order'
2119
+ | 'payment_order_attempt'
2120
+ | 'return'
2121
+ | 'reversal';
2122
+ /**
2123
+ * Additional data represented as key-value pairs. Both the key and value must be
2124
+ * strings.
2125
+ */
2126
+ metadata?: Record<string, string>;
2127
+ /**
2128
+ * To post a ledger transaction at creation, use `posted`.
2129
+ */
2130
+ status?: 'archived' | 'pending' | 'posted';
2131
+ }
2132
+ namespace LedgerTransaction {
2133
+ interface LedgerEntries {
2134
+ amount?: number;
2135
+ /**
2136
+ * One of `credit`, `debit`. Describes the direction money is flowing in the
2137
+ * transaction. A `credit` moves money from your account to someone else's. A
2138
+ * `debit` pulls money from someone else's account to your own. Note that wire,
2139
+ * rtp, and check payments will always be `credit`.
2140
+ */
2141
+ direction?: 'credit' | 'debit';
2142
+ ledger_account_id?: string;
2143
+ /**
2144
+ * Lock version of the ledger account. This can be passed when creating a ledger
2145
+ * transaction to only succeed if no ledger transactions have posted since the
2146
+ * given version. See our post about Designing the Ledgers API with Optimistic
2147
+ * Locking for more details.
2148
+ */
2149
+ lock_version?: number;
2150
+ }
2151
+ }
2152
+ interface LineItems {
2153
+ /**
2154
+ * Value in specified currency's smallest unit. e.g. $10 would be represented
2155
+ * as 1000.
2156
+ */
2157
+ amount: number;
2158
+ /**
2159
+ * The ID of one of your accounting categories. Note that these will only be
2160
+ * accessible if your accounting system has been connected.
2161
+ */
2162
+ accounting_category_id?: string | null;
2163
+ /**
2164
+ * A free-form description of the line item.
2165
+ */
2166
+ description?: string | null;
2167
+ /**
2168
+ * Additional data represented as key-value pairs. Both the key and value must be
2169
+ * strings.
2170
+ */
2171
+ metadata?: Record<string, string>;
2172
+ }
2173
+ interface Documents {
2174
+ file: string;
2175
+ /**
2176
+ * A category given to the document, can be `null`.
2177
+ */
2178
+ document_type?: string;
2179
+ }
2180
+ }