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.
- package/CHANGELOG.md +44 -0
- package/README.md +41 -15
- package/_shims/ReadableStream.d.ts +38 -0
- package/_shims/ReadableStream.js +5 -0
- package/_shims/ReadableStream.mjs +7 -0
- package/_shims/ReadableStream.node.d.ts +6 -0
- package/_shims/ReadableStream.node.d.ts.map +1 -0
- package/_shims/ReadableStream.node.js +14 -0
- package/_shims/ReadableStream.node.js.map +1 -0
- package/_shims/ReadableStream.node.mjs +3 -0
- package/_shims/ReadableStream.node.mjs.map +1 -0
- package/_shims/fetch.d.ts +8 -1
- package/_shims/fetch.node.d.ts +11 -1
- package/core.d.ts +78 -29
- package/core.d.ts.map +1 -1
- package/core.js +185 -61
- package/core.js.map +1 -1
- package/core.mjs +179 -61
- package/core.mjs.map +1 -1
- package/index.d.mts +1 -2
- package/index.d.ts +1 -2
- package/index.d.ts.map +1 -1
- package/index.js +4 -4
- package/index.js.map +1 -1
- package/index.mjs +4 -4
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/pagination.d.ts +2 -2
- package/pagination.d.ts.map +1 -1
- package/pagination.js +5 -5
- package/pagination.js.map +1 -1
- package/pagination.mjs +5 -5
- package/pagination.mjs.map +1 -1
- package/resources/account-collection-flows.d.ts +6 -6
- package/resources/account-collection-flows.d.ts.map +1 -1
- package/resources/account-details.d.ts +5 -5
- package/resources/account-details.d.ts.map +1 -1
- package/resources/connections.d.ts +5 -2
- package/resources/connections.d.ts.map +1 -1
- package/resources/connections.js.map +1 -1
- package/resources/connections.mjs.map +1 -1
- package/resources/counterparties.d.ts +11 -11
- package/resources/counterparties.d.ts.map +1 -1
- package/resources/counterparties.js.map +1 -1
- package/resources/counterparties.mjs.map +1 -1
- package/resources/documents.d.ts +4 -4
- package/resources/documents.d.ts.map +1 -1
- package/resources/documents.js +2 -2
- package/resources/documents.js.map +1 -1
- package/resources/documents.mjs +2 -2
- package/resources/documents.mjs.map +1 -1
- package/resources/events.d.ts +3 -3
- package/resources/events.d.ts.map +1 -1
- package/resources/expected-payments.d.ts +7 -7
- package/resources/expected-payments.d.ts.map +1 -1
- package/resources/external-accounts.d.ts +10 -10
- package/resources/external-accounts.d.ts.map +1 -1
- package/resources/incoming-payment-details.d.ts +11 -7
- package/resources/incoming-payment-details.d.ts.map +1 -1
- package/resources/incoming-payment-details.js.map +1 -1
- package/resources/incoming-payment-details.mjs.map +1 -1
- package/resources/index.d.ts +0 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/internal-accounts/balance-reports.d.ts +6 -3
- package/resources/internal-accounts/balance-reports.d.ts.map +1 -1
- package/resources/internal-accounts/balance-reports.js.map +1 -1
- package/resources/internal-accounts/balance-reports.mjs.map +1 -1
- package/resources/internal-accounts/internal-accounts.d.ts +6 -6
- package/resources/internal-accounts/internal-accounts.d.ts.map +1 -1
- package/resources/invoices/invoices.d.ts +46 -13
- package/resources/invoices/invoices.d.ts.map +1 -1
- package/resources/invoices/invoices.js.map +1 -1
- package/resources/invoices/invoices.mjs.map +1 -1
- package/resources/invoices/line-items.d.ts +23 -171
- package/resources/invoices/line-items.d.ts.map +1 -1
- package/resources/invoices/line-items.js.map +1 -1
- package/resources/invoices/line-items.mjs.map +1 -1
- package/resources/ledger-account-categories.d.ts +39 -74
- package/resources/ledger-account-categories.d.ts.map +1 -1
- package/resources/ledger-account-categories.js +11 -13
- package/resources/ledger-account-categories.js.map +1 -1
- package/resources/ledger-account-categories.mjs +11 -13
- package/resources/ledger-account-categories.mjs.map +1 -1
- package/resources/ledger-account-payouts.d.ts +22 -6
- package/resources/ledger-account-payouts.d.ts.map +1 -1
- package/resources/ledger-account-payouts.js.map +1 -1
- package/resources/ledger-account-payouts.mjs.map +1 -1
- package/resources/ledger-account-statements.d.ts +2 -2
- package/resources/ledger-account-statements.d.ts.map +1 -1
- package/resources/ledger-accounts.d.ts +17 -12
- package/resources/ledger-accounts.d.ts.map +1 -1
- package/resources/ledger-accounts.js.map +1 -1
- package/resources/ledger-accounts.mjs.map +1 -1
- package/resources/ledger-entries.d.ts +20 -6
- package/resources/ledger-entries.d.ts.map +1 -1
- package/resources/ledger-entries.js.map +1 -1
- package/resources/ledger-entries.mjs.map +1 -1
- package/resources/ledger-event-handlers.d.ts +7 -8
- package/resources/ledger-event-handlers.d.ts.map +1 -1
- package/resources/ledger-event-handlers.js.map +1 -1
- package/resources/ledger-event-handlers.mjs.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.d.ts +35 -18
- package/resources/ledger-transactions/ledger-transactions.d.ts.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.js +3 -3
- package/resources/ledger-transactions/ledger-transactions.js.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.mjs +3 -3
- package/resources/ledger-transactions/ledger-transactions.mjs.map +1 -1
- package/resources/ledger-transactions/versions.d.ts +4 -2
- package/resources/ledger-transactions/versions.d.ts.map +1 -1
- package/resources/ledger-transactions/versions.js.map +1 -1
- package/resources/ledger-transactions/versions.mjs.map +1 -1
- package/resources/ledgerable-events.d.ts +2 -2
- package/resources/ledgerable-events.d.ts.map +1 -1
- package/resources/ledgers.d.ts +12 -11
- package/resources/ledgers.d.ts.map +1 -1
- package/resources/ledgers.js.map +1 -1
- package/resources/ledgers.mjs.map +1 -1
- package/resources/line-items.d.ts +5 -5
- package/resources/line-items.d.ts.map +1 -1
- package/resources/paper-items.d.ts +6 -3
- package/resources/paper-items.d.ts.map +1 -1
- package/resources/paper-items.js.map +1 -1
- package/resources/paper-items.mjs.map +1 -1
- package/resources/payment-flows.d.ts +9 -9
- package/resources/payment-flows.d.ts.map +1 -1
- package/resources/payment-flows.js.map +1 -1
- package/resources/payment-flows.mjs.map +1 -1
- package/resources/payment-orders/payment-orders.d.ts +30 -24
- package/resources/payment-orders/payment-orders.d.ts.map +1 -1
- package/resources/payment-orders/payment-orders.js +3 -5
- package/resources/payment-orders/payment-orders.js.map +1 -1
- package/resources/payment-orders/payment-orders.mjs +3 -5
- package/resources/payment-orders/payment-orders.mjs.map +1 -1
- package/resources/payment-orders/reversals.d.ts +14 -9
- package/resources/payment-orders/reversals.d.ts.map +1 -1
- package/resources/payment-orders/reversals.js.map +1 -1
- package/resources/payment-orders/reversals.mjs.map +1 -1
- package/resources/payment-references.d.ts +3 -3
- package/resources/payment-references.d.ts.map +1 -1
- package/resources/returns.d.ts +7 -4
- package/resources/returns.d.ts.map +1 -1
- package/resources/returns.js.map +1 -1
- package/resources/returns.mjs.map +1 -1
- package/resources/routing-details.d.ts +5 -5
- package/resources/routing-details.d.ts.map +1 -1
- package/resources/transactions/line-items.d.ts +5 -2
- package/resources/transactions/line-items.d.ts.map +1 -1
- package/resources/transactions/line-items.js.map +1 -1
- package/resources/transactions/line-items.mjs.map +1 -1
- package/resources/transactions/transactions.d.ts +8 -5
- package/resources/transactions/transactions.d.ts.map +1 -1
- package/resources/transactions/transactions.js.map +1 -1
- package/resources/transactions/transactions.mjs.map +1 -1
- package/resources/validations.d.ts +1 -1
- package/resources/validations.d.ts.map +1 -1
- package/resources/virtual-accounts.d.ts +7 -10
- package/resources/virtual-accounts.d.ts.map +1 -1
- package/resources/virtual-accounts.js.map +1 -1
- package/resources/virtual-accounts.mjs.map +1 -1
- package/src/_shims/ReadableStream.d.ts +38 -0
- package/src/_shims/ReadableStream.js +5 -0
- package/src/_shims/ReadableStream.mjs +7 -0
- package/src/_shims/ReadableStream.node.ts +6 -0
- package/src/_shims/fetch.d.ts +8 -1
- package/src/_shims/fetch.node.d.ts +11 -1
- package/src/core.ts +244 -79
- package/src/index.ts +4 -5
- package/src/pagination.ts +6 -6
- package/src/resources/account-collection-flows.ts +8 -8
- package/src/resources/account-details.ts +6 -6
- package/src/resources/connections.ts +6 -3
- package/src/resources/counterparties.ts +13 -13
- package/src/resources/documents.ts +6 -9
- package/src/resources/events.ts +4 -4
- package/src/resources/expected-payments.ts +9 -9
- package/src/resources/external-accounts.ts +13 -13
- package/src/resources/incoming-payment-details.ts +15 -10
- package/src/resources/index.ts +0 -1
- package/src/resources/internal-accounts/balance-reports.ts +7 -4
- package/src/resources/internal-accounts/internal-accounts.ts +8 -8
- package/src/resources/invoices/invoices.ts +55 -15
- package/src/resources/invoices/line-items.ts +25 -207
- package/src/resources/ledger-account-categories.ts +47 -91
- package/src/resources/ledger-account-payouts.ts +27 -8
- package/src/resources/ledger-account-statements.ts +2 -2
- package/src/resources/ledger-accounts.ts +21 -15
- package/src/resources/ledger-entries.ts +24 -8
- package/src/resources/ledger-event-handlers.ts +8 -12
- package/src/resources/ledger-transactions/ledger-transactions.ts +46 -25
- package/src/resources/ledger-transactions/versions.ts +5 -3
- package/src/resources/ledgerable-events.ts +2 -2
- package/src/resources/ledgers.ts +15 -13
- package/src/resources/line-items.ts +7 -7
- package/src/resources/paper-items.ts +7 -4
- package/src/resources/payment-flows.ts +11 -11
- package/src/resources/payment-orders/payment-orders.ts +39 -36
- package/src/resources/payment-orders/reversals.ts +17 -11
- package/src/resources/payment-references.ts +4 -4
- package/src/resources/returns.ts +8 -5
- package/src/resources/routing-details.ts +6 -6
- package/src/resources/transactions/line-items.ts +6 -3
- package/src/resources/transactions/transactions.ts +10 -7
- package/src/resources/validations.ts +1 -1
- package/src/resources/virtual-accounts.ts +9 -12
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -13,7 +13,7 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
13
13
|
create(
|
|
14
14
|
params: LedgerAccountCategoryCreateParams,
|
|
15
15
|
options?: Core.RequestOptions,
|
|
16
|
-
):
|
|
16
|
+
): Core.APIPromise<LedgerAccountCategory> {
|
|
17
17
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
18
18
|
return this.post('/api/ledger_account_categories', {
|
|
19
19
|
body,
|
|
@@ -29,13 +29,13 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
29
29
|
id: string,
|
|
30
30
|
query?: LedgerAccountCategoryRetrieveParams,
|
|
31
31
|
options?: Core.RequestOptions,
|
|
32
|
-
):
|
|
33
|
-
retrieve(id: string, options?: Core.RequestOptions):
|
|
32
|
+
): Core.APIPromise<LedgerAccountCategory>;
|
|
33
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerAccountCategory>;
|
|
34
34
|
retrieve(
|
|
35
35
|
id: string,
|
|
36
36
|
query: LedgerAccountCategoryRetrieveParams | Core.RequestOptions = {},
|
|
37
37
|
options?: Core.RequestOptions,
|
|
38
|
-
):
|
|
38
|
+
): Core.APIPromise<LedgerAccountCategory> {
|
|
39
39
|
if (isRequestOptions(query)) {
|
|
40
40
|
return this.retrieve(id, {}, query);
|
|
41
41
|
}
|
|
@@ -47,20 +47,19 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
47
47
|
*/
|
|
48
48
|
update(
|
|
49
49
|
id: string,
|
|
50
|
-
|
|
50
|
+
body?: LedgerAccountCategoryUpdateParams,
|
|
51
51
|
options?: Core.RequestOptions,
|
|
52
|
-
):
|
|
53
|
-
update(id: string, options?: Core.RequestOptions):
|
|
52
|
+
): Core.APIPromise<LedgerAccountCategory>;
|
|
53
|
+
update(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerAccountCategory>;
|
|
54
54
|
update(
|
|
55
55
|
id: string,
|
|
56
|
-
|
|
56
|
+
body: LedgerAccountCategoryUpdateParams | Core.RequestOptions = {},
|
|
57
57
|
options?: Core.RequestOptions,
|
|
58
|
-
):
|
|
59
|
-
if (isRequestOptions(
|
|
60
|
-
return this.update(id, {},
|
|
58
|
+
): Core.APIPromise<LedgerAccountCategory> {
|
|
59
|
+
if (isRequestOptions(body)) {
|
|
60
|
+
return this.update(id, {}, body);
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
return this.patch(`/api/ledger_account_categories/${id}`, { query: { balances }, body, ...options });
|
|
62
|
+
return this.patch(`/api/ledger_account_categories/${id}`, { body, ...options });
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
/**
|
|
@@ -69,12 +68,12 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
69
68
|
list(
|
|
70
69
|
query?: LedgerAccountCategoryListParams,
|
|
71
70
|
options?: Core.RequestOptions,
|
|
72
|
-
): Core.PagePromise<LedgerAccountCategoriesPage>;
|
|
73
|
-
list(options?: Core.RequestOptions): Core.PagePromise<LedgerAccountCategoriesPage>;
|
|
71
|
+
): Core.PagePromise<LedgerAccountCategoriesPage, LedgerAccountCategory>;
|
|
72
|
+
list(options?: Core.RequestOptions): Core.PagePromise<LedgerAccountCategoriesPage, LedgerAccountCategory>;
|
|
74
73
|
list(
|
|
75
74
|
query: LedgerAccountCategoryListParams | Core.RequestOptions = {},
|
|
76
75
|
options?: Core.RequestOptions,
|
|
77
|
-
): Core.PagePromise<LedgerAccountCategoriesPage> {
|
|
76
|
+
): Core.PagePromise<LedgerAccountCategoriesPage, LedgerAccountCategory> {
|
|
78
77
|
if (isRequestOptions(query)) {
|
|
79
78
|
return this.list({}, query);
|
|
80
79
|
}
|
|
@@ -87,32 +86,18 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
87
86
|
/**
|
|
88
87
|
* Delete a ledger account category.
|
|
89
88
|
*/
|
|
90
|
-
del(
|
|
91
|
-
id
|
|
92
|
-
body?: LedgerAccountCategoryDeleteParams,
|
|
93
|
-
options?: Core.RequestOptions,
|
|
94
|
-
): Promise<Core.APIResponse<LedgerAccountCategory>>;
|
|
95
|
-
del(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<LedgerAccountCategory>>;
|
|
96
|
-
del(
|
|
97
|
-
id: string,
|
|
98
|
-
body: LedgerAccountCategoryDeleteParams | Core.RequestOptions = {},
|
|
99
|
-
options?: Core.RequestOptions,
|
|
100
|
-
): Promise<Core.APIResponse<LedgerAccountCategory>> {
|
|
101
|
-
if (isRequestOptions(body)) {
|
|
102
|
-
return this.del(id, {}, body);
|
|
103
|
-
}
|
|
104
|
-
const { balances } = body;
|
|
105
|
-
return this.delete(`/api/ledger_account_categories/${id}`, { query: { balances }, ...options });
|
|
89
|
+
del(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerAccountCategory> {
|
|
90
|
+
return this.delete(`/api/ledger_account_categories/${id}`, options);
|
|
106
91
|
}
|
|
107
92
|
|
|
108
93
|
/**
|
|
109
|
-
* Add a ledger account
|
|
94
|
+
* Add a ledger account to a ledger account category.
|
|
110
95
|
*/
|
|
111
96
|
addLedgerAccount(
|
|
112
97
|
id: string,
|
|
113
98
|
ledgerAccountId: string,
|
|
114
99
|
options?: Core.RequestOptions,
|
|
115
|
-
):
|
|
100
|
+
): Core.APIPromise<void> {
|
|
116
101
|
return this.put(`/api/ledger_account_categories/${id}/ledger_accounts/${ledgerAccountId}`, {
|
|
117
102
|
...options,
|
|
118
103
|
headers: { Accept: '', ...options?.headers },
|
|
@@ -122,11 +107,7 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
122
107
|
/**
|
|
123
108
|
* Add a ledger account category to a ledger account category.
|
|
124
109
|
*/
|
|
125
|
-
addNestedCategory(
|
|
126
|
-
id: string,
|
|
127
|
-
subCategoryId: string,
|
|
128
|
-
options?: Core.RequestOptions,
|
|
129
|
-
): Promise<Core.APIResponse<void>> {
|
|
110
|
+
addNestedCategory(id: string, subCategoryId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
130
111
|
return this.put(`/api/ledger_account_categories/${id}/ledger_account_categories/${subCategoryId}`, {
|
|
131
112
|
...options,
|
|
132
113
|
headers: { Accept: '', ...options?.headers },
|
|
@@ -134,13 +115,13 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
134
115
|
}
|
|
135
116
|
|
|
136
117
|
/**
|
|
137
|
-
*
|
|
118
|
+
* Remove a ledger account from a ledger account category.
|
|
138
119
|
*/
|
|
139
120
|
removeLedgerAccount(
|
|
140
121
|
id: string,
|
|
141
122
|
ledgerAccountId: string,
|
|
142
123
|
options?: Core.RequestOptions,
|
|
143
|
-
):
|
|
124
|
+
): Core.APIPromise<void> {
|
|
144
125
|
return this.delete(`/api/ledger_account_categories/${id}/ledger_accounts/${ledgerAccountId}`, {
|
|
145
126
|
...options,
|
|
146
127
|
headers: { Accept: '', ...options?.headers },
|
|
@@ -154,7 +135,7 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
154
135
|
id: string,
|
|
155
136
|
subCategoryId: string,
|
|
156
137
|
options?: Core.RequestOptions,
|
|
157
|
-
):
|
|
138
|
+
): Core.APIPromise<void> {
|
|
158
139
|
return this.delete(`/api/ledger_account_categories/${id}/ledger_account_categories/${subCategoryId}`, {
|
|
159
140
|
...options,
|
|
160
141
|
headers: { Accept: '', ...options?.headers },
|
|
@@ -362,20 +343,18 @@ export interface LedgerAccountCategoryCreateParams {
|
|
|
362
343
|
|
|
363
344
|
export interface LedgerAccountCategoryRetrieveParams {
|
|
364
345
|
/**
|
|
365
|
-
* For example, if you want the balances as of a particular
|
|
366
|
-
*
|
|
367
|
-
*
|
|
368
|
-
* entries with that exact date.
|
|
346
|
+
* For example, if you want the balances as of a particular time (ISO8601), the
|
|
347
|
+
* encoded query string would be `balances%5Beffective_at%5D=2000-12-31T12:00:00Z`.
|
|
348
|
+
* The balances as of a time are inclusive of entries with that exact time.
|
|
369
349
|
*/
|
|
370
350
|
balances?: LedgerAccountCategoryRetrieveParams.Balances;
|
|
371
351
|
}
|
|
372
352
|
|
|
373
353
|
export namespace LedgerAccountCategoryRetrieveParams {
|
|
374
354
|
/**
|
|
375
|
-
* For example, if you want the balances as of a particular
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
* entries with that exact date.
|
|
355
|
+
* For example, if you want the balances as of a particular time (ISO8601), the
|
|
356
|
+
* encoded query string would be `balances%5Beffective_at%5D=2000-12-31T12:00:00Z`.
|
|
357
|
+
* The balances as of a time are inclusive of entries with that exact time.
|
|
379
358
|
*/
|
|
380
359
|
export interface Balances {
|
|
381
360
|
as_of_date?: string;
|
|
@@ -386,45 +365,36 @@ export namespace LedgerAccountCategoryRetrieveParams {
|
|
|
386
365
|
|
|
387
366
|
export interface LedgerAccountCategoryUpdateParams {
|
|
388
367
|
/**
|
|
389
|
-
*
|
|
390
|
-
* date (YYYY-MM-DD), the encoded query string would be
|
|
391
|
-
* balances%5Bas_of_date%5D=2000-12-31. The balances as of a date are exclusive of
|
|
392
|
-
* entries with that exact date.
|
|
393
|
-
*/
|
|
394
|
-
balances?: LedgerAccountCategoryUpdateParams.Balances;
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* Body param: The description of the ledger account category.
|
|
368
|
+
* The description of the ledger account category.
|
|
398
369
|
*/
|
|
399
370
|
description?: string | null;
|
|
400
371
|
|
|
401
372
|
/**
|
|
402
|
-
*
|
|
403
|
-
*
|
|
373
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
374
|
+
* strings.
|
|
404
375
|
*/
|
|
405
376
|
metadata?: Record<string, string>;
|
|
406
377
|
|
|
407
378
|
/**
|
|
408
|
-
*
|
|
379
|
+
* The name of the ledger account category.
|
|
409
380
|
*/
|
|
410
381
|
name?: string;
|
|
411
382
|
}
|
|
412
383
|
|
|
413
|
-
export
|
|
384
|
+
export interface LedgerAccountCategoryListParams extends PageParams {
|
|
414
385
|
/**
|
|
415
|
-
*
|
|
416
|
-
*
|
|
417
|
-
* balances%5Bas_of_date%5D=2000-12-31. The balances as of a date are exclusive of
|
|
418
|
-
* entries with that exact date.
|
|
386
|
+
* If you have specific IDs to retrieve in bulk, you can pass them as query
|
|
387
|
+
* parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`.
|
|
419
388
|
*/
|
|
420
|
-
|
|
421
|
-
as_of_date?: string;
|
|
389
|
+
id?: Array<string>;
|
|
422
390
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
391
|
+
/**
|
|
392
|
+
* For example, if you want the balances as of a particular time (ISO8601), the
|
|
393
|
+
* encoded query string would be `balances%5Beffective_at%5D=2000-12-31T12:00:00Z`.
|
|
394
|
+
* The balances as of a time are inclusive of entries with that exact time.
|
|
395
|
+
*/
|
|
396
|
+
balances?: LedgerAccountCategoryListParams.Balances;
|
|
426
397
|
|
|
427
|
-
export interface LedgerAccountCategoryListParams extends PageParams {
|
|
428
398
|
/**
|
|
429
399
|
* Query categories which contain a ledger account directly or through child
|
|
430
400
|
* categories.
|
|
@@ -448,26 +418,13 @@ export interface LedgerAccountCategoryListParams extends PageParams {
|
|
|
448
418
|
parent_ledger_account_category_id?: string;
|
|
449
419
|
}
|
|
450
420
|
|
|
451
|
-
export
|
|
421
|
+
export namespace LedgerAccountCategoryListParams {
|
|
452
422
|
/**
|
|
453
|
-
* For example, if you want the balances as of a particular
|
|
454
|
-
*
|
|
455
|
-
*
|
|
456
|
-
* entries with that exact date.
|
|
457
|
-
*/
|
|
458
|
-
balances?: LedgerAccountCategoryDeleteParams.Balances;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
export namespace LedgerAccountCategoryDeleteParams {
|
|
462
|
-
/**
|
|
463
|
-
* For example, if you want the balances as of a particular effective date
|
|
464
|
-
* (YYYY-MM-DD), the encoded query string would be
|
|
465
|
-
* balances%5Bas_of_date%5D=2000-12-31. The balances as of a date are exclusive of
|
|
466
|
-
* entries with that exact date.
|
|
423
|
+
* For example, if you want the balances as of a particular time (ISO8601), the
|
|
424
|
+
* encoded query string would be `balances%5Beffective_at%5D=2000-12-31T12:00:00Z`.
|
|
425
|
+
* The balances as of a time are inclusive of entries with that exact time.
|
|
467
426
|
*/
|
|
468
427
|
export interface Balances {
|
|
469
|
-
as_of_date?: string;
|
|
470
|
-
|
|
471
428
|
effective_at?: string;
|
|
472
429
|
}
|
|
473
430
|
}
|
|
@@ -479,5 +436,4 @@ export namespace LedgerAccountCategories {
|
|
|
479
436
|
export import LedgerAccountCategoryRetrieveParams = API.LedgerAccountCategoryRetrieveParams;
|
|
480
437
|
export import LedgerAccountCategoryUpdateParams = API.LedgerAccountCategoryUpdateParams;
|
|
481
438
|
export import LedgerAccountCategoryListParams = API.LedgerAccountCategoryListParams;
|
|
482
|
-
export import LedgerAccountCategoryDeleteParams = API.LedgerAccountCategoryDeleteParams;
|
|
483
439
|
}
|
|
@@ -13,7 +13,7 @@ export class LedgerAccountPayouts extends APIResource {
|
|
|
13
13
|
create(
|
|
14
14
|
params: LedgerAccountPayoutCreateParams,
|
|
15
15
|
options?: Core.RequestOptions,
|
|
16
|
-
):
|
|
16
|
+
): Core.APIPromise<LedgerAccountPayout> {
|
|
17
17
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
18
18
|
return this.post('/api/ledger_account_payouts', {
|
|
19
19
|
body,
|
|
@@ -29,13 +29,13 @@ export class LedgerAccountPayouts extends APIResource {
|
|
|
29
29
|
id: string,
|
|
30
30
|
body?: LedgerAccountPayoutUpdateParams,
|
|
31
31
|
options?: Core.RequestOptions,
|
|
32
|
-
):
|
|
33
|
-
update(id: string, options?: Core.RequestOptions):
|
|
32
|
+
): Core.APIPromise<LedgerAccountPayout>;
|
|
33
|
+
update(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerAccountPayout>;
|
|
34
34
|
update(
|
|
35
35
|
id: string,
|
|
36
36
|
body: LedgerAccountPayoutUpdateParams | Core.RequestOptions = {},
|
|
37
37
|
options?: Core.RequestOptions,
|
|
38
|
-
):
|
|
38
|
+
): Core.APIPromise<LedgerAccountPayout> {
|
|
39
39
|
if (isRequestOptions(body)) {
|
|
40
40
|
return this.update(id, {}, body);
|
|
41
41
|
}
|
|
@@ -48,12 +48,12 @@ export class LedgerAccountPayouts extends APIResource {
|
|
|
48
48
|
list(
|
|
49
49
|
query?: LedgerAccountPayoutListParams,
|
|
50
50
|
options?: Core.RequestOptions,
|
|
51
|
-
): Core.PagePromise<LedgerAccountPayoutsPage>;
|
|
52
|
-
list(options?: Core.RequestOptions): Core.PagePromise<LedgerAccountPayoutsPage>;
|
|
51
|
+
): Core.PagePromise<LedgerAccountPayoutsPage, LedgerAccountPayout>;
|
|
52
|
+
list(options?: Core.RequestOptions): Core.PagePromise<LedgerAccountPayoutsPage, LedgerAccountPayout>;
|
|
53
53
|
list(
|
|
54
54
|
query: LedgerAccountPayoutListParams | Core.RequestOptions = {},
|
|
55
55
|
options?: Core.RequestOptions,
|
|
56
|
-
): Core.PagePromise<LedgerAccountPayoutsPage> {
|
|
56
|
+
): Core.PagePromise<LedgerAccountPayoutsPage, LedgerAccountPayout> {
|
|
57
57
|
if (isRequestOptions(query)) {
|
|
58
58
|
return this.list({}, query);
|
|
59
59
|
}
|
|
@@ -63,7 +63,7 @@ export class LedgerAccountPayouts extends APIResource {
|
|
|
63
63
|
/**
|
|
64
64
|
* Get details on a single ledger account payout.
|
|
65
65
|
*/
|
|
66
|
-
retireve(id: string, options?: Core.RequestOptions):
|
|
66
|
+
retireve(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerAccountPayout> {
|
|
67
67
|
return this.get(`/api/ledger_account_payouts/${id}`, options);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -180,6 +180,12 @@ export interface LedgerAccountPayoutCreateParams {
|
|
|
180
180
|
*/
|
|
181
181
|
metadata?: Record<string, string>;
|
|
182
182
|
|
|
183
|
+
/**
|
|
184
|
+
* Body param: It is set to `false` by default. It should be set to `true` when
|
|
185
|
+
* migrating existing payouts.
|
|
186
|
+
*/
|
|
187
|
+
skip_payout_ledger_transaction?: boolean | null;
|
|
188
|
+
|
|
183
189
|
/**
|
|
184
190
|
* Body param: The status of the ledger account payout. It is set to `pending` by
|
|
185
191
|
* default. To post a ledger account payout at creation, use `posted`.
|
|
@@ -213,6 +219,19 @@ export interface LedgerAccountPayoutUpdateParams {
|
|
|
213
219
|
}
|
|
214
220
|
|
|
215
221
|
export interface LedgerAccountPayoutListParams extends PageParams {
|
|
222
|
+
/**
|
|
223
|
+
* If you have specific IDs to retrieve in bulk, you can pass them as query
|
|
224
|
+
* parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`.
|
|
225
|
+
*/
|
|
226
|
+
id?: Array<string>;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* For example, if you want to query for records with metadata key `Type` and value
|
|
230
|
+
* `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
|
|
231
|
+
* parameters.
|
|
232
|
+
*/
|
|
233
|
+
metadata?: Record<string, string>;
|
|
234
|
+
|
|
216
235
|
payout_ledger_account_id?: string;
|
|
217
236
|
}
|
|
218
237
|
|
|
@@ -11,7 +11,7 @@ export class LedgerAccountStatements extends APIResource {
|
|
|
11
11
|
create(
|
|
12
12
|
params: LedgerAccountStatementCreateParams,
|
|
13
13
|
options?: Core.RequestOptions,
|
|
14
|
-
):
|
|
14
|
+
): Core.APIPromise<LedgerAccountStatementCreateResponse> {
|
|
15
15
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
16
16
|
return this.post('/api/ledger_account_statements', {
|
|
17
17
|
body,
|
|
@@ -26,7 +26,7 @@ export class LedgerAccountStatements extends APIResource {
|
|
|
26
26
|
retrieve(
|
|
27
27
|
id: string,
|
|
28
28
|
options?: Core.RequestOptions,
|
|
29
|
-
):
|
|
29
|
+
): Core.APIPromise<LedgerAccountStatementRetrieveResponse> {
|
|
30
30
|
return this.get(`/api/ledger_account_statements/${id}`, options);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -10,10 +10,7 @@ export class LedgerAccounts extends APIResource {
|
|
|
10
10
|
/**
|
|
11
11
|
* Create a ledger account.
|
|
12
12
|
*/
|
|
13
|
-
create(
|
|
14
|
-
params: LedgerAccountCreateParams,
|
|
15
|
-
options?: Core.RequestOptions,
|
|
16
|
-
): Promise<Core.APIResponse<LedgerAccount>> {
|
|
13
|
+
create(params: LedgerAccountCreateParams, options?: Core.RequestOptions): Core.APIPromise<LedgerAccount> {
|
|
17
14
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
18
15
|
return this.post('/api/ledger_accounts', {
|
|
19
16
|
body,
|
|
@@ -29,13 +26,13 @@ export class LedgerAccounts extends APIResource {
|
|
|
29
26
|
id: string,
|
|
30
27
|
query?: LedgerAccountRetrieveParams,
|
|
31
28
|
options?: Core.RequestOptions,
|
|
32
|
-
):
|
|
33
|
-
retrieve(id: string, options?: Core.RequestOptions):
|
|
29
|
+
): Core.APIPromise<LedgerAccount>;
|
|
30
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerAccount>;
|
|
34
31
|
retrieve(
|
|
35
32
|
id: string,
|
|
36
33
|
query: LedgerAccountRetrieveParams | Core.RequestOptions = {},
|
|
37
34
|
options?: Core.RequestOptions,
|
|
38
|
-
):
|
|
35
|
+
): Core.APIPromise<LedgerAccount> {
|
|
39
36
|
if (isRequestOptions(query)) {
|
|
40
37
|
return this.retrieve(id, {}, query);
|
|
41
38
|
}
|
|
@@ -49,13 +46,13 @@ export class LedgerAccounts extends APIResource {
|
|
|
49
46
|
id: string,
|
|
50
47
|
body?: LedgerAccountUpdateParams,
|
|
51
48
|
options?: Core.RequestOptions,
|
|
52
|
-
):
|
|
53
|
-
update(id: string, options?: Core.RequestOptions):
|
|
49
|
+
): Core.APIPromise<LedgerAccount>;
|
|
50
|
+
update(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerAccount>;
|
|
54
51
|
update(
|
|
55
52
|
id: string,
|
|
56
53
|
body: LedgerAccountUpdateParams | Core.RequestOptions = {},
|
|
57
54
|
options?: Core.RequestOptions,
|
|
58
|
-
):
|
|
55
|
+
): Core.APIPromise<LedgerAccount> {
|
|
59
56
|
if (isRequestOptions(body)) {
|
|
60
57
|
return this.update(id, {}, body);
|
|
61
58
|
}
|
|
@@ -65,12 +62,15 @@ export class LedgerAccounts extends APIResource {
|
|
|
65
62
|
/**
|
|
66
63
|
* Get a list of ledger accounts.
|
|
67
64
|
*/
|
|
68
|
-
list(
|
|
69
|
-
|
|
65
|
+
list(
|
|
66
|
+
query?: LedgerAccountListParams,
|
|
67
|
+
options?: Core.RequestOptions,
|
|
68
|
+
): Core.PagePromise<LedgerAccountsPage, LedgerAccount>;
|
|
69
|
+
list(options?: Core.RequestOptions): Core.PagePromise<LedgerAccountsPage, LedgerAccount>;
|
|
70
70
|
list(
|
|
71
71
|
query: LedgerAccountListParams | Core.RequestOptions = {},
|
|
72
72
|
options?: Core.RequestOptions,
|
|
73
|
-
): Core.PagePromise<LedgerAccountsPage> {
|
|
73
|
+
): Core.PagePromise<LedgerAccountsPage, LedgerAccount> {
|
|
74
74
|
if (isRequestOptions(query)) {
|
|
75
75
|
return this.list({}, query);
|
|
76
76
|
}
|
|
@@ -80,7 +80,7 @@ export class LedgerAccounts extends APIResource {
|
|
|
80
80
|
/**
|
|
81
81
|
* Delete a ledger account.
|
|
82
82
|
*/
|
|
83
|
-
del(id: string, options?: Core.RequestOptions):
|
|
83
|
+
del(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerAccount> {
|
|
84
84
|
return this.delete(`/api/ledger_accounts/${id}`, options);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -379,7 +379,11 @@ export interface LedgerAccountUpdateParams {
|
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
export interface LedgerAccountListParams extends PageParams {
|
|
382
|
-
|
|
382
|
+
/**
|
|
383
|
+
* If you have specific IDs to retrieve in bulk, you can pass them as query
|
|
384
|
+
* parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`.
|
|
385
|
+
*/
|
|
386
|
+
id?: Array<string>;
|
|
383
387
|
|
|
384
388
|
/**
|
|
385
389
|
* Use `balances[effective_at_lower_bound]` and
|
|
@@ -397,6 +401,8 @@ export interface LedgerAccountListParams extends PageParams {
|
|
|
397
401
|
*/
|
|
398
402
|
created_at?: Record<string, string>;
|
|
399
403
|
|
|
404
|
+
currency?: string;
|
|
405
|
+
|
|
400
406
|
ledger_account_category_id?: string;
|
|
401
407
|
|
|
402
408
|
ledger_id?: string;
|
|
@@ -14,13 +14,13 @@ export class LedgerEntries extends APIResource {
|
|
|
14
14
|
id: string,
|
|
15
15
|
query?: LedgerEntryRetrieveParams,
|
|
16
16
|
options?: Core.RequestOptions,
|
|
17
|
-
):
|
|
18
|
-
retrieve(id: string, options?: Core.RequestOptions):
|
|
17
|
+
): Core.APIPromise<LedgerEntry>;
|
|
18
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerEntry>;
|
|
19
19
|
retrieve(
|
|
20
20
|
id: string,
|
|
21
21
|
query: LedgerEntryRetrieveParams | Core.RequestOptions = {},
|
|
22
22
|
options?: Core.RequestOptions,
|
|
23
|
-
):
|
|
23
|
+
): Core.APIPromise<LedgerEntry> {
|
|
24
24
|
if (isRequestOptions(query)) {
|
|
25
25
|
return this.retrieve(id, {}, query);
|
|
26
26
|
}
|
|
@@ -30,12 +30,15 @@ export class LedgerEntries extends APIResource {
|
|
|
30
30
|
/**
|
|
31
31
|
* Get a list of all ledger entries.
|
|
32
32
|
*/
|
|
33
|
-
list(
|
|
34
|
-
|
|
33
|
+
list(
|
|
34
|
+
query?: LedgerEntryListParams,
|
|
35
|
+
options?: Core.RequestOptions,
|
|
36
|
+
): Core.PagePromise<LedgerEntriesPage, LedgerEntry>;
|
|
37
|
+
list(options?: Core.RequestOptions): Core.PagePromise<LedgerEntriesPage, LedgerEntry>;
|
|
35
38
|
list(
|
|
36
39
|
query: LedgerEntryListParams | Core.RequestOptions = {},
|
|
37
40
|
options?: Core.RequestOptions,
|
|
38
|
-
): Core.PagePromise<LedgerEntriesPage> {
|
|
41
|
+
): Core.PagePromise<LedgerEntriesPage, LedgerEntry> {
|
|
39
42
|
if (isRequestOptions(query)) {
|
|
40
43
|
return this.list({}, query);
|
|
41
44
|
}
|
|
@@ -238,7 +241,11 @@ export interface LedgerEntryRetrieveParams {
|
|
|
238
241
|
}
|
|
239
242
|
|
|
240
243
|
export interface LedgerEntryListParams extends PageParams {
|
|
241
|
-
|
|
244
|
+
/**
|
|
245
|
+
* If you have specific IDs to retrieve in bulk, you can pass them as query
|
|
246
|
+
* parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`.
|
|
247
|
+
*/
|
|
248
|
+
id?: Array<string>;
|
|
242
249
|
|
|
243
250
|
/**
|
|
244
251
|
* Shows all ledger entries that were present on a ledger account at a particular
|
|
@@ -254,7 +261,7 @@ export interface LedgerEntryListParams extends PageParams {
|
|
|
254
261
|
direction?: 'credit' | 'debit';
|
|
255
262
|
|
|
256
263
|
/**
|
|
257
|
-
* Use
|
|
264
|
+
* Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the
|
|
258
265
|
* transaction's effective time. Format ISO8601
|
|
259
266
|
*/
|
|
260
267
|
effective_at?: Record<string, string>;
|
|
@@ -281,6 +288,8 @@ export interface LedgerEntryListParams extends PageParams {
|
|
|
281
288
|
*/
|
|
282
289
|
ledger_account_lock_version?: Record<string, number>;
|
|
283
290
|
|
|
291
|
+
ledger_account_payout_id?: string;
|
|
292
|
+
|
|
284
293
|
/**
|
|
285
294
|
* Get all ledger entries that are included in the ledger account statement.
|
|
286
295
|
*/
|
|
@@ -288,6 +297,13 @@ export interface LedgerEntryListParams extends PageParams {
|
|
|
288
297
|
|
|
289
298
|
ledger_transaction_id?: string;
|
|
290
299
|
|
|
300
|
+
/**
|
|
301
|
+
* For example, if you want to query for records with metadata key `Type` and value
|
|
302
|
+
* `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
|
|
303
|
+
* parameters.
|
|
304
|
+
*/
|
|
305
|
+
metadata?: Record<string, string>;
|
|
306
|
+
|
|
291
307
|
/**
|
|
292
308
|
* Order by `created_at` or `effective_at` in `asc` or `desc` order. For example,
|
|
293
309
|
* to order by `effective_at asc`, use `order_by%5Beffective_at%5D=asc`. Ordering
|
|
@@ -13,7 +13,7 @@ export class LedgerEventHandlers extends APIResource {
|
|
|
13
13
|
create(
|
|
14
14
|
params: LedgerEventHandlerCreateParams,
|
|
15
15
|
options?: Core.RequestOptions,
|
|
16
|
-
):
|
|
16
|
+
): Core.APIPromise<LedgerEventHandlerCreateResponse> {
|
|
17
17
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
18
18
|
return this.post('/api/ledger_event_handlers', {
|
|
19
19
|
body,
|
|
@@ -25,10 +25,7 @@ export class LedgerEventHandlers extends APIResource {
|
|
|
25
25
|
/**
|
|
26
26
|
* Get details on a single ledger event handler.
|
|
27
27
|
*/
|
|
28
|
-
retrieve(
|
|
29
|
-
id: string,
|
|
30
|
-
options?: Core.RequestOptions,
|
|
31
|
-
): Promise<Core.APIResponse<LedgerEventHandlerRetrieveResponse>> {
|
|
28
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerEventHandlerRetrieveResponse> {
|
|
32
29
|
return this.get(`/api/ledger_event_handlers/${id}`, options);
|
|
33
30
|
}
|
|
34
31
|
|
|
@@ -38,12 +35,14 @@ export class LedgerEventHandlers extends APIResource {
|
|
|
38
35
|
list(
|
|
39
36
|
query?: LedgerEventHandlerListParams,
|
|
40
37
|
options?: Core.RequestOptions,
|
|
41
|
-
): Core.PagePromise<LedgerEventHandlerListResponsesPage>;
|
|
42
|
-
list(
|
|
38
|
+
): Core.PagePromise<LedgerEventHandlerListResponsesPage, LedgerEventHandlerListResponse>;
|
|
39
|
+
list(
|
|
40
|
+
options?: Core.RequestOptions,
|
|
41
|
+
): Core.PagePromise<LedgerEventHandlerListResponsesPage, LedgerEventHandlerListResponse>;
|
|
43
42
|
list(
|
|
44
43
|
query: LedgerEventHandlerListParams | Core.RequestOptions = {},
|
|
45
44
|
options?: Core.RequestOptions,
|
|
46
|
-
): Core.PagePromise<LedgerEventHandlerListResponsesPage> {
|
|
45
|
+
): Core.PagePromise<LedgerEventHandlerListResponsesPage, LedgerEventHandlerListResponse> {
|
|
47
46
|
if (isRequestOptions(query)) {
|
|
48
47
|
return this.list({}, query);
|
|
49
48
|
}
|
|
@@ -56,10 +55,7 @@ export class LedgerEventHandlers extends APIResource {
|
|
|
56
55
|
/**
|
|
57
56
|
* Archive a ledger event handler.
|
|
58
57
|
*/
|
|
59
|
-
del(
|
|
60
|
-
id: string,
|
|
61
|
-
options?: Core.RequestOptions,
|
|
62
|
-
): Promise<Core.APIResponse<LedgerEventHandlerDeleteResponse>> {
|
|
58
|
+
del(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerEventHandlerDeleteResponse> {
|
|
63
59
|
return this.delete(`/api/ledger_event_handlers/${id}`, options);
|
|
64
60
|
}
|
|
65
61
|
}
|