/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { accountsCreate } from "../../funcs/accountsCreate.js"; import * as components from "../../models/components/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: components.CreateAccount$inboundSchema, }; export const tool$accountsCreate: ToolDefinition = { name: "accounts-create", description: `You can create **business** or **individual** accounts for your users (i.e., customers, merchants) by passing the required information to Moov. Requirements differ per account type and requested [capabilities](https://docs.moov.io/guides/accounts/capabilities/requirements/). If you're requesting the \`wallet\`, \`send-funds\`, \`collect-funds\`, or \`card-issuing\` capabilities, you'll need to: + Send Moov the user [platform terms of service agreement](https://docs.moov.io/guides/accounts/requirements/platform-agreement/) acceptance. This can be done upon account creation, or by [patching](https://docs.moov.io/api/moov-accounts/accounts/patch/) the account using the \`termsOfService\` field. If you're creating a business account with the business type \`llc\`, \`partnership\`, or \`privateCorporation\`, you'll need to: + Provide [business representatives](https://docs.moov.io/api/moov-accounts/representatives/) after creating the account. + [Patch](https://docs.moov.io/api/moov-accounts/accounts/patch/) the account to indicate that business representative ownership information is complete. Visit our documentation to read more about [creating accounts](https://docs.moov.io/guides/accounts/create-accounts/) and [verification requirements](https://docs.moov.io/guides/accounts/requirements/identity-verification/). Note that the \`mode\` field (for production or sandbox) is only required when creating a _facilitator_ account. All non-facilitator account requests will ignore the mode field and be set to the calling facilitator's mode. To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need to specify the \`/accounts.write\` scope.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await accountsCreate( client, args.request, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); if (!result.ok) { return { content: [{ type: "text", text: result.error.message }], isError: true, }; } const value = result.value.result; return formatResult(value, apiCall); }, };