- "## create\n\n`client.internalAccounts.create(connection_id: string, currency: 'USD' | 'CAD' | 'USDC' | 'USDG' | 'USDT' | 'PYUSD', name: string, account_capabilities?: { id: string; created_at: string; direction: 'credit' | 'debit'; discarded_at: string; identifier: string; live_mode: boolean; object: string; payment_type: string; updated_at: string; }[], account_type?: string, counterparty_id?: string, debitable?: boolean, external_id?: string, legal_entity_id?: string, metadata?: object, parent_account_id?: string, party_address?: { country: string; line1: string; locality: string; postal_code: string; region: string; line2?: string; }, party_name?: string, vendor_attributes?: object): { id: string; account_capabilities: object[]; account_details: account_detail[]; account_type: string; connection: connection; contra_ledger_account_id: string; counterparty_id: string; created_at: string; currency: currency; debitable: boolean; external_id: string; ledger_account_id: string; legal_entity_id: string; live_mode: boolean; metadata: object; name: string; object: string; parent_account_id: string; party_address: address; party_name: string; party_type: 'business' | 'individual'; routing_details: routing_detail[]; status: 'active' | 'closed' | 'pending_activation' | 'pending_closure' | 'suspended'; updated_at: string; vendor_id: string; }`\n\n**post** `/api/internal_accounts`\n\ncreate internal account\n\n### Parameters\n\n- `connection_id: string`\n The identifier of the financial institution the account belongs to.\n\n- `currency: 'USD' | 'CAD' | 'USDC' | 'USDG' | 'USDT' | 'PYUSD'`\n The currency of the internal account. Supports fiat and stablecoin currencies.\n\n- `name: string`\n The nickname of the account.\n\n- `account_capabilities?: { id: string; created_at: string; direction: 'credit' | 'debit'; discarded_at: string; identifier: string; live_mode: boolean; object: string; payment_type: string; updated_at: string; }[]`\n An array of AccountCapability objects that list the originating abilities of the internal account and any relevant information for them.\n\n- `account_type?: string`\n The account type, used to provision the appropriate account at the financial institution.\n\n- `counterparty_id?: string`\n The Counterparty associated to this account.\n\n- `debitable?: boolean`\n Whether this account can receive ACH debits. Only applicable to accounts created under a Modern Treasury PSP connection, or `null` for Bring Your Own Bank accounts. Defaults to `false`. Configurable only on creation. Please reach out to your customer success manager to enable this capability for your connection.\n\n- `external_id?: string`\n An optional user-defined 180 character unique identifier.\n\n- `legal_entity_id?: string`\n The LegalEntity associated to this account.\n\n- `metadata?: object`\n Additional data represented as key-value pairs. Both the key and value must be strings.\n\n- `parent_account_id?: string`\n The parent internal account of this new account.\n\n- `party_address?: { country: string; line1: string; locality: string; postal_code: string; region: string; line2?: string; }`\n The address associated with the owner or null.\n - `country: string`\n Country code conforms to [ISO 3166-1 alpha-2]\n - `line1: string`\n - `locality: string`\n Locality or City.\n - `postal_code: string`\n The postal code of the address.\n - `region: string`\n Region or State.\n - `line2?: string`\n\n- `party_name?: string`\n The legal name of the entity which owns the account.\n\n- `vendor_attributes?: object`\n A hash of vendor specific attributes that will be used when creating the account at the vendor specified by the given connection.\n\n### Returns\n\n- `{ id: string; account_capabilities: { id: string; created_at: string; direction: 'credit' | 'debit'; discarded_at: string; identifier: string; live_mode: boolean; object: string; payment_type: string; updated_at: string; }[]; account_details: { id: string; account_number_safe: string; account_number_type: string; created_at: string; discarded_at: string; live_mode: boolean; object: string; updated_at: string; account_number?: string; }[]; account_type: string; connection: { id: string; created_at: string; discarded_at: string; live_mode: boolean; object: string; updated_at: string; vendor_customer_id: string; vendor_id: string; vendor_name: string; }; contra_ledger_account_id: string; counterparty_id: string; created_at: string; currency: string; debitable: boolean; external_id: string; ledger_account_id: string; legal_entity_id: string; live_mode: boolean; metadata: object; name: string; object: string; parent_account_id: string; party_address: { id: string; country: string; created_at: string; line1: string; line2: string; live_mode: boolean; locality: string; object: string; postal_code: string; region: string; updated_at: string; }; party_name: string; party_type: 'business' | 'individual'; routing_details: { id: string; bank_address: address; bank_name: string; created_at: string; discarded_at: string; live_mode: boolean; object: string; payment_type: string; routing_number: string; routing_number_type: string; updated_at: string; }[]; status: 'active' | 'closed' | 'pending_activation' | 'pending_closure' | 'suspended'; updated_at: string; vendor_id: string; }`\n\n - `id: string`\n - `account_capabilities: { id: string; created_at: string; direction: 'credit' | 'debit'; discarded_at: string; identifier: string; live_mode: boolean; object: string; payment_type: string; updated_at: string; }[]`\n - `account_details: { id: string; account_number_safe: string; account_number_type: string; created_at: string; discarded_at: string; live_mode: boolean; object: string; updated_at: string; account_number?: string; }[]`\n - `account_type: string`\n - `connection: { id: string; created_at: string; discarded_at: string; live_mode: boolean; object: string; updated_at: string; vendor_customer_id: string; vendor_id: string; vendor_name: string; }`\n - `contra_ledger_account_id: string`\n - `counterparty_id: string`\n - `created_at: string`\n - `currency: string`\n - `debitable: boolean`\n - `external_id: string`\n - `ledger_account_id: string`\n - `legal_entity_id: string`\n - `live_mode: boolean`\n - `metadata: object`\n - `name: string`\n - `object: string`\n - `parent_account_id: string`\n - `party_address: { id: string; country: string; created_at: string; line1: string; line2: string; live_mode: boolean; locality: string; object: string; postal_code: string; region: string; updated_at: string; }`\n - `party_name: string`\n - `party_type: 'business' | 'individual'`\n - `routing_details: { id: string; bank_address: { id: string; country: string; created_at: string; line1: string; line2: string; live_mode: boolean; locality: string; object: string; postal_code: string; region: string; updated_at: string; }; bank_name: string; created_at: string; discarded_at: string; live_mode: boolean; object: string; payment_type: string; routing_number: string; routing_number_type: string; updated_at: string; }[]`\n - `status: 'active' | 'closed' | 'pending_activation' | 'pending_closure' | 'suspended'`\n - `updated_at: string`\n - `vendor_id: string`\n\n### Example\n\n```typescript\nimport ModernTreasury from 'modern-treasury';\n\nconst client = new ModernTreasury();\n\nconst internalAccount = await client.internalAccounts.create({\n connection_id: 'connection_id',\n currency: 'USD',\n name: 'name',\n});\n\nconsole.log(internalAccount);\n```",
0 commit comments