Skip to main content

Quick Start

Validation Rules

MTI Validation

  • Must be exactly 4 digits
  • First digit: ISO version (0, 1, 2)
  • Second digit: Message class (1-8)
  • Third digit: Message function (0-4, 8, 9)
  • Fourth digit: Message origin (0-5)

Field Type Validation

Field Length Validation

Network-Specific Validation

When network is specified, validates required fields:
Network Required Fields:

Checking Against Other Networks

validate_for_network checks a message against another network’s rules without changing it. validate_for_networks checks several at once, or every network when you pass no list:

PAN Validation

Luhn checksum validation for Field 2:

Single Field Validation

Validation Examples

Valid Authorization Request

Invalid Message Examples

Cython Acceleration

Validation functions have Cython optimizations: Detection is automatic when Cython extensions are compiled.

API Reference

See Core API Reference for complete API documentation.