modern-treasury 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +75 -0
- package/README.md +43 -15
- 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/ReadableStream.d.ts +38 -0
- package/_shims/ReadableStream.js +5 -0
- package/_shims/ReadableStream.mjs +7 -0
- package/_shims/{agent.node.d.ts → agent-node.d.ts} +1 -1
- package/_shims/agent-node.d.ts.map +1 -0
- package/_shims/{agent.node.js → agent-node.js} +1 -1
- package/_shims/{agent.node.js.map → agent-node.js.map} +1 -1
- package/_shims/{agent.node.mjs → agent-node.mjs} +1 -1
- package/_shims/{agent.node.mjs.map → agent-node.mjs.map} +1 -1
- package/_shims/agent.d.ts +1 -1
- package/_shims/agent.js +1 -1
- package/_shims/agent.mjs +1 -1
- package/_shims/{fetch.node.d.ts → fetch-node.d.ts} +12 -1
- package/_shims/fetch.d.ts +9 -1
- package/_shims/{fileFromPath.node.d.ts → fileFromPath-node.d.ts} +2 -2
- package/_shims/{fileFromPath.node.d.ts.map → fileFromPath-node.d.ts.map} +1 -1
- package/_shims/{fileFromPath.node.js → fileFromPath-node.js} +1 -1
- package/_shims/{fileFromPath.node.js.map → fileFromPath-node.js.map} +1 -1
- package/_shims/{fileFromPath.node.mjs → fileFromPath-node.mjs} +1 -1
- package/_shims/{fileFromPath.node.mjs.map → fileFromPath-node.mjs.map} +1 -1
- package/_shims/fileFromPath.d.ts +2 -2
- package/_shims/fileFromPath.d.ts.map +1 -1
- package/_shims/fileFromPath.js +1 -1
- package/_shims/fileFromPath.mjs +1 -1
- package/_shims/form-data.js +17 -0
- package/_shims/form-data.mjs +20 -0
- package/_shims/{getMultipartRequestOptions.node.d.ts → getMultipartRequestOptions-node.d.ts} +2 -2
- package/_shims/getMultipartRequestOptions-node.d.ts.map +1 -0
- package/_shims/{getMultipartRequestOptions.node.js → getMultipartRequestOptions-node.js} +1 -1
- package/_shims/{getMultipartRequestOptions.node.js.map → getMultipartRequestOptions-node.js.map} +1 -1
- package/_shims/{getMultipartRequestOptions.node.mjs → getMultipartRequestOptions-node.mjs} +1 -1
- package/_shims/{getMultipartRequestOptions.node.mjs.map → getMultipartRequestOptions-node.mjs.map} +1 -1
- package/_shims/getMultipartRequestOptions.d.ts +1 -1
- package/_shims/getMultipartRequestOptions.d.ts.map +1 -1
- package/_shims/{node-readable.node.d.ts → node-readable-node.d.ts} +1 -1
- package/_shims/{node-readable.node.d.ts.map → node-readable-node.d.ts.map} +1 -1
- package/_shims/{node-readable.node.js → node-readable-node.js} +1 -1
- package/_shims/node-readable-node.js.map +1 -0
- package/_shims/{node-readable.node.mjs → node-readable-node.mjs} +1 -1
- package/_shims/node-readable-node.mjs.map +1 -0
- package/core.d.ts +91 -34
- package/core.d.ts.map +1 -1
- package/core.js +201 -70
- package/core.js.map +1 -1
- package/core.mjs +195 -70
- package/core.mjs.map +1 -1
- package/index.d.mts +19 -7
- package/index.d.ts +19 -7
- package/index.d.ts.map +1 -1
- package/index.js +23 -9
- package/index.js.map +1 -1
- package/index.mjs +23 -9
- package/index.mjs.map +1 -1
- package/package.json +32 -9
- 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 +8 -33
- package/resources/account-collection-flows.d.ts.map +1 -1
- package/resources/account-collection-flows.js +22 -17
- package/resources/account-collection-flows.js.map +1 -1
- package/resources/account-collection-flows.mjs +22 -17
- package/resources/account-collection-flows.mjs.map +1 -1
- package/resources/account-details.d.ts +8 -13
- package/resources/account-details.d.ts.map +1 -1
- package/resources/account-details.js +10 -4
- package/resources/account-details.js.map +1 -1
- package/resources/account-details.mjs +10 -4
- package/resources/account-details.mjs.map +1 -1
- package/resources/connections.d.ts +5 -2
- package/resources/connections.d.ts.map +1 -1
- package/resources/connections.js +3 -3
- package/resources/connections.js.map +1 -1
- package/resources/connections.mjs +3 -3
- package/resources/connections.mjs.map +1 -1
- package/resources/counterparties.d.ts +37 -51
- package/resources/counterparties.d.ts.map +1 -1
- package/resources/counterparties.js +17 -5
- package/resources/counterparties.js.map +1 -1
- package/resources/counterparties.mjs +17 -5
- package/resources/counterparties.mjs.map +1 -1
- package/resources/documents.d.ts +6 -17
- package/resources/documents.d.ts.map +1 -1
- package/resources/documents.js +13 -7
- package/resources/documents.js.map +1 -1
- package/resources/documents.mjs +13 -7
- package/resources/documents.mjs.map +1 -1
- package/resources/events.d.ts +3 -3
- package/resources/events.d.ts.map +1 -1
- package/resources/events.js +3 -3
- package/resources/events.mjs +3 -3
- package/resources/expected-payments.d.ts +30 -39
- package/resources/expected-payments.d.ts.map +1 -1
- package/resources/expected-payments.js +10 -4
- package/resources/expected-payments.js.map +1 -1
- package/resources/expected-payments.mjs +10 -4
- package/resources/expected-payments.mjs.map +1 -1
- package/resources/external-accounts.d.ts +27 -61
- package/resources/external-accounts.d.ts.map +1 -1
- package/resources/external-accounts.js +24 -6
- package/resources/external-accounts.js.map +1 -1
- package/resources/external-accounts.mjs +24 -6
- package/resources/external-accounts.mjs.map +1 -1
- package/resources/incoming-payment-details.d.ts +20 -21
- package/resources/incoming-payment-details.d.ts.map +1 -1
- package/resources/incoming-payment-details.js +10 -4
- package/resources/incoming-payment-details.js.map +1 -1
- package/resources/incoming-payment-details.mjs +10 -4
- package/resources/incoming-payment-details.mjs.map +1 -1
- package/resources/index.d.ts +0 -3
- 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 +3 -3
- package/resources/internal-accounts/balance-reports.js.map +1 -1
- package/resources/internal-accounts/balance-reports.mjs +3 -3
- package/resources/internal-accounts/balance-reports.mjs.map +1 -1
- package/resources/internal-accounts/internal-accounts.d.ts +16 -21
- package/resources/internal-accounts/internal-accounts.d.ts.map +1 -1
- package/resources/internal-accounts/internal-accounts.js +10 -4
- package/resources/internal-accounts/internal-accounts.js.map +1 -1
- package/resources/internal-accounts/internal-accounts.mjs +10 -4
- package/resources/internal-accounts/internal-accounts.mjs.map +1 -1
- package/resources/invoices/invoices.d.ts +67 -42
- package/resources/invoices/invoices.d.ts.map +1 -1
- package/resources/invoices/invoices.js +10 -4
- package/resources/invoices/invoices.js.map +1 -1
- package/resources/invoices/invoices.mjs +10 -4
- package/resources/invoices/invoices.mjs.map +1 -1
- package/resources/invoices/line-items.d.ts +32 -185
- package/resources/invoices/line-items.d.ts.map +1 -1
- package/resources/invoices/line-items.js +10 -4
- package/resources/invoices/line-items.js.map +1 -1
- package/resources/invoices/line-items.mjs +10 -4
- package/resources/invoices/line-items.mjs.map +1 -1
- package/resources/ledger-account-categories.d.ts +47 -87
- package/resources/ledger-account-categories.d.ts.map +1 -1
- package/resources/ledger-account-categories.js +21 -17
- package/resources/ledger-account-categories.js.map +1 -1
- package/resources/ledger-account-categories.mjs +21 -17
- package/resources/ledger-account-categories.mjs.map +1 -1
- package/resources/ledger-account-payouts.d.ts +33 -22
- package/resources/ledger-account-payouts.d.ts.map +1 -1
- package/resources/ledger-account-payouts.js +10 -4
- package/resources/ledger-account-payouts.js.map +1 -1
- package/resources/ledger-account-payouts.mjs +10 -4
- package/resources/ledger-account-payouts.mjs.map +1 -1
- package/resources/ledger-account-statements.d.ts +11 -16
- package/resources/ledger-account-statements.d.ts.map +1 -1
- package/resources/ledger-account-statements.js +8 -2
- package/resources/ledger-account-statements.js.map +1 -1
- package/resources/ledger-account-statements.mjs +8 -2
- package/resources/ledger-account-statements.mjs.map +1 -1
- package/resources/ledger-accounts.d.ts +30 -30
- package/resources/ledger-accounts.d.ts.map +1 -1
- package/resources/ledger-accounts.js +10 -4
- package/resources/ledger-accounts.js.map +1 -1
- package/resources/ledger-accounts.mjs +10 -4
- 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 +3 -3
- package/resources/ledger-entries.js.map +1 -1
- package/resources/ledger-entries.mjs +3 -3
- package/resources/ledger-entries.mjs.map +1 -1
- package/resources/ledger-event-handlers.d.ts +12 -24
- package/resources/ledger-event-handlers.d.ts.map +1 -1
- package/resources/ledger-event-handlers.js +10 -4
- package/resources/ledger-event-handlers.js.map +1 -1
- package/resources/ledger-event-handlers.mjs +10 -4
- package/resources/ledger-event-handlers.mjs.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.d.ts +48 -37
- package/resources/ledger-transactions/ledger-transactions.d.ts.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.js +13 -7
- package/resources/ledger-transactions/ledger-transactions.js.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.mjs +13 -7
- 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 +3 -3
- package/resources/ledger-transactions/versions.js.map +1 -1
- package/resources/ledger-transactions/versions.mjs +3 -3
- package/resources/ledger-transactions/versions.mjs.map +1 -1
- package/resources/ledgerable-events.d.ts +13 -18
- package/resources/ledgerable-events.d.ts.map +1 -1
- package/resources/ledgerable-events.js +8 -2
- package/resources/ledgerable-events.js.map +1 -1
- package/resources/ledgerable-events.mjs +8 -2
- package/resources/ledgerable-events.mjs.map +1 -1
- package/resources/ledgers.d.ts +16 -20
- package/resources/ledgers.d.ts.map +1 -1
- package/resources/ledgers.js +10 -4
- package/resources/ledgers.js.map +1 -1
- package/resources/ledgers.mjs +10 -4
- 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/line-items.js +3 -3
- package/resources/line-items.mjs +3 -3
- package/resources/paper-items.d.ts +6 -3
- package/resources/paper-items.d.ts.map +1 -1
- package/resources/paper-items.js +3 -3
- package/resources/paper-items.js.map +1 -1
- package/resources/paper-items.mjs +3 -3
- package/resources/paper-items.mjs.map +1 -1
- package/resources/payment-flows.d.ts +18 -42
- package/resources/payment-flows.d.ts.map +1 -1
- package/resources/payment-flows.js +22 -17
- package/resources/payment-flows.js.map +1 -1
- package/resources/payment-flows.mjs +22 -17
- package/resources/payment-flows.mjs.map +1 -1
- package/resources/payment-orders/payment-orders.d.ts +172 -191
- package/resources/payment-orders/payment-orders.d.ts.map +1 -1
- package/resources/payment-orders/payment-orders.js +21 -11
- package/resources/payment-orders/payment-orders.js.map +1 -1
- package/resources/payment-orders/payment-orders.mjs +21 -11
- package/resources/payment-orders/payment-orders.mjs.map +1 -1
- package/resources/payment-orders/reversals.d.ts +21 -22
- package/resources/payment-orders/reversals.d.ts.map +1 -1
- package/resources/payment-orders/reversals.js +10 -4
- package/resources/payment-orders/reversals.js.map +1 -1
- package/resources/payment-orders/reversals.mjs +10 -4
- 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/payment-references.js +3 -3
- package/resources/payment-references.mjs +3 -3
- package/resources/returns.d.ts +16 -19
- package/resources/returns.d.ts.map +1 -1
- package/resources/returns.js +10 -4
- package/resources/returns.js.map +1 -1
- package/resources/returns.mjs +10 -4
- package/resources/returns.mjs.map +1 -1
- package/resources/routing-details.d.ts +9 -15
- package/resources/routing-details.d.ts.map +1 -1
- package/resources/routing-details.js +10 -4
- package/resources/routing-details.js.map +1 -1
- package/resources/routing-details.mjs +10 -4
- package/resources/routing-details.mjs.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 +3 -3
- package/resources/transactions/line-items.js.map +1 -1
- package/resources/transactions/line-items.mjs +3 -3
- 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 +3 -3
- package/resources/transactions/transactions.js.map +1 -1
- package/resources/transactions/transactions.mjs +3 -3
- 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/validations.js +1 -1
- package/resources/validations.mjs +1 -1
- package/resources/virtual-accounts.d.ts +19 -28
- package/resources/virtual-accounts.d.ts.map +1 -1
- package/resources/virtual-accounts.js +10 -4
- package/resources/virtual-accounts.js.map +1 -1
- package/resources/virtual-accounts.mjs +10 -4
- package/resources/virtual-accounts.mjs.map +1 -1
- package/resources/webhooks.js +2 -2
- package/resources/webhooks.mjs +2 -2
- package/src/_shims/ReadableStream-node.ts +6 -0
- 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/agent.ts +1 -1
- package/src/_shims/{fetch.node.d.ts → fetch-node.d.ts} +20 -9
- package/src/_shims/fetch.d.ts +18 -10
- package/src/_shims/{fileFromPath.node.ts → fileFromPath-node.ts} +1 -1
- package/src/_shims/fileFromPath.ts +2 -2
- package/src/_shims/{formdata.node.d.ts → form-data-node.d.ts} +4 -4
- package/src/_shims/{formdata.d.ts → form-data.d.ts} +4 -4
- package/src/_shims/form-data.js +17 -0
- package/src/_shims/form-data.mjs +20 -0
- package/src/_shims/{getMultipartRequestOptions.node.ts → getMultipartRequestOptions-node.ts} +3 -3
- package/src/_shims/getMultipartRequestOptions.ts +3 -3
- package/src/core.ts +275 -97
- package/src/error.ts +1 -1
- package/src/index.ts +31 -18
- package/src/pagination.ts +6 -6
- package/src/resource.ts +1 -1
- package/src/resources/account-collection-flows.ts +29 -57
- package/src/resources/account-details.ts +22 -22
- package/src/resources/connections.ts +11 -8
- package/src/resources/counterparties.ts +61 -65
- package/src/resources/documents.ts +21 -30
- package/src/resources/events.ts +9 -9
- package/src/resources/expected-payments.ts +45 -49
- package/src/resources/external-accounts.ts +59 -78
- package/src/resources/incoming-payment-details.ts +38 -33
- package/src/resources/index.ts +39 -36
- package/src/resources/internal-accounts/balance-reports.ts +13 -10
- package/src/resources/internal-accounts/index.ts +2 -2
- package/src/resources/internal-accounts/internal-accounts.ts +35 -35
- package/src/resources/invoices/index.ts +2 -2
- package/src/resources/invoices/invoices.ts +91 -54
- package/src/resources/invoices/line-items.ts +46 -228
- package/src/resources/ledger-account-categories.ts +67 -111
- package/src/resources/ledger-account-payouts.ts +49 -30
- package/src/resources/ledger-account-statements.ts +21 -21
- package/src/resources/ledger-accounts.ts +46 -40
- package/src/resources/ledger-entries.ts +29 -13
- package/src/resources/ledger-event-handlers.ts +25 -35
- package/src/resources/ledger-transactions/index.ts +2 -2
- package/src/resources/ledger-transactions/ledger-transactions.ts +73 -53
- package/src/resources/ledger-transactions/versions.ts +10 -8
- package/src/resources/ledgerable-events.ts +23 -23
- package/src/resources/ledgers.ts +31 -29
- package/src/resources/line-items.ts +12 -12
- package/src/resources/paper-items.ts +13 -10
- package/src/resources/payment-flows.ts +39 -66
- package/src/resources/payment-orders/index.ts +2 -2
- package/src/resources/payment-orders/payment-orders.ts +204 -216
- package/src/resources/payment-orders/reversals.ts +36 -31
- package/src/resources/payment-references.ts +9 -9
- package/src/resources/returns.ts +30 -28
- package/src/resources/routing-details.ts +23 -24
- package/src/resources/top-level.ts +1 -1
- package/src/resources/transactions/index.ts +7 -2
- package/src/resources/transactions/line-items.ts +11 -8
- package/src/resources/transactions/transactions.ts +17 -14
- package/src/resources/validations.ts +4 -4
- package/src/resources/virtual-accounts.ts +35 -39
- package/src/resources/webhooks.ts +3 -3
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +6 -6
- package/src/version.ts +1 -1
- package/uploads.d.ts +1 -1
- package/uploads.d.ts.map +1 -1
- package/uploads.js +7 -7
- package/uploads.js.map +1 -1
- package/uploads.mjs +4 -4
- package/uploads.mjs.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/_shims/agent.node.d.ts.map +0 -1
- package/_shims/formdata.js +0 -9
- package/_shims/formdata.mjs +0 -11
- package/_shims/getMultipartRequestOptions.node.d.ts.map +0 -1
- package/_shims/node-readable.node.js.map +0 -1
- package/_shims/node-readable.node.mjs.map +0 -1
- package/src/_shims/fetch.deno.ts +0 -23
- package/src/_shims/formdata.deno.ts +0 -16
- package/src/_shims/formdata.js +0 -9
- package/src/_shims/formdata.mjs +0 -11
- /package/_shims/{fetch.node.js → fetch-node.js} +0 -0
- /package/_shims/{fetch.node.mjs → fetch-node.mjs} +0 -0
- /package/_shims/{formdata.node.d.ts → form-data-node.d.ts} +0 -0
- /package/_shims/{formdata.node.js → form-data-node.js} +0 -0
- /package/_shims/{formdata.node.mjs → form-data-node.mjs} +0 -0
- /package/_shims/{formdata.d.ts → form-data.d.ts} +0 -0
- /package/src/_shims/{agent.node.ts → agent-node.ts} +0 -0
- /package/src/_shims/{fetch.node.js → fetch-node.js} +0 -0
- /package/src/_shims/{fetch.node.mjs → fetch-node.mjs} +0 -0
- /package/src/_shims/{formdata.node.js → form-data-node.js} +0 -0
- /package/src/_shims/{formdata.node.mjs → form-data-node.mjs} +0 -0
- /package/src/_shims/{node-readable.node.ts → node-readable-node.ts} +0 -0
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
import * as Core from '../../core';
|
|
4
|
-
import { APIResource } from '../../resource';
|
|
5
|
-
import { isRequestOptions } from '../../core';
|
|
6
|
-
import * as
|
|
7
|
-
import
|
|
8
|
-
import { Page, PageParams } from '../../pagination';
|
|
3
|
+
import * as Core from '../../core.js';
|
|
4
|
+
import { APIResource } from '../../resource.js';
|
|
5
|
+
import { isRequestOptions } from '../../core.js';
|
|
6
|
+
import * as API from './index.js';
|
|
7
|
+
import { Page, PageParams } from '../../pagination.js';
|
|
9
8
|
|
|
10
9
|
export class LineItems extends APIResource {
|
|
11
10
|
/**
|
|
@@ -15,23 +14,25 @@ export class LineItems extends APIResource {
|
|
|
15
14
|
invoiceId: string,
|
|
16
15
|
params: LineItemCreateParams,
|
|
17
16
|
options?: Core.RequestOptions,
|
|
18
|
-
):
|
|
17
|
+
): Core.APIPromise<InvoiceLineItem> {
|
|
18
|
+
// @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
|
|
19
19
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
20
|
+
if (idempotencyKey) {
|
|
21
|
+
console.warn(
|
|
22
|
+
"The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
|
|
23
|
+
);
|
|
24
|
+
}
|
|
20
25
|
return this.post(`/api/invoices/${invoiceId}/invoice_line_items`, {
|
|
21
26
|
body,
|
|
22
27
|
...options,
|
|
23
|
-
headers: { 'Idempotency-Key': idempotencyKey
|
|
28
|
+
headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
|
|
24
29
|
});
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
/**
|
|
28
33
|
* get invoice_line_item
|
|
29
34
|
*/
|
|
30
|
-
retrieve(
|
|
31
|
-
invoiceId: string,
|
|
32
|
-
id: string,
|
|
33
|
-
options?: Core.RequestOptions,
|
|
34
|
-
): Promise<Core.APIResponse<InvoiceLineItem>> {
|
|
35
|
+
retrieve(invoiceId: string, id: string, options?: Core.RequestOptions): Core.APIPromise<InvoiceLineItem> {
|
|
35
36
|
return this.get(`/api/invoices/${invoiceId}/invoice_line_items/${id}`, options);
|
|
36
37
|
}
|
|
37
38
|
|
|
@@ -43,18 +44,14 @@ export class LineItems extends APIResource {
|
|
|
43
44
|
id: string,
|
|
44
45
|
body?: LineItemUpdateParams,
|
|
45
46
|
options?: Core.RequestOptions,
|
|
46
|
-
):
|
|
47
|
-
update(
|
|
48
|
-
invoiceId: string,
|
|
49
|
-
id: string,
|
|
50
|
-
options?: Core.RequestOptions,
|
|
51
|
-
): Promise<Core.APIResponse<InvoiceLineItem>>;
|
|
47
|
+
): Core.APIPromise<InvoiceLineItem>;
|
|
48
|
+
update(invoiceId: string, id: string, options?: Core.RequestOptions): Core.APIPromise<InvoiceLineItem>;
|
|
52
49
|
update(
|
|
53
50
|
invoiceId: string,
|
|
54
51
|
id: string,
|
|
55
52
|
body: LineItemUpdateParams | Core.RequestOptions = {},
|
|
56
53
|
options?: Core.RequestOptions,
|
|
57
|
-
):
|
|
54
|
+
): Core.APIPromise<InvoiceLineItem> {
|
|
58
55
|
if (isRequestOptions(body)) {
|
|
59
56
|
return this.update(invoiceId, id, {}, body);
|
|
60
57
|
}
|
|
@@ -68,13 +65,16 @@ export class LineItems extends APIResource {
|
|
|
68
65
|
invoiceId: string,
|
|
69
66
|
query?: LineItemListParams,
|
|
70
67
|
options?: Core.RequestOptions,
|
|
71
|
-
): Core.PagePromise<InvoiceLineItemsPage>;
|
|
72
|
-
list(
|
|
68
|
+
): Core.PagePromise<InvoiceLineItemsPage, InvoiceLineItem>;
|
|
69
|
+
list(
|
|
70
|
+
invoiceId: string,
|
|
71
|
+
options?: Core.RequestOptions,
|
|
72
|
+
): Core.PagePromise<InvoiceLineItemsPage, InvoiceLineItem>;
|
|
73
73
|
list(
|
|
74
74
|
invoiceId: string,
|
|
75
75
|
query: LineItemListParams | Core.RequestOptions = {},
|
|
76
76
|
options?: Core.RequestOptions,
|
|
77
|
-
): Core.PagePromise<InvoiceLineItemsPage> {
|
|
77
|
+
): Core.PagePromise<InvoiceLineItemsPage, InvoiceLineItem> {
|
|
78
78
|
if (isRequestOptions(query)) {
|
|
79
79
|
return this.list(invoiceId, {}, query);
|
|
80
80
|
}
|
|
@@ -87,11 +87,7 @@ export class LineItems extends APIResource {
|
|
|
87
87
|
/**
|
|
88
88
|
* delete invoice_line_item
|
|
89
89
|
*/
|
|
90
|
-
del(
|
|
91
|
-
invoiceId: string,
|
|
92
|
-
id: string,
|
|
93
|
-
options?: Core.RequestOptions,
|
|
94
|
-
): Promise<Core.APIResponse<InvoiceLineItem>> {
|
|
90
|
+
del(invoiceId: string, id: string, options?: Core.RequestOptions): Core.APIPromise<InvoiceLineItem> {
|
|
95
91
|
return this.delete(`/api/invoices/${invoiceId}/invoice_line_items/${id}`, options);
|
|
96
92
|
}
|
|
97
93
|
}
|
|
@@ -153,242 +149,64 @@ export interface InvoiceLineItem {
|
|
|
153
149
|
|
|
154
150
|
export interface LineItemCreateParams {
|
|
155
151
|
/**
|
|
156
|
-
*
|
|
152
|
+
* The name of the line item, typically a product or SKU name.
|
|
157
153
|
*/
|
|
158
154
|
name: string;
|
|
159
155
|
|
|
160
156
|
/**
|
|
161
|
-
*
|
|
162
|
-
*
|
|
157
|
+
* The cost per unit of the product or service that this line item is for,
|
|
158
|
+
* specified in the invoice currency's smallest unit.
|
|
163
159
|
*/
|
|
164
160
|
unit_amount: number;
|
|
165
161
|
|
|
166
162
|
/**
|
|
167
|
-
*
|
|
163
|
+
* An optional free-form description of the line item.
|
|
168
164
|
*/
|
|
169
165
|
description?: string;
|
|
170
166
|
|
|
171
167
|
/**
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
168
|
+
* Either `debit` or `credit`. `debit` indicates that a client owes the business
|
|
169
|
+
* money and increases the invoice's `total_amount` due. `credit` has the opposite
|
|
170
|
+
* intention and effect.
|
|
175
171
|
*/
|
|
176
172
|
direction?: string;
|
|
177
173
|
|
|
178
174
|
/**
|
|
179
|
-
*
|
|
180
|
-
*
|
|
175
|
+
* The number of units of a product or service that this line item is for. Must be
|
|
176
|
+
* a whole number. Defaults to 1 if not provided.
|
|
181
177
|
*/
|
|
182
178
|
quantity?: number;
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Header param: This key should be something unique, preferably something like an
|
|
186
|
-
* UUID.
|
|
187
|
-
*/
|
|
188
|
-
'Idempotency-Key'?: string;
|
|
189
179
|
}
|
|
190
180
|
|
|
191
181
|
export interface LineItemUpdateParams {
|
|
192
182
|
/**
|
|
193
|
-
*
|
|
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
|
-
*
|
|
224
|
-
|
|
225
|
-
|
|
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
|
-
|
|
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
|
|
195
|
+
* The name of the line item, typically a product or SKU name.
|
|
308
196
|
*/
|
|
309
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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 {}
|