Skip to content

Commit

Permalink
feat(api): updates (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Sep 19, 2023
1 parent c2d9f18 commit ce16952
Show file tree
Hide file tree
Showing 30 changed files with 1,014 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 127
configured_endpoints: 134
22 changes: 19 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Methods:
- <code title="get /api/invoices/{id}">client.invoices.<a href="./src/resources/invoices/invoices.ts">retrieve</a>(id) -> Invoice</code>
- <code title="patch /api/invoices/{id}">client.invoices.<a href="./src/resources/invoices/invoices.ts">update</a>(id, { ...params }) -> Invoice</code>
- <code title="get /api/invoices">client.invoices.<a href="./src/resources/invoices/invoices.ts">list</a>({ ...params }) -> InvoicesPage</code>
- <code title="put /api/invoices/{id}/payment_orders/{payment_order_id}">client.invoices.<a href="./src/resources/invoices/invoices.ts">addPaymentOrder</a>(id, paymentOrderId) -> void</code>

## LineItems

Expand Down Expand Up @@ -249,6 +250,20 @@ Methods:
- <code title="get /api/ledger_accounts">client.ledgerAccounts.<a href="./src/resources/ledger-accounts.ts">list</a>({ ...params }) -> LedgerAccountsPage</code>
- <code title="delete /api/ledger_accounts/{id}">client.ledgerAccounts.<a href="./src/resources/ledger-accounts.ts">del</a>(id) -> LedgerAccount</code>

# LedgerAccountBalanceMonitors

Types:

- <code><a href="./src/resources/ledger-account-balance-monitors.ts">LedgerAccountBalanceMonitor</a></code>

Methods:

- <code title="post /api/ledger_account_balance_monitors">client.ledgerAccountBalanceMonitors.<a href="./src/resources/ledger-account-balance-monitors.ts">create</a>({ ...params }) -> LedgerAccountBalanceMonitor</code>
- <code title="get /api/ledger_account_balance_monitors/{id}">client.ledgerAccountBalanceMonitors.<a href="./src/resources/ledger-account-balance-monitors.ts">retrieve</a>(id) -> LedgerAccountBalanceMonitor</code>
- <code title="patch /api/ledger_account_balance_monitors/{id}">client.ledgerAccountBalanceMonitors.<a href="./src/resources/ledger-account-balance-monitors.ts">update</a>(id, { ...params }) -> LedgerAccountBalanceMonitor</code>
- <code title="get /api/ledger_account_balance_monitors">client.ledgerAccountBalanceMonitors.<a href="./src/resources/ledger-account-balance-monitors.ts">list</a>({ ...params }) -> LedgerAccountBalanceMonitorsPage</code>
- <code title="delete /api/ledger_account_balance_monitors/{id}">client.ledgerAccountBalanceMonitors.<a href="./src/resources/ledger-account-balance-monitors.ts">del</a>(id) -> LedgerAccountBalanceMonitor</code>

# LedgerAccountPayouts

Types:
Expand All @@ -258,9 +273,9 @@ Types:
Methods:

- <code title="post /api/ledger_account_payouts">client.ledgerAccountPayouts.<a href="./src/resources/ledger-account-payouts.ts">create</a>({ ...params }) -> LedgerAccountPayout</code>
- <code title="get /api/ledger_account_payouts/{id}">client.ledgerAccountPayouts.<a href="./src/resources/ledger-account-payouts.ts">retrieve</a>(id) -> LedgerAccountPayout</code>
- <code title="patch /api/ledger_account_payouts/{id}">client.ledgerAccountPayouts.<a href="./src/resources/ledger-account-payouts.ts">update</a>(id, { ...params }) -> LedgerAccountPayout</code>
- <code title="get /api/ledger_account_payouts">client.ledgerAccountPayouts.<a href="./src/resources/ledger-account-payouts.ts">list</a>({ ...params }) -> LedgerAccountPayoutsPage</code>
- <code title="get /api/ledger_account_payouts/{id}">client.ledgerAccountPayouts.<a href="./src/resources/ledger-account-payouts.ts">retireve</a>(id) -> LedgerAccountPayout</code>

# LedgerAccountStatements

Expand Down Expand Up @@ -386,8 +401,8 @@ Types:

Methods:

- <code title="get /api/payment_references/{id}">client.paymentReferences.<a href="./src/resources/payment-references.ts">retrieve</a>(id) -> PaymentReference</code>
- <code title="get /api/payment_references">client.paymentReferences.<a href="./src/resources/payment-references.ts">list</a>({ ...params }) -> PaymentReferencesPage</code>
- <code title="get /api/payment_references/{id}">client.paymentReferences.<a href="./src/resources/payment-references.ts">retireve</a>(id) -> PaymentReference</code>

# Returns

Expand Down Expand Up @@ -421,7 +436,8 @@ Types:

Methods:

- <code title="get /api/transactions/{transaction_id}/line_items">client.transactions.lineItems.<a href="./src/resources/transactions/line-items.ts">list</a>(transactionId, { ...params }) -> TransactionLineItemsPage</code>
- <code title="get /api/transaction_line_items/{id}">client.transactions.lineItems.<a href="./src/resources/transactions/line-items.ts">retrieve</a>(id) -> TransactionLineItem</code>
- <code title="get /api/transaction_line_items">client.transactions.lineItems.<a href="./src/resources/transactions/line-items.ts">list</a>({ ...params }) -> TransactionLineItemsPage</code>

# Validations

Expand Down
8 changes: 8 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export class ModernTreasury extends Core.APIClient {
ledgerableEvents: API.LedgerableEvents = new API.LedgerableEvents(this);
ledgerAccountCategories: API.LedgerAccountCategories = new API.LedgerAccountCategories(this);
ledgerAccounts: API.LedgerAccounts = new API.LedgerAccounts(this);
ledgerAccountBalanceMonitors: API.LedgerAccountBalanceMonitors = new API.LedgerAccountBalanceMonitors(this);
ledgerAccountPayouts: API.LedgerAccountPayouts = new API.LedgerAccountPayouts(this);
ledgerAccountStatements: API.LedgerAccountStatements = new API.LedgerAccountStatements(this);
ledgerEntries: API.LedgerEntries = new API.LedgerEntries(this);
Expand Down Expand Up @@ -353,6 +354,13 @@ export namespace ModernTreasury {
export import LedgerAccountUpdateParams = API.LedgerAccountUpdateParams;
export import LedgerAccountListParams = API.LedgerAccountListParams;

export import LedgerAccountBalanceMonitors = API.LedgerAccountBalanceMonitors;
export import LedgerAccountBalanceMonitor = API.LedgerAccountBalanceMonitor;
export import LedgerAccountBalanceMonitorsPage = API.LedgerAccountBalanceMonitorsPage;
export import LedgerAccountBalanceMonitorCreateParams = API.LedgerAccountBalanceMonitorCreateParams;
export import LedgerAccountBalanceMonitorUpdateParams = API.LedgerAccountBalanceMonitorUpdateParams;
export import LedgerAccountBalanceMonitorListParams = API.LedgerAccountBalanceMonitorListParams;

export import LedgerAccountPayouts = API.LedgerAccountPayouts;
export import LedgerAccountPayout = API.LedgerAccountPayout;
export import LedgerAccountPayoutsPage = API.LedgerAccountPayoutsPage;
Expand Down
40 changes: 40 additions & 0 deletions src/resources/account-collection-flows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,26 @@ export interface AccountCollectionFlow {

object?: string;

receiving_countries?: Array<
| 'USA'
| 'AUS'
| 'BEL'
| 'CAN'
| 'CHL'
| 'CHN'
| 'COL'
| 'FRA'
| 'DEU'
| 'HKG'
| 'IND'
| 'IRL'
| 'ITA'
| 'MEX'
| 'NLD'
| 'PER'
| 'ESP'
>;

/**
* The current status of the account collection flow. One of `pending`,
* `completed`, `expired`, or `cancelled`.
Expand All @@ -131,6 +151,26 @@ export interface AccountCollectionFlowCreateParams {
counterparty_id: string;

payment_types: Array<string>;

receiving_countries?: Array<
| 'USA'
| 'AUS'
| 'BEL'
| 'CAN'
| 'CHL'
| 'CHN'
| 'COL'
| 'FRA'
| 'DEU'
| 'HKG'
| 'IND'
| 'IRL'
| 'ITA'
| 'MEX'
| 'NLD'
| 'PER'
| 'ESP'
>;
}

export interface AccountCollectionFlowUpdateParams {
Expand Down
11 changes: 9 additions & 2 deletions src/resources/counterparties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,18 +533,21 @@ export namespace CounterpartyCreateParams {
routing_number_type:
| 'aba'
| 'au_bsb'
| 'se_bankgiro_clearing_code'
| 'br_codigo'
| 'ca_cpa'
| 'chips'
| 'cnaps'
| 'gb_sort_code'
| 'in_ifsc'
| 'my_branch_code'
| 'swift';
| 'swift'
| 'jp_zengin_code';

payment_type?:
| 'ach'
| 'au_becs'
| 'se_bankgirot'
| 'bacs'
| 'book'
| 'card'
Expand All @@ -554,12 +557,15 @@ export namespace CounterpartyCreateParams {
| 'interac'
| 'masav'
| 'neft'
| 'nics'
| 'provxchange'
| 'rtp'
| 'sen'
| 'sic'
| 'sepa'
| 'signet'
| 'wire';
| 'wire'
| 'zengin';
}
}
}
Expand Down Expand Up @@ -668,6 +674,7 @@ export interface CounterpartyCollectAccountParams {
| 'brCodigo'
| 'routingNumberType'
| 'address'
| 'jp_zengin_code'
>;

/**
Expand Down
14 changes: 11 additions & 3 deletions src/resources/expected-payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export interface ExpectedPayment {
/**
* One of unreconciled, reconciled, or archived.
*/
status: 'archived' | 'reconciled' | 'unreconciled';
status: 'archived' | 'partially_reconciled' | 'reconciled' | 'unreconciled';

/**
* The ID of the Transaction this expected payment object has been matched to.
Expand Down Expand Up @@ -230,12 +230,16 @@ export type ExpectedPaymentType =
| 'interac'
| 'masav'
| 'neft'
| 'nics'
| 'provxchange'
| 'rtp'
| 'se_bankgirot'
| 'sen'
| 'sepa'
| 'sic'
| 'signet'
| 'wire'
| 'zengin'
| null;

export interface ExpectedPaymentCreateParams {
Expand Down Expand Up @@ -477,7 +481,7 @@ export interface ExpectedPaymentListParams extends PageParams {
/**
* One of unreconciled, reconciled, or archived.
*/
status?: 'archived' | 'reconciled' | 'unreconciled';
status?: 'archived' | 'partially_reconciled' | 'reconciled' | 'unreconciled';

/**
* One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp,sen,
Expand All @@ -495,12 +499,16 @@ export interface ExpectedPaymentListParams extends PageParams {
| 'interac'
| 'masav'
| 'neft'
| 'nics'
| 'provxchange'
| 'rtp'
| 'se_bankgirot'
| 'sen'
| 'sepa'
| 'sic'
| 'signet'
| 'wire';
| 'wire'
| 'zengin';
}

export namespace ExpectedPayments {
Expand Down
16 changes: 13 additions & 3 deletions src/resources/external-accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,18 +454,21 @@ export namespace ExternalAccountCreateParams {
routing_number_type:
| 'aba'
| 'au_bsb'
| 'se_bankgiro_clearing_code'
| 'br_codigo'
| 'ca_cpa'
| 'chips'
| 'cnaps'
| 'gb_sort_code'
| 'in_ifsc'
| 'my_branch_code'
| 'swift';
| 'swift'
| 'jp_zengin_code';

payment_type?:
| 'ach'
| 'au_becs'
| 'se_bankgirot'
| 'bacs'
| 'book'
| 'card'
Expand All @@ -475,12 +478,15 @@ export namespace ExternalAccountCreateParams {
| 'interac'
| 'masav'
| 'neft'
| 'nics'
| 'provxchange'
| 'rtp'
| 'sen'
| 'sic'
| 'sepa'
| 'signet'
| 'wire';
| 'wire'
| 'zengin';
}
}

Expand Down Expand Up @@ -587,12 +593,16 @@ export interface ExternalAccountVerifyParams {
| 'interac'
| 'masav'
| 'neft'
| 'nics'
| 'provxchange'
| 'rtp'
| 'se_bankgirot'
| 'sen'
| 'sepa'
| 'sic'
| 'signet'
| 'wire';
| 'wire'
| 'zengin';

/**
* Defaults to the currency of the originating account.
Expand Down
2 changes: 2 additions & 0 deletions src/resources/incoming-payment-details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ export interface IncomingPaymentDetail {
| 'cnaps'
| 'gb_sort_code'
| 'in_ifsc'
| 'jp_zengin_code'
| 'my_branch_code'
| 'se_bankgiro_clearing_code'
| 'swift'
| null;

Expand Down
8 changes: 8 additions & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ export {
LedgerAccountsPage,
LedgerAccounts,
} from './ledger-accounts';
export {
LedgerAccountBalanceMonitor,
LedgerAccountBalanceMonitorCreateParams,
LedgerAccountBalanceMonitorUpdateParams,
LedgerAccountBalanceMonitorListParams,
LedgerAccountBalanceMonitorsPage,
LedgerAccountBalanceMonitors,
} from './ledger-account-balance-monitors';
export {
LedgerAccountCategory,
LedgerAccountCategoryCreateParams,
Expand Down
6 changes: 5 additions & 1 deletion src/resources/internal-accounts/internal-accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,16 @@ export interface InternalAccountListParams extends PageParams {
| 'interac'
| 'masav'
| 'neft'
| 'nics'
| 'provxchange'
| 'rtp'
| 'se_bankgirot'
| 'sen'
| 'sepa'
| 'sic'
| 'signet'
| 'wire';
| 'wire'
| 'zengin';
}

export namespace InternalAccounts {
Expand Down
Loading

0 comments on commit ce16952

Please sign in to comment.