Download the PHP package aade/afm-lookup without Composer
On this page you can find all versions of the php package aade/afm-lookup. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package afm-lookup
AADE AFM Lookup
PHP library for querying Greek VAT (AFM) numbers via AADE's official SOAP service.
Quick Start
Note: You need AADE credentials. Register here.
Table of Contents
- Requirements
- Installation
- Usage Guide
- Creating a Client
- Looking Up an AFM
- Validating AFM Format
- Historical Lookups
- Business Activities
- Error Handling
- API Reference
- AadeClient
- Response Objects
- AADE Error Codes
- License
Requirements
| Requirement | Version |
|---|---|
| PHP | >= 8.1 |
| ext-soap | * |
| ext-dom | * |
Installation
Usage Guide
Creating a Client
Basic:
With options:
Looking Up an AFM
Validating AFM Format
Validate locally before making an API call:
Historical Lookups
Query business information as it was on a specific date:
Date format: The library accepts any
DateTimeInterfaceimplementation. Internally, dates are sent to AADE inY-m-dformat (e.g.,2023-01-15).
Business Activities
Each business can have multiple registered activities (KAD codes):
Error Handling
Checking error types via ErrorCode:
API Reference
AadeClient
| Method | Returns | Description |
|---|---|---|
getVatInfo(string $afm, ?DateTimeInterface $asOnDate = null) |
AfmInfoResponse |
Query AFM information |
getVersion() |
string |
Get AADE service version |
validateAfm(string $afm) |
bool |
Validate AFM format (static) |
Response Objects
AfmInfoResponse
| Property | Type | Description |
|---|---|---|
success |
bool |
true if lookup succeeded |
callSequenceId |
?string |
AADE call tracking ID |
basic |
?BasicInfo |
Business information |
firmActivities |
FirmActivity[] |
List of activities |
error |
?ErrorInfo |
Error details (if failed) |
| Method | Returns | Description |
|---|---|---|
getMainActivity() |
?FirmActivity |
Get primary business activity |
BasicInfo
| Property | Type | Description |
|---|---|---|
afm |
?string |
VAT number |
name |
?string |
Legal business name |
commercialTitle |
?string |
Commercial/trade name |
doyCode |
?string |
Tax office code |
doyDescription |
?string |
Tax office name |
legalStatusCode |
?string |
Legal form code |
legalStatusDescription |
?string |
Legal form (ΑΕ, ΕΠΕ, etc.) |
postalAddress |
?string |
Street name |
postalAddressNumber |
?string |
Street number |
postalZipCode |
?string |
Postal code |
postalCity |
?string |
City |
registrationDate |
?DateTimeImmutable |
Registration date |
stopDate |
?DateTimeImmutable |
Deactivation date |
isNormalVat |
bool |
Normal VAT regime |
isActive |
bool |
Currently active |
FirmActivity
| Property | Type | Description |
|---|---|---|
code |
?string |
KAD activity code |
description |
?string |
Activity description |
kind |
?int |
1 = main, 2+ = secondary |
kindDescription |
?string |
Kind label |
| Method | Returns | Description |
|---|---|---|
isMainActivity() |
bool |
Check if primary activity |
ErrorInfo
| Property | Type | Description |
|---|---|---|
code |
?ErrorCode |
Error code enum |
description |
?string |
Error message from AADE |
AADE Error Codes
| Code | Description | Exception Type |
|---|---|---|
RG_WS_PUBLIC_TOKEN_USERNAME_NOT_AUTHENTICATED |
Invalid credentials | AuthenticationException |
RG_WS_PUBLIC_TOKEN_USERNAME_NOT_DEFINED |
Username missing | AuthenticationException |
RG_WS_PUBLIC_TOKEN_USERNAME_NOT_ACTIVE |
Account inactive | AuthenticationException |
RG_WS_PUBLIC_TOKEN_AFM_NOT_AUTHORIZED |
AFM not authorized | AuthenticationException |
RG_WS_PUBLIC_MAX_DAILY_CALLS_EXCEEDED |
Daily limit reached | RateLimitException |
RG_WS_PUBLIC_MAX_DAILY_USERNAME_CALLS_EXCEEDED |
User daily limit | RateLimitException |
RG_WS_PUBLIC_EPIT_NF |
AFM not found | AadeException |
RG_WS_PUBLIC_WRONG_AFM |
Invalid AFM | InvalidAfmException |
RG_WS_PUBLIC_AFM_CALLED_BY_BLOCKED |
Caller AFM blocked | AadeException |
RG_WS_PUBLIC_SERVICE_NOT_ACTIVE |
Service unavailable | AadeException |
See ErrorCode.php for the complete list.
License
MIT License. See LICENSE for details.
All versions of afm-lookup with dependencies
ext-soap Version *
ext-dom Version *