DEV Community

Olly
Olly

Posted on

One API for checkout form validation: IBAN, EU VAT, card numbers, postcodes

Every checkout or KYC form ends up re-implementing the same checksums: IBAN mod-97, the Luhn check for cards, a different VAT algorithm for each EU country, and postcode regexes. I bundled them behind one small API so the frontend can call a single endpoint.

Example: validate an IBAN before payout

const res = await fetch(
  "https://validkit-iban-vat-card-isbn-bic-postcode-validator.p.rapidapi.com/iban?value=GB82WEST12345698765432",
  { headers: { "X-RapidAPI-Key": KEY,
               "X-RapidAPI-Host": "validkit-iban-vat-card-isbn-bic-postcode-validator.p.rapidapi.com" } });
console.log(await res.json());
// { valid: true, formatted: "GB82 WEST 1234 5698 7654 32", country: "GB" }
Enter fullscreen mode Exit fullscreen mode

Endpoints

Endpoint Checks
/iban mod-97 checksum, country length, pretty format
/vat EU VAT checksum per country (DE, FR, IT, ES, NL…)
/card Luhn + brand (Visa, Mastercard, Amex…), returns masked number
/bic SWIFT/BIC structure
/isbn, /ean book & barcode check digits, ISBN-10→13
/postcode 24 countries, normalises bs31dh → BS3 1DH

Note: /vat checks the format and checksum, not live VIES registration. It catches typos before you make the slow VIES call.

Free tier: 200 calls/month. ValidKit on RapidAPI

Top comments (0)