Skip to content
masterclass Buddy

Pydantic · Type Alias

PaymentCardNumber

PaymentCardNumber validates payment card numbers as strings. It checks digits, length, the Luhn algorithm, and brand-specific length rules, then exposes useful details such as the brand and last four digits.

Last updated

Syntax

class PaymentCardNumber(str)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • PaymentCardBrand
  • PaymentCardNumber
  • pydantic_extra_types.payment

Source: Payment | Pydantic Docs. Checked 2026-11-03.