Validate VAT number

GET /validators/vat/{entity_type}

Check if a VAT number exists in the specified entity type (distributors, resellers, customers)

Path parameters

  • entity_type string Required

    Type of entity to check VAT against

    Values are distributors, resellers, or customers.

Query parameters

  • vat string Required

    VAT number to validate

  • exclude_id string

    Entity ID to exclude from check (useful for updates)

Responses

  • 200 application/json

    VAT validation completed successfully

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object
      Hide data attribute Show data attribute object
      • exists boolean

        Whether the VAT number exists in the specified entity type

  • 400 application/json

    Bad request - validation error

    Hide response attributes Show response attributes object
    • code integer

      HTTP error code

    • message string

      Error message

    • data object
      Hide data attributes Show data attributes object
      • type string

        Type of error

        Values are validation_error or external_api_error.

      • errors array[object]
        Hide errors attributes Show errors attributes object
        • key string

          Field name that failed validation

        • message string

          Error code or message

        • value string

          Value that failed validation

      • details

        Additional error details

  • 401 application/json

    Unauthorized - invalid or missing token

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
  • 500 application/json

    Internal server error

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
GET /validators/vat/{entity_type}
curl \
 --request GET 'https://api.your-domain.com/api/validators/vat/customers?vat=12345678901' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "code": 200,
  "message": "VAT validation completed",
  "data": {
    "exists": true
  }
}
Response examples (400)
{
  "code": 400,
  "message": "validation failed",
  "data": {
    "type": "validation_error",
    "errors": [
      {
        "key": "username",
        "message": "required",
        "value": "string"
      }
    ]
  }
}
Response examples (401)
{
  "code": 401,
  "message": "invalid token",
  "data": {}
}
Response examples (500)
{
  "code": 500,
  "message": "internal server error",
  "data": {}
}