PHP code example of firebed / vat-registry

1. Go to this page and download the library: Download firebed/vat-registry library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

firebed / vat-registry example snippets


use Firebed\VatRegistry\TaxisNet;
use Firebed\VatRegistry\VatException;

$username = 'your-username';
$password = 'your-password';

$taxis = new TaxisNet($username, $password);

try {
    $entity = $taxis->handle('094014201');
    
    print_r($entity);
} catch (VatException $exception) {
    echo "Σφάλμα: " . $exception->getMessage();
}

Firebed\VatRegistry\VatEntity {
  +vatNumber: "094014201"
  +taxAuthorityId: "1159"
  +taxAuthorityName: "ΦΑΕ ΑΘΗΝΩΝ"
  +flagDescription: "ΜΗ ΦΠ"
  +valid: true
  +validityDescription: "ΕΝΕΡΓΟΣ ΑΦΜ"
  +firmFlagDescription: "ΕΠΙΤΗΔΕΥΜΑΤΙΑΣ"
  +legalName: "ΤΡΑΠΕΖΑ ΕΘΝΙΚΗ ΤΗΣ ΕΛΛΑΔΟΣ ΑΝΩΝΥΜΗ ΕΤΑΙΡΕΙΑ"
  +commerceTitle: ""
  +legalStatusDescription: "ΑΕ"
  +street: "ΑΙΟΛΟΥ"
  +streetNumber: "86"
  +postcode: "10559"
  +city: "ΑΘΗΝΑ"
  +registrationDate: "1900-01-01"
  +stopDate: ""
  +normalVat: true
  +firms: array:2 [
    0 => array:4 [
      "code" => "64191204"
      "description" => "ΥΠΗΡΕΣΙΕΣ ΤΡΑΠΕΖΩΝ"
      "kind" => "1"
      "kindDescription" => "ΚΥΡΙΑ"
    ]
    1 => array:4 [
      "code" => "66221001"
      "description" => "ΥΠΗΡΕΣΙΕΣ ΑΣΦΑΛΙΣΤΙΚΟΥ ΠΡΑΚΤΟΡΑ ΚΑΙ ΑΣΦΑΛΙΣΤΙΚΟΥ ΣΥΜΒΟΥΛΟΥ"
      "kind" => "2"
      "kindDescription" => "ΔΕΥΤΕΡΕΥΟΥΣΑ"
    ]
  ]
}

use Firebed\VatRegistry\VIES;
use Firebed\VatRegistry\VatException;

$taxis = new VIES();

try {
    $entity = $taxis->handle('EL', '094014201');
    
    print_r($entity);
} catch (VatException $exception) {
    echo "Σφάλμα: " . $exception->getMessage();
}

Firebed\VatRegistry\VatEntity {
  +vatNumber: "094014201"
  +taxAuthorityId: null
  +taxAuthorityName: null
  +flagDescription: null
  +valid: true
  +validityDescription: null
  +firmflagDescription: null
  +legalName: "ΤΡΑΠΕΖΑ ΕΘΝΙΚΗ ΤΗΣ ΕΛΛΑΔΟΣ ΑΝΩΝΥΜΗ ΕΤΑΙΡΕΙΑ"
  +commerceTitle: null
  +legalStatusDescription: null
  +street: "ΑΙΟΛΟΥ"
  +streetNumber: "86"
  +postcode: "10559"
  +city: "ΑΘΗΝΑ"
  +registrationDate: null
  +stopDate: null
  +normalVat: null
  +firms: []
}

$entity->isNaturalPerson();
$entity->isCompany();

// Επιστρέφει true αν η επιχείρηση είναι ενεργή
// Επιστρέφει false αν η επιχείρηση έχει διακοπεί
$entity->isActive();