apyhub
Back
▣ VERIFICATION KIT

Validate MENA VAT & Tax Number API

What it does

The VAT number validation API checks VAT and tax registration numbers from five countries. Send the number in value and the country in country, and get back valid, the cleaned-up number and the rule that was applied.

The supported countries are Saudi Arabia (SA), the UAE (AE), Egypt (EG), Bahrain (BH) and Oman (OM). Each country has its own rule. A Saudi VAT number has 15 digits and starts and ends with 3. A UAE TRN has 15 digits and starts with 100. An Egyptian tax registration number has 9 digits.

Spaces, dashes and Arabic-Indic digits are cleaned up first. Failed checks return valid: false with codes such as invalid_format, and the rule field explains what was expected.

Teams use the VAT number validation API on B2B checkout and invoicing forms, supplier onboarding and e-invoicing data checks.

This is a format check. It does not confirm that the number is registered with the tax authority.

For European VAT numbers, use the VAT Validation API. To check many numbers at once, use the Batch Validate MENA IDs API.

POST
VAT and Tax Number
https://api.eu.apyhub.com/odelyo/validate-mena-tax-number/tax-numbers

QUICKSTART

GUIDE

Quickstart

Validate a value for one of the supported MENA countries.

curl -X POST "https://api.eu.apyhub.com/odelyo/validate-mena-tax-number/tax-numbers" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"value":"300000000000003","country":"SA"}'

What you'll get back

Returns a JSON object with data (the validation result) and meta (request id and version). Below is the real response for the request above.

{
  "data": {
    "valid": true,
    "input": "300000000000003",
    "normalized": "300000000000003",
    "problems": [],
    "country": "SA",
    "rule": "Saudi VAT number: 15 digits, starts and ends with 3"
  },
  "meta": {
    "request_id": "req_b9040f38e912bed1",
    "version": "v1"
  }
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

About this endpoint

What it does

Validates a VAT or tax number for the specified country and returns a JSON object containing the validation result in data, along with optional response metadata in meta.

Request Body

ParameterTypeMandatoryDescription
valueStringYesThe VAT/tax number to validate. Length must be between 1 and 64 characters.
countryENUMYesCountry code for validation. Allowed values: SA, AE, EG, BH, OM.

Response

Returns a JSON object with a data object holding the validation result and a meta object with the request_id and API version. Invalid values still return 200 with valid: false and the reasons in problems. Requests with a missing or wrong-type field return 422 with an error object.

ParameterTypeDescription
dataObjectThe validation result.
data.validBooleantrue if the value passes all checks for its format.
data.inputStringThe value you sent.
data.normalizedStringThe value after cleanup: spaces and separators removed and Arabic-Indic digits converted to Latin digits.
data.problemsString ArrayProblem codes when the value is not valid, e.g. checksum_failed, must_be_14_digits. Empty when valid.
data.countryStringCountry of the tax number: SA, AE, EG, BH or OM.
data.ruleStringThe format rule that was checked, e.g. Saudi VAT number: 15 digits, starts and ends with 3.
metaObjectRequest details.
meta.request_idStringUnique id of this request, useful for support.
meta.versionStringAPI version, e.g. v1.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.