Message Validation

Complete semantic and structural validation for MT and MX messages. Prevent rejections before transmission with the same rule engine used in production by banks across 30+ countries.
Core Engine

ValidationEngine

A single entry point for validating any SWIFT message — MT or MX. Initialize the engine, pass a message, and receive a detailed list of validation problems with error codes, field references, and human-readable descriptions.

Validates MT messages from raw FIN strings or typed model objects
Validates MX messages from XML or typed model objects
Returns structured ValidationProblem list with error keys and descriptions
Built-in printout method for human-readable validation reports
Thread-safe — initialize once, validate concurrently
java
// Create the validation engine
ValidationEngine engine =
    new ValidationEngine();

// Validate an MT message from FIN string
List<ValidationProblem> r =
    engine.validateMtMessage(fin);

// Print human-readable results
System.out.println(
    ValidationProblem.printout(r));
MX Compliance

MX / ISO 20022 Validation

Cross-element and externalized ISO code validation for all MX message types and all versions. Includes CBPR+ schema and Usage Guideline validation out of the box, with an extendable API to inject custom schemas and custom UG validation modules.

Cross-element validation and externalized ISO code checking
CBPR+ schemas and Usage Guideline (UG) validation
Covers all MX message types, all versions
Validate from XML strings or typed MX model objects
Extendable API to inject custom schemas and custom UG validation modules
Updated with each yearly SRG release
java
// Build an MX pain.001 and validate
MxPain00100108 pain001 =
    new MxPain00100108();

CustomerCreditTransferInitiationV08 ccti =
  new CustomerCreditTransferInitiationV08()
    .setGrpHdr(new GroupHeader48()
        .setCtrlSum(new BigDecimal(100))
        .setMsgId("MYREF"))
    .addPmtInf(new PaymentInstruction22()
        .setDbtr(new PartyIdentification43()
            .setNm("foo")));

pain001.setCstmrCdtTrfInitn(ccti);

List<ValidationProblem> r =
    engine.validateMessage(pain001);
MT Compliance

MT Validation Rules

Complete implementation of SWIFT network validation rules for all MT message categories. Every semantic rule per message type is covered — from field format and qualifier constraints to conditional presence and cross-field dependencies.

All semantic rules per MT category (100-900 series)
Field format validation (character sets, length, structure)
Conditional presence rules (e.g., "if field 23B is CRED, then field 71A is mandatory")
Cross-field consistency checks (amounts, currencies, dates)
Sequence structure validation for complex MT types (5xx, 6xx)
SWIFT SCORE validation for MT798 subtypes (corporate-to-bank messaging)
Updated with each yearly SRG release
java
// Validate a typed MT103 object
MT103 m = new MT103();
m.setSender("FOOSEDR0AXXX");
m.setReceiver("FOORECV0XXXX");
m.addField(new Field20("REFERENCE"));
m.addField(new Field32A()
    .setDate(Calendar.getInstance())
    .setCurrency("USD"));
m.addField(new Field59A()
    .setIdentifierCode("ABCDZZXXXX"));

List<ValidationProblem> r =
    engine.validateMessage(m);
System.out.println(
    ValidationProblem.printout(r));
Extensibility

Custom Validation Rules

Inject your own business rules into the validation pipeline. Custom rules run after all standard SWIFT rules and have full access to the message model, allowing you to enforce institution-specific policies alongside network compliance.

Extend ValidationRule and override the eval method
Map custom rules to specific message types
Full access to the parsed message model for any check
Custom error keys and descriptions in the standard result format
Inject custom schemas and custom UG validation modules for MX
Combine with standard rules seamlessly — no forking
java
// Add custom rules to the engine
engine.getConfig().addCustomRule(
    "103", new MyRule());
engine.getConfig().addCustomRule(
    "103",
    new CustomAmountValidationRule(
        new BigDecimal("1000")));

// Custom rule implementation
public class MyRule
    extends ValidationRule {
  protected List<ValidationProblem>
      eval(SwiftMessage msg, String mt) {
    Tag ref = msg.getBlock4()
        .getTagByName("20");
    if (!ref.getValue()
            .startsWith("MYREF")) {
      result.add(new ValidationProblem(
          "BAD_REFERENCE",
          "must start with MYREF"));
    }
    return result;
  }
}
Response Generation

ACK / NAK Creation

Automatically generate SWIFT-compliant ACK and NAK response messages from validation results. Useful for middleware implementations that need to respond to message senders with standard acknowledgement or rejection messages.

Generate ACK for valid messages
Generate NAK with error code from the first validation problem
Configurable positioning (ACK before or after original message)
SWIFT-compliant response format
java
// Validate and generate ACK or NAK
List<ValidationProblem> r =
    engine.validateMessage(m);

if (r.isEmpty()) {
    String ack =
      SwiftMessageFactory.ACK(
        m.getSwiftMessage(),
        SwiftMessageFactory.Type.ACK,
        null,
        PositionOptions.ack_then_message);
} else {
    String nak =
      SwiftMessageFactory.ACK(
        m.getSwiftMessage(),
        SwiftMessageFactory.Type.NACK,
        r.get(0).getErrorKey(),
        PositionOptions.ack_then_message);
}
What the Engine Validates
Comprehensive coverage across all validation dimensions — from basic structure to complex business semantics.

Structure & Format

MT block structure, field ordering, tag presence, character sets, and line counts. MX syntax validation against XSD schemas. Full structural compliance for both standards.

Semantic Rules

MT conditional presence, qualifier constraints, and cross-field dependencies. MX cross-element checks and externalized ISO code validation. Full semantic coverage for both standards.

$

Date, Amount & IBAN

Date format validation, currency code verification against ISO 4217, amount consistency across related fields, decimal precision checks, and IBAN local format validation.

BIC Validation

BIC format validation and optional live lookup against the BIC directory for institution existence verification.

Sequence Validation

Mandatory and optional sequence ordering for complex MT types (535, 536, 548, 564, 566, etc.) with proper nesting verification.

Custom Rules & Schemas

Your own institution-specific validation logic, custom schemas, and custom Usage Guideline modules — injected into the standard pipeline alongside SWIFT network rules.

Validation Specifications

Capabilities

MT Coverage: All message types (100-900 series)
MX Coverage: All ISO 20022 message families
Rule Types: Structural, semantic, conditional, cross-field
Custom Rules: Java API for injecting institution-specific logic
ACK/NAK: Built-in response message generation

Integration

Dependency: Prowide Integrator SDK
Thread Safety: Initialize once, validate concurrently
Input: Raw FIN strings, typed MT/MX objects, or XML
Output: List<ValidationProblem> with error keys and descriptions
Updates: Yearly SRG releases aligned with SWIFT standards
Prevent message rejections
Validate before you transmit. Contact our team for trial access and pricing.