Skip to content

Add Oman VAT number (VATIN) validation - #505

Closed
DMZ22 wants to merge 1 commit into
arthurdejong:masterfrom
DMZ22:add-om-vat
Closed

Add Oman VAT number (VATIN) validation#505
DMZ22 wants to merge 1 commit into
arthurdejong:masterfrom
DMZ22:add-om-vat

Conversation

@DMZ22

@DMZ22 DMZ22 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Partially addresses #408 by adding the Oman VATIN — the VAT/Excise form of the Oman TIN, which is the one with a defined structure.

Format

  • Name: VATIN (VAT identification number), issued by the Oman Tax Authority.
  • Structure: the letters OM followed by 10 digits — 12 characters in total.
  • No check digit. Numbers are verified online via the tax authority portal, so this module validates length and formatting only (in the spirit of e.g. stdnum/gh/tin.py, which is also structural).

Sources / validation service

Tests

  • Module docstring covers valid input, whitespace/lowercase normalisation, missing prefix, wrong length and non-digit tail.
  • tests/test_om_vat.doctest bulk-validates real numbers taken from published Omani VAT certificates (e.g. OM1100006083, OM1100018164, OM1100005523). Every line of the module is exercised.

Note

The #408 issue also mentions a 7-digit "tax card number" for entities. I left that out: it's an unstructured all-digit sequence with no fixed length constraint or check digit, so validating it adds little (per CONTRIBUTING's guidance on numbers whose only spec is "N digits"). Happy to add it, or to fold both into an om/tin.py, if you'd prefer.

The Oman VAT identification number (VATIN), issued by the Oman Tax
Authority, consists of the letters OM followed by 10 digits (12 characters
in total). It has no check digit and is verified online through the tax
authority portal, so this validates length and formatting.

Partially addresses arthurdejong#408 (the VAT/VATIN form; the 7-digit entity "tax card
number" is an unstructured all-digit sequence for which format validation
adds little value).
@arthurdejong

Copy link
Copy Markdown
Owner

Hi @DMZ22,

Thanks for contributing this. The changes were merged as 9f1bc4a. The only significant change I made was to ensure that numbers that end with X are also supported (they were found "in the wild" and confirmed to be valid via the validation service).

That triggered me to reverse engineer the check digit algorithm in 23be163. I did not manage to find weights for the first 4 digits (after OM) as there was insufficient variation there but this algorithm works for all the valid numbers I managed to find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants