modern-treasury 2.2.0 → 2.3.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 (210) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +41 -15
  3. package/_shims/ReadableStream.d.ts +38 -0
  4. package/_shims/ReadableStream.js +5 -0
  5. package/_shims/ReadableStream.mjs +7 -0
  6. package/_shims/ReadableStream.node.d.ts +6 -0
  7. package/_shims/ReadableStream.node.d.ts.map +1 -0
  8. package/_shims/ReadableStream.node.js +14 -0
  9. package/_shims/ReadableStream.node.js.map +1 -0
  10. package/_shims/ReadableStream.node.mjs +3 -0
  11. package/_shims/ReadableStream.node.mjs.map +1 -0
  12. package/_shims/fetch.d.ts +8 -1
  13. package/_shims/fetch.node.d.ts +11 -1
  14. package/core.d.ts +78 -29
  15. package/core.d.ts.map +1 -1
  16. package/core.js +185 -61
  17. package/core.js.map +1 -1
  18. package/core.mjs +179 -61
  19. package/core.mjs.map +1 -1
  20. package/index.d.mts +1 -2
  21. package/index.d.ts +1 -2
  22. package/index.d.ts.map +1 -1
  23. package/index.js +4 -4
  24. package/index.js.map +1 -1
  25. package/index.mjs +4 -4
  26. package/index.mjs.map +1 -1
  27. package/package.json +1 -1
  28. package/pagination.d.ts +2 -2
  29. package/pagination.d.ts.map +1 -1
  30. package/pagination.js +5 -5
  31. package/pagination.js.map +1 -1
  32. package/pagination.mjs +5 -5
  33. package/pagination.mjs.map +1 -1
  34. package/resources/account-collection-flows.d.ts +6 -6
  35. package/resources/account-collection-flows.d.ts.map +1 -1
  36. package/resources/account-details.d.ts +5 -5
  37. package/resources/account-details.d.ts.map +1 -1
  38. package/resources/connections.d.ts +5 -2
  39. package/resources/connections.d.ts.map +1 -1
  40. package/resources/connections.js.map +1 -1
  41. package/resources/connections.mjs.map +1 -1
  42. package/resources/counterparties.d.ts +11 -11
  43. package/resources/counterparties.d.ts.map +1 -1
  44. package/resources/counterparties.js.map +1 -1
  45. package/resources/counterparties.mjs.map +1 -1
  46. package/resources/documents.d.ts +4 -4
  47. package/resources/documents.d.ts.map +1 -1
  48. package/resources/documents.js +2 -2
  49. package/resources/documents.js.map +1 -1
  50. package/resources/documents.mjs +2 -2
  51. package/resources/documents.mjs.map +1 -1
  52. package/resources/events.d.ts +3 -3
  53. package/resources/events.d.ts.map +1 -1
  54. package/resources/expected-payments.d.ts +7 -7
  55. package/resources/expected-payments.d.ts.map +1 -1
  56. package/resources/external-accounts.d.ts +10 -10
  57. package/resources/external-accounts.d.ts.map +1 -1
  58. package/resources/incoming-payment-details.d.ts +11 -7
  59. package/resources/incoming-payment-details.d.ts.map +1 -1
  60. package/resources/incoming-payment-details.js.map +1 -1
  61. package/resources/incoming-payment-details.mjs.map +1 -1
  62. package/resources/index.d.ts +0 -1
  63. package/resources/index.d.ts.map +1 -1
  64. package/resources/index.js.map +1 -1
  65. package/resources/index.mjs.map +1 -1
  66. package/resources/internal-accounts/balance-reports.d.ts +6 -3
  67. package/resources/internal-accounts/balance-reports.d.ts.map +1 -1
  68. package/resources/internal-accounts/balance-reports.js.map +1 -1
  69. package/resources/internal-accounts/balance-reports.mjs.map +1 -1
  70. package/resources/internal-accounts/internal-accounts.d.ts +6 -6
  71. package/resources/internal-accounts/internal-accounts.d.ts.map +1 -1
  72. package/resources/invoices/invoices.d.ts +46 -13
  73. package/resources/invoices/invoices.d.ts.map +1 -1
  74. package/resources/invoices/invoices.js.map +1 -1
  75. package/resources/invoices/invoices.mjs.map +1 -1
  76. package/resources/invoices/line-items.d.ts +23 -171
  77. package/resources/invoices/line-items.d.ts.map +1 -1
  78. package/resources/invoices/line-items.js.map +1 -1
  79. package/resources/invoices/line-items.mjs.map +1 -1
  80. package/resources/ledger-account-categories.d.ts +39 -74
  81. package/resources/ledger-account-categories.d.ts.map +1 -1
  82. package/resources/ledger-account-categories.js +11 -13
  83. package/resources/ledger-account-categories.js.map +1 -1
  84. package/resources/ledger-account-categories.mjs +11 -13
  85. package/resources/ledger-account-categories.mjs.map +1 -1
  86. package/resources/ledger-account-payouts.d.ts +22 -6
  87. package/resources/ledger-account-payouts.d.ts.map +1 -1
  88. package/resources/ledger-account-payouts.js.map +1 -1
  89. package/resources/ledger-account-payouts.mjs.map +1 -1
  90. package/resources/ledger-account-statements.d.ts +2 -2
  91. package/resources/ledger-account-statements.d.ts.map +1 -1
  92. package/resources/ledger-accounts.d.ts +17 -12
  93. package/resources/ledger-accounts.d.ts.map +1 -1
  94. package/resources/ledger-accounts.js.map +1 -1
  95. package/resources/ledger-accounts.mjs.map +1 -1
  96. package/resources/ledger-entries.d.ts +20 -6
  97. package/resources/ledger-entries.d.ts.map +1 -1
  98. package/resources/ledger-entries.js.map +1 -1
  99. package/resources/ledger-entries.mjs.map +1 -1
  100. package/resources/ledger-event-handlers.d.ts +7 -8
  101. package/resources/ledger-event-handlers.d.ts.map +1 -1
  102. package/resources/ledger-event-handlers.js.map +1 -1
  103. package/resources/ledger-event-handlers.mjs.map +1 -1
  104. package/resources/ledger-transactions/ledger-transactions.d.ts +35 -18
  105. package/resources/ledger-transactions/ledger-transactions.d.ts.map +1 -1
  106. package/resources/ledger-transactions/ledger-transactions.js +3 -3
  107. package/resources/ledger-transactions/ledger-transactions.js.map +1 -1
  108. package/resources/ledger-transactions/ledger-transactions.mjs +3 -3
  109. package/resources/ledger-transactions/ledger-transactions.mjs.map +1 -1
  110. package/resources/ledger-transactions/versions.d.ts +4 -2
  111. package/resources/ledger-transactions/versions.d.ts.map +1 -1
  112. package/resources/ledger-transactions/versions.js.map +1 -1
  113. package/resources/ledger-transactions/versions.mjs.map +1 -1
  114. package/resources/ledgerable-events.d.ts +2 -2
  115. package/resources/ledgerable-events.d.ts.map +1 -1
  116. package/resources/ledgers.d.ts +12 -11
  117. package/resources/ledgers.d.ts.map +1 -1
  118. package/resources/ledgers.js.map +1 -1
  119. package/resources/ledgers.mjs.map +1 -1
  120. package/resources/line-items.d.ts +5 -5
  121. package/resources/line-items.d.ts.map +1 -1
  122. package/resources/paper-items.d.ts +6 -3
  123. package/resources/paper-items.d.ts.map +1 -1
  124. package/resources/paper-items.js.map +1 -1
  125. package/resources/paper-items.mjs.map +1 -1
  126. package/resources/payment-flows.d.ts +9 -9
  127. package/resources/payment-flows.d.ts.map +1 -1
  128. package/resources/payment-flows.js.map +1 -1
  129. package/resources/payment-flows.mjs.map +1 -1
  130. package/resources/payment-orders/payment-orders.d.ts +30 -24
  131. package/resources/payment-orders/payment-orders.d.ts.map +1 -1
  132. package/resources/payment-orders/payment-orders.js +3 -5
  133. package/resources/payment-orders/payment-orders.js.map +1 -1
  134. package/resources/payment-orders/payment-orders.mjs +3 -5
  135. package/resources/payment-orders/payment-orders.mjs.map +1 -1
  136. package/resources/payment-orders/reversals.d.ts +14 -9
  137. package/resources/payment-orders/reversals.d.ts.map +1 -1
  138. package/resources/payment-orders/reversals.js.map +1 -1
  139. package/resources/payment-orders/reversals.mjs.map +1 -1
  140. package/resources/payment-references.d.ts +3 -3
  141. package/resources/payment-references.d.ts.map +1 -1
  142. package/resources/returns.d.ts +7 -4
  143. package/resources/returns.d.ts.map +1 -1
  144. package/resources/returns.js.map +1 -1
  145. package/resources/returns.mjs.map +1 -1
  146. package/resources/routing-details.d.ts +5 -5
  147. package/resources/routing-details.d.ts.map +1 -1
  148. package/resources/transactions/line-items.d.ts +5 -2
  149. package/resources/transactions/line-items.d.ts.map +1 -1
  150. package/resources/transactions/line-items.js.map +1 -1
  151. package/resources/transactions/line-items.mjs.map +1 -1
  152. package/resources/transactions/transactions.d.ts +8 -5
  153. package/resources/transactions/transactions.d.ts.map +1 -1
  154. package/resources/transactions/transactions.js.map +1 -1
  155. package/resources/transactions/transactions.mjs.map +1 -1
  156. package/resources/validations.d.ts +1 -1
  157. package/resources/validations.d.ts.map +1 -1
  158. package/resources/virtual-accounts.d.ts +7 -10
  159. package/resources/virtual-accounts.d.ts.map +1 -1
  160. package/resources/virtual-accounts.js.map +1 -1
  161. package/resources/virtual-accounts.mjs.map +1 -1
  162. package/src/_shims/ReadableStream.d.ts +38 -0
  163. package/src/_shims/ReadableStream.js +5 -0
  164. package/src/_shims/ReadableStream.mjs +7 -0
  165. package/src/_shims/ReadableStream.node.ts +6 -0
  166. package/src/_shims/fetch.d.ts +8 -1
  167. package/src/_shims/fetch.node.d.ts +11 -1
  168. package/src/core.ts +244 -79
  169. package/src/index.ts +4 -5
  170. package/src/pagination.ts +6 -6
  171. package/src/resources/account-collection-flows.ts +8 -8
  172. package/src/resources/account-details.ts +6 -6
  173. package/src/resources/connections.ts +6 -3
  174. package/src/resources/counterparties.ts +13 -13
  175. package/src/resources/documents.ts +6 -9
  176. package/src/resources/events.ts +4 -4
  177. package/src/resources/expected-payments.ts +9 -9
  178. package/src/resources/external-accounts.ts +13 -13
  179. package/src/resources/incoming-payment-details.ts +15 -10
  180. package/src/resources/index.ts +0 -1
  181. package/src/resources/internal-accounts/balance-reports.ts +7 -4
  182. package/src/resources/internal-accounts/internal-accounts.ts +8 -8
  183. package/src/resources/invoices/invoices.ts +55 -15
  184. package/src/resources/invoices/line-items.ts +25 -207
  185. package/src/resources/ledger-account-categories.ts +47 -91
  186. package/src/resources/ledger-account-payouts.ts +27 -8
  187. package/src/resources/ledger-account-statements.ts +2 -2
  188. package/src/resources/ledger-accounts.ts +21 -15
  189. package/src/resources/ledger-entries.ts +24 -8
  190. package/src/resources/ledger-event-handlers.ts +8 -12
  191. package/src/resources/ledger-transactions/ledger-transactions.ts +46 -25
  192. package/src/resources/ledger-transactions/versions.ts +5 -3
  193. package/src/resources/ledgerable-events.ts +2 -2
  194. package/src/resources/ledgers.ts +15 -13
  195. package/src/resources/line-items.ts +7 -7
  196. package/src/resources/paper-items.ts +7 -4
  197. package/src/resources/payment-flows.ts +11 -11
  198. package/src/resources/payment-orders/payment-orders.ts +39 -36
  199. package/src/resources/payment-orders/reversals.ts +17 -11
  200. package/src/resources/payment-references.ts +4 -4
  201. package/src/resources/returns.ts +8 -5
  202. package/src/resources/routing-details.ts +6 -6
  203. package/src/resources/transactions/line-items.ts +6 -3
  204. package/src/resources/transactions/transactions.ts +10 -7
  205. package/src/resources/validations.ts +1 -1
  206. package/src/resources/virtual-accounts.ts +9 -12
  207. package/src/version.ts +1 -1
  208. package/version.d.ts +1 -1
  209. package/version.js +1 -1
  210. package/version.mjs +1 -1
@@ -15,7 +15,7 @@ export class Invoices extends APIResource {
15
15
  /**
16
16
  * create invoice
17
17
  */
18
- create(params: InvoiceCreateParams, options?: Core.RequestOptions): Promise<Core.APIResponse<Invoice>> {
18
+ create(params: InvoiceCreateParams, options?: Core.RequestOptions): Core.APIPromise<Invoice> {
19
19
  const { 'Idempotency-Key': idempotencyKey, ...body } = params;
20
20
  return this.post('/api/invoices', {
21
21
  body,
@@ -27,24 +27,20 @@ export class Invoices extends APIResource {
27
27
  /**
28
28
  * get invoice
29
29
  */
30
- retrieve(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<Invoice>> {
30
+ retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Invoice> {
31
31
  return this.get(`/api/invoices/${id}`, options);
32
32
  }
33
33
 
34
34
  /**
35
35
  * update invoice
36
36
  */
37
- update(
38
- id: string,
39
- body?: InvoiceUpdateParams,
40
- options?: Core.RequestOptions,
41
- ): Promise<Core.APIResponse<Invoice>>;
42
- update(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<Invoice>>;
37
+ update(id: string, body?: InvoiceUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Invoice>;
38
+ update(id: string, options?: Core.RequestOptions): Core.APIPromise<Invoice>;
43
39
  update(
44
40
  id: string,
45
41
  body: InvoiceUpdateParams | Core.RequestOptions = {},
46
42
  options?: Core.RequestOptions,
47
- ): Promise<Core.APIResponse<Invoice>> {
43
+ ): Core.APIPromise<Invoice> {
48
44
  if (isRequestOptions(body)) {
49
45
  return this.update(id, {}, body);
50
46
  }
@@ -54,12 +50,12 @@ export class Invoices extends APIResource {
54
50
  /**
55
51
  * list invoices
56
52
  */
57
- list(query?: InvoiceListParams, options?: Core.RequestOptions): Core.PagePromise<InvoicesPage>;
58
- list(options?: Core.RequestOptions): Core.PagePromise<InvoicesPage>;
53
+ list(query?: InvoiceListParams, options?: Core.RequestOptions): Core.PagePromise<InvoicesPage, Invoice>;
54
+ list(options?: Core.RequestOptions): Core.PagePromise<InvoicesPage, Invoice>;
59
55
  list(
60
56
  query: InvoiceListParams | Core.RequestOptions = {},
61
57
  options?: Core.RequestOptions,
62
- ): Core.PagePromise<InvoicesPage> {
58
+ ): Core.PagePromise<InvoicesPage, Invoice> {
63
59
  if (isRequestOptions(query)) {
64
60
  return this.list({}, query);
65
61
  }
@@ -127,6 +123,19 @@ export interface Invoice {
127
123
  */
128
124
  live_mode: boolean;
129
125
 
126
+ /**
127
+ * Emails in addition to the counterparty email to send invoice status
128
+ * notifications to. At least one email is required if notifications are enabled
129
+ * and the counterparty doesn't have an email.
130
+ */
131
+ notification_email_addresses: Array<string> | null;
132
+
133
+ /**
134
+ * If true, the invoice will send email notifications to the invoice recipients
135
+ * about invoice status changes.
136
+ */
137
+ notifications_enabled: boolean;
138
+
130
139
  /**
131
140
  * A unique record number assigned to each invoice that is issued.
132
141
  */
@@ -159,7 +168,7 @@ export interface Invoice {
159
168
  payment_orders: Array<PaymentOrders.PaymentOrder>;
160
169
 
161
170
  /**
162
- * One of `ach` or `eft`
171
+ * One of `ach` or `eft`.
163
172
  */
164
173
  payment_type: 'eft' | 'ach' | null;
165
174
 
@@ -184,6 +193,11 @@ export interface Invoice {
184
193
  */
185
194
  total_amount: number;
186
195
 
196
+ /**
197
+ * IDs of transaction line items associated with an invoice.
198
+ */
199
+ transaction_line_item_ids: Array<string>;
200
+
187
201
  updated_at: string;
188
202
  }
189
203
 
@@ -346,6 +360,19 @@ export interface InvoiceCreateParams {
346
360
  */
347
361
  invoicer_address?: InvoiceCreateParams.InvoicerAddress | null;
348
362
 
363
+ /**
364
+ * Body param: Emails in addition to the counterparty email to send invoice status
365
+ * notifications to. At least one email is required if notifications are enabled
366
+ * and the counterparty doesn't have an email.
367
+ */
368
+ notification_email_addresses?: Array<string> | null;
369
+
370
+ /**
371
+ * Body param: If true, the invoice will send email notifications to the invoice
372
+ * recipients about invoice status changes.
373
+ */
374
+ notifications_enabled?: boolean;
375
+
349
376
  /**
350
377
  * Body param: Date transactions are to be posted to the participants' account.
351
378
  * Defaults to the current business day or the next business day if the current day
@@ -551,6 +578,19 @@ export interface InvoiceUpdateParams {
551
578
  */
552
579
  invoicer_address?: InvoiceUpdateParams.InvoicerAddress | null;
553
580
 
581
+ /**
582
+ * Emails in addition to the counterparty email to send invoice status
583
+ * notifications to. At least one email is required if notifications are enabled
584
+ * and the counterparty doesn't have an email.
585
+ */
586
+ notification_email_addresses?: Array<string> | null;
587
+
588
+ /**
589
+ * If true, the invoice will send email notifications to the invoice recipients
590
+ * about invoice status changes.
591
+ */
592
+ notifications_enabled?: boolean;
593
+
554
594
  /**
555
595
  * The ID of the internal account the invoice should be paid to.
556
596
  */
@@ -603,8 +643,8 @@ export interface InvoiceUpdateParams {
603
643
 
604
644
  /**
605
645
  * Invoice status must be updated in a `PATCH` request that does not modify any
606
- * other invoice attributes. Valid state transitions are `draft` to `unpaid` and
607
- * `draft` or `unpaid` to `voided`.
646
+ * other invoice attributes. Valid state transitions are `draft` to `unpaid`,
647
+ * `draft` or `unpaid` to `voided`, and `draft` or `unpaid` to `paid`.
608
648
  */
609
649
  status?: string;
610
650
  }
@@ -3,7 +3,6 @@
3
3
  import * as Core from '../../core';
4
4
  import { APIResource } from '../../resource';
5
5
  import { isRequestOptions } from '../../core';
6
- import * as Shared from '../shared';
7
6
  import * as API from './index';
8
7
  import { Page, PageParams } from '../../pagination';
9
8
 
@@ -15,7 +14,7 @@ export class LineItems extends APIResource {
15
14
  invoiceId: string,
16
15
  params: LineItemCreateParams,
17
16
  options?: Core.RequestOptions,
18
- ): Promise<Core.APIResponse<InvoiceLineItem>> {
17
+ ): Core.APIPromise<InvoiceLineItem> {
19
18
  const { 'Idempotency-Key': idempotencyKey, ...body } = params;
20
19
  return this.post(`/api/invoices/${invoiceId}/invoice_line_items`, {
21
20
  body,
@@ -27,11 +26,7 @@ export class LineItems extends APIResource {
27
26
  /**
28
27
  * get invoice_line_item
29
28
  */
30
- retrieve(
31
- invoiceId: string,
32
- id: string,
33
- options?: Core.RequestOptions,
34
- ): Promise<Core.APIResponse<InvoiceLineItem>> {
29
+ retrieve(invoiceId: string, id: string, options?: Core.RequestOptions): Core.APIPromise<InvoiceLineItem> {
35
30
  return this.get(`/api/invoices/${invoiceId}/invoice_line_items/${id}`, options);
36
31
  }
37
32
 
@@ -43,18 +38,14 @@ export class LineItems extends APIResource {
43
38
  id: string,
44
39
  body?: LineItemUpdateParams,
45
40
  options?: Core.RequestOptions,
46
- ): Promise<Core.APIResponse<InvoiceLineItem>>;
47
- update(
48
- invoiceId: string,
49
- id: string,
50
- options?: Core.RequestOptions,
51
- ): Promise<Core.APIResponse<InvoiceLineItem>>;
41
+ ): Core.APIPromise<InvoiceLineItem>;
42
+ update(invoiceId: string, id: string, options?: Core.RequestOptions): Core.APIPromise<InvoiceLineItem>;
52
43
  update(
53
44
  invoiceId: string,
54
45
  id: string,
55
46
  body: LineItemUpdateParams | Core.RequestOptions = {},
56
47
  options?: Core.RequestOptions,
57
- ): Promise<Core.APIResponse<InvoiceLineItem>> {
48
+ ): Core.APIPromise<InvoiceLineItem> {
58
49
  if (isRequestOptions(body)) {
59
50
  return this.update(invoiceId, id, {}, body);
60
51
  }
@@ -68,13 +59,16 @@ export class LineItems extends APIResource {
68
59
  invoiceId: string,
69
60
  query?: LineItemListParams,
70
61
  options?: Core.RequestOptions,
71
- ): Core.PagePromise<InvoiceLineItemsPage>;
72
- list(invoiceId: string, options?: Core.RequestOptions): Core.PagePromise<InvoiceLineItemsPage>;
62
+ ): Core.PagePromise<InvoiceLineItemsPage, InvoiceLineItem>;
63
+ list(
64
+ invoiceId: string,
65
+ options?: Core.RequestOptions,
66
+ ): Core.PagePromise<InvoiceLineItemsPage, InvoiceLineItem>;
73
67
  list(
74
68
  invoiceId: string,
75
69
  query: LineItemListParams | Core.RequestOptions = {},
76
70
  options?: Core.RequestOptions,
77
- ): Core.PagePromise<InvoiceLineItemsPage> {
71
+ ): Core.PagePromise<InvoiceLineItemsPage, InvoiceLineItem> {
78
72
  if (isRequestOptions(query)) {
79
73
  return this.list(invoiceId, {}, query);
80
74
  }
@@ -87,11 +81,7 @@ export class LineItems extends APIResource {
87
81
  /**
88
82
  * delete invoice_line_item
89
83
  */
90
- del(
91
- invoiceId: string,
92
- id: string,
93
- options?: Core.RequestOptions,
94
- ): Promise<Core.APIResponse<InvoiceLineItem>> {
84
+ del(invoiceId: string, id: string, options?: Core.RequestOptions): Core.APIPromise<InvoiceLineItem> {
95
85
  return this.delete(`/api/invoices/${invoiceId}/invoice_line_items/${id}`, options);
96
86
  }
97
87
  }
@@ -190,205 +180,33 @@ export interface LineItemCreateParams {
190
180
 
191
181
  export interface LineItemUpdateParams {
192
182
  /**
193
- * The invoicer's contact details displayed at the top of the invoice.
194
- */
195
- contact_details?: Array<LineItemUpdateParams.ContactDetail>;
196
-
197
- /**
198
- * The counterparty's billing address.
199
- */
200
- counterparty_billing_address?: LineItemUpdateParams.CounterpartyBillingAddress | null;
201
-
202
- /**
203
- * The ID of the counterparty receiving the invoice.
204
- */
205
- counterparty_id?: string;
206
-
207
- /**
208
- * The counterparty's shipping address where physical goods should be delivered.
209
- */
210
- counterparty_shipping_address?: LineItemUpdateParams.CounterpartyShippingAddress | null;
211
-
212
- /**
213
- * Currency that the invoice is denominated in. Defaults to `USD` if not provided.
214
- */
215
- currency?: Shared.Currency | null;
216
-
217
- /**
218
- * A free-form description of the invoice.
183
+ * An optional free-form description of the line item.
219
184
  */
220
185
  description?: string;
221
186
 
222
187
  /**
223
- * A future date by when the invoice needs to be paid.
224
- */
225
- due_date?: string;
226
-
227
- /**
228
- * The invoice issuer's business address.
229
- */
230
- invoicer_address?: LineItemUpdateParams.InvoicerAddress | null;
231
-
232
- /**
233
- * The ID of the internal account the invoice should be paid to.
234
- */
235
- originating_account_id?: string;
236
-
237
- /**
238
- * Date transactions are to be posted to the participants' account. Defaults to the
239
- * current business day or the next business day if the current day is a bank
240
- * holiday or weekend. Format: yyyy-mm-dd.
241
- */
242
- payment_effective_date?: string;
243
-
244
- /**
245
- * The method by which the invoice can be paid. `ui` will show the embedded payment
246
- * collection flow. `automatic` will automatically initiate payment based upon the
247
- * account details of the receiving_account id.\nIf the invoice amount is positive,
248
- * the automatically initiated payment order's direction will be debit. If the
249
- * invoice amount is negative, the automatically initiated payment order's
250
- * direction will be credit. One of `manual`, `ui`, or `automatic`.
251
- */
252
- payment_method?: 'ui' | 'manual' | 'automatic';
253
-
254
- /**
255
- * One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`,
256
- * `au_becs`, `interac`, `signet`, `provexchange`.
257
- */
258
- payment_type?:
259
- | 'ach'
260
- | 'au_becs'
261
- | 'bacs'
262
- | 'book'
263
- | 'card'
264
- | 'check'
265
- | 'eft'
266
- | 'cross_border'
267
- | 'interac'
268
- | 'masav'
269
- | 'neft'
270
- | 'provxchange'
271
- | 'rtp'
272
- | 'sen'
273
- | 'sepa'
274
- | 'signet'
275
- | 'wire';
276
-
277
- /**
278
- * The receiving account ID. Can be an `external_account`.
188
+ * Either `debit` or `credit`. `debit` indicates that a client owes the business
189
+ * money and increases the invoice's `total_amount` due. `credit` has the opposite
190
+ * intention and effect.
279
191
  */
280
- receiving_account_id?: string;
281
- }
282
-
283
- export namespace LineItemUpdateParams {
284
- export interface ContactDetail {
285
- id: string;
286
-
287
- contact_identifier: string;
288
-
289
- contact_identifier_type: 'email' | 'phone_number' | 'website';
290
-
291
- created_at: string;
292
-
293
- discarded_at: string | null;
294
-
295
- /**
296
- * This field will be true if this object exists in the live environment or false
297
- * if it exists in the test environment.
298
- */
299
- live_mode: boolean;
300
-
301
- object: string;
302
-
303
- updated_at: string;
304
- }
192
+ direction?: string;
305
193
 
306
194
  /**
307
- * The counterparty's billing address.
195
+ * The name of the line item, typically a product or SKU name.
308
196
  */
309
- export interface CounterpartyBillingAddress {
310
- /**
311
- * Country code conforms to [ISO 3166-1 alpha-2]
312
- */
313
- country: string;
314
-
315
- line1: string;
316
-
317
- /**
318
- * Locality or City.
319
- */
320
- locality: string;
321
-
322
- /**
323
- * The postal code of the address.
324
- */
325
- postal_code: string;
326
-
327
- /**
328
- * Region or State.
329
- */
330
- region: string;
331
-
332
- line2?: string;
333
- }
197
+ name?: string;
334
198
 
335
199
  /**
336
- * The counterparty's shipping address where physical goods should be delivered.
200
+ * The number of units of a product or service that this line item is for. Must be
201
+ * a whole number. Defaults to 1 if not provided.
337
202
  */
338
- export interface CounterpartyShippingAddress {
339
- /**
340
- * Country code conforms to [ISO 3166-1 alpha-2]
341
- */
342
- country: string;
343
-
344
- line1: string;
345
-
346
- /**
347
- * Locality or City.
348
- */
349
- locality: string;
350
-
351
- /**
352
- * The postal code of the address.
353
- */
354
- postal_code: string;
355
-
356
- /**
357
- * Region or State.
358
- */
359
- region: string;
360
-
361
- line2?: string;
362
- }
203
+ quantity?: number;
363
204
 
364
205
  /**
365
- * The invoice issuer's business address.
206
+ * The cost per unit of the product or service that this line item is for,
207
+ * specified in the invoice currency's smallest unit.
366
208
  */
367
- export interface InvoicerAddress {
368
- /**
369
- * Country code conforms to [ISO 3166-1 alpha-2]
370
- */
371
- country: string;
372
-
373
- line1: string;
374
-
375
- /**
376
- * Locality or City.
377
- */
378
- locality: string;
379
-
380
- /**
381
- * The postal code of the address.
382
- */
383
- postal_code: string;
384
-
385
- /**
386
- * Region or State.
387
- */
388
- region: string;
389
-
390
- line2?: string;
391
- }
209
+ unit_amount?: number;
392
210
  }
393
211
 
394
212
  export interface LineItemListParams extends PageParams {}