Skip to main content
Glama
alamedaim-apps

Authorize.net MCP Server

get_settled_batch_list

Retrieve settled payment batches within a specified date range to access batch IDs, settlement dates, and transaction statistics for reconciliation and reporting purposes.

Instructions

Get a list of settled batches within a date range. Returns batch IDs, settlement dates, and statistics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
firstSettlementDateNoStart date for the batch list (ISO 8601 format, e.g., 2024-01-01). Defaults to 30 days ago.
lastSettlementDateNoEnd date for the batch list (ISO 8601 format). Defaults to today.

Implementation Reference

  • The main handler function that executes the Authorize.Net API call to retrieve the list of settled batches within the specified date range using GetSettledBatchListController.
    async function getSettledBatchList(firstSettlementDate?: string, lastSettlementDate?: string) {
      const request = new ApiContracts.GetSettledBatchListRequest();
      request.setMerchantAuthentication(getMerchantAuth());
      request.setIncludeStatistics(true);
    
      if (firstSettlementDate) {
        request.setFirstSettlementDate(new Date(firstSettlementDate));
      }
      if (lastSettlementDate) {
        request.setLastSettlementDate(new Date(lastSettlementDate));
      }
    
      const ctrl = new ApiControllers.GetSettledBatchListController(request.getJSON());
      const response = await executeController(ctrl);
    
      const apiResponse = new ApiContracts.GetSettledBatchListResponse(response);
      if (apiResponse.getMessages().getResultCode() !== ApiContracts.MessageTypeEnum.OK) {
        const errors = apiResponse.getMessages().getMessage();
        throw new Error(`API Error: ${errors[0].getCode()} - ${errors[0].getText()}`);
      }
    
      return apiResponse.getBatchList() || [];
    }
  • src/index.ts:200-216 (registration)
    Registration of the tool in the MCP server's ListToolsRequestSchema handler, including name, description, and input schema definition.
    {
      name: "get_settled_batch_list",
      description: "Get a list of settled batches within a date range. Returns batch IDs, settlement dates, and statistics.",
      inputSchema: {
        type: "object",
        properties: {
          firstSettlementDate: {
            type: "string",
            description: "Start date for the batch list (ISO 8601 format, e.g., 2024-01-01). Defaults to 30 days ago.",
          },
          lastSettlementDate: {
            type: "string",
            description: "End date for the batch list (ISO 8601 format). Defaults to today.",
          },
        },
      },
    },
  • src/index.ts:301-306 (registration)
    Dispatch to the getSettledBatchList handler within the MCP server's CallToolRequestSchema handler.
    case "get_settled_batch_list":
      result = await getSettledBatchList(
        args?.firstSettlementDate as string | undefined,
        args?.lastSettlementDate as string | undefined
      );
      break;
  • Input schema definition for the get_settled_batch_list tool.
    inputSchema: {
      type: "object",
      properties: {
        firstSettlementDate: {
          type: "string",
          description: "Start date for the batch list (ISO 8601 format, e.g., 2024-01-01). Defaults to 30 days ago.",
        },
        lastSettlementDate: {
          type: "string",
          description: "End date for the batch list (ISO 8601 format). Defaults to today.",
        },
      },
    },
  • Helper function used by the handler to execute Authorize.Net API controllers asynchronously.
    function executeController(ctrl: any): Promise<any> {
      return new Promise((resolve, reject) => {
        if (ENVIRONMENT === "production") {
          ctrl.setEnvironment(SDKConstants.endpoint.production);
        }
        ctrl.execute(() => {
          const response = ctrl.getResponse();
          if (response === null) {
            reject(new Error(ctrl.getErrorResponse() || "No response from API"));
          } else {
            resolve(response);
          }
        });
      });
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alamedaim-apps/authnet-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server