/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { bankAccountsInitiateVerification } from "../../funcs/bankAccountsInitiateVerification.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.InitiateBankAccountVerificationRequest$inboundSchema, }; export const tool$bankAccountsInitiateVerification: ToolDefinition< typeof args > = { name: "bank-accounts-initiate-verification", description: `Instant micro-deposit verification offers a quick and efficient way to verify bank account ownership. Send a $0.01 credit with a unique verification code via RTP, FedNow, or same-day ACH, depending on the receiving bank's capabilities. This feature provides a faster alternative to traditional methods, allowing verification in a single session. It is recommended to use the \`X-Wait-For: rail-response\` header to synchronously receive the outcome of the instant credit in the response payload. Possible verification methods: - \`instant\`: Real-time verification credit sent via RTP or FedNow - \`ach\`: Verification credit sent via same-day ACH Possible statuses: - \`new\`: Verification initiated, credit pending - \`sent-credit\`: Credit sent, available for verification in the external bank account - \`failed\`: Verification failed due to credit rejection/return, details in \`exceptionDetails\` To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need to specify the \`/accounts/{accountID}/bank-accounts.write\` scope.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await bankAccountsInitiateVerification( 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); }, };