{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/fis/main/json-schema/fis-ach-batch-request-schema.json",
  "title": "AchBatchRequest",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fis-ach-api-openapi.yml#/components/schemas/AchBatchRequest",
  "type": "object",
  "required": [
    "companyName",
    "companyId",
    "transactions"
  ],
  "properties": {
    "companyName": {
      "type": "string",
      "maxLength": 16
    },
    "companyId": {
      "type": "string",
      "maxLength": 10
    },
    "entryClassCode": {
      "type": "string",
      "enum": [
        "PPD",
        "CCD",
        "CTX",
        "WEB",
        "TEL"
      ]
    },
    "description": {
      "type": "string",
      "maxLength": 10
    },
    "effectiveDate": {
      "type": "string",
      "format": "date"
    },
    "transactions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AchTransferRequest"
      },
      "maxItems": 10000
    }
  },
  "$defs": {
    "AccountReference": {
      "type": "object",
      "required": [
        "accountNumber",
        "routingNumber"
      ],
      "properties": {
        "accountNumber": {
          "type": "string",
          "description": "Bank account number"
        },
        "routingNumber": {
          "type": "string",
          "pattern": "^\\d{9}$",
          "description": "ABA routing transit number (9 digits)"
        },
        "accountType": {
          "type": "string",
          "enum": [
            "CHECKING",
            "SAVINGS",
            "LOAN"
          ]
        },
        "accountHolderName": {
          "type": "string"
        },
        "bankName": {
          "type": "string"
        },
        "swiftCode": {
          "type": "string",
          "description": "SWIFT/BIC code for international wires"
        }
      }
    },
    "AchTransferRequest": {
      "type": "object",
      "required": [
        "amount",
        "entryClassCode",
        "transactionType",
        "debtorAccount",
        "creditorAccount"
      ],
      "properties": {
        "amount": {
          "type": "number",
          "format": "double",
          "minimum": 0.01
        },
        "entryClassCode": {
          "type": "string",
          "enum": [
            "PPD",
            "CCD",
            "CTX",
            "WEB",
            "TEL",
            "ARC",
            "BOC",
            "POP",
            "RCK"
          ],
          "description": "NACHA Standard Entry Class code"
        },
        "transactionType": {
          "type": "string",
          "enum": [
            "CREDIT",
            "DEBIT"
          ]
        },
        "debtorAccount": {
          "$ref": "#/$defs/AccountReference"
        },
        "creditorAccount": {
          "$ref": "#/$defs/AccountReference"
        },
        "description": {
          "type": "string",
          "maxLength": 10,
          "description": "Company entry description (appears on bank statement)"
        },
        "effectiveDate": {
          "type": "string",
          "format": "date"
        },
        "sameDayAch": {
          "type": "boolean",
          "default": false
        }
      }
    }
  }
}