Financial & Banking Data

The most complete validation tool for the Iranian banking network. Validates cards, IBANs, and extracts bank logos and brand colors.

Zod Integration

You can validate Card and Sheba separately, but with zFinancial, users can dynamically input either into a single field!

schema.ts
typescript
import * as z from 'zod';
import { zCardNumber, zSheba, zFinancial } from 'zod-ir';

const PaymentSchema = z.object({
  card: zCardNumber({ message: 'شماره کارت نامعتبر است' }),
  
  iban: zSheba(),
  
  destination: zFinancial({ message: 'مقصد وارد شده اشتباه است' })
});

Metadata Extraction (Standalone)

With extraction functions, you don't need a banking database. Name, logo, color, and format are returned instantly.

metadata.ts
typescript
import { getBankInfo, getFinancialInfo } from 'zod-ir';

const bank = getBankInfo('6219861012345678');
console.log(bank.name);
console.log(bank.color);

const info = getFinancialInfo('IR120170000000123456789012');
if (info.isValid) {
  console.log(info.type);
  console.log(info.bank.label);
}