firebed / aade-mydata
Implementation of requests for AADE myDATA.
Requires
- php: ^8.1
- ext-dom: *
- ext-libxml: *
- guzzlehttp/guzzle: ^7.0.1
Requires (Dev)
- fakerphp/faker: ^1.23
- phpunit/phpunit: ^10.0
- roave/security-advisories: dev-latest
- symfony/var-dumper: ^6.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- 5.x-dev
- v5.12.0
- v5.11.0
- v5.10.4
- v5.10.3
- v5.10.2
- v5.10.1
- v5.10.0
- v5.9.1
- v5.9.0
- v5.8.1
- v5.8.0
- v5.7.0
- v5.6.4
- v5.6.3
- v5.6.2
- v5.6.1
- v5.6.0
- v5.5.6
- v5.5.5
- v5.5.4
- v5.5.3
- v5.5.2
- v5.5.1
- v5.5.0
- v5.4.1
- v5.4.0
- v5.3.0
- v5.2.5
- v5.2.4
- v5.2.3
- v5.2.2
- v5.2.1
- v5.2.0
- v5.1.4
- v5.1.3
- v5.1.2
- 5.1.1
- v5.1.0
- 5.0.4
- v5.0.3
- v5.0.2
- v5.0.1
- v5.0.0
- 4.x-dev
- v4.0.7
- v4.0.6
- 4.0.5
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- 3.x-dev
- v3.1.6
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.2
- v3.0.1
- v3.0.0
- 2.x-dev
- v2.0.1
- v2.0.0
- v1.0.1
- v1.0.0
- dev-master
- dev-refactor-enums
This package is auto-updated.
Last update: 2026-09-12 14:57:35 UTC
README
Support This Project
If you find this project useful, you can show your appreciation and support by giving it a ⭐. Your support motivates us to work harder and make even better and more useful tools!
Introduction
This package provides an expressive, fluent interface to ΑΑΔΕ myDATA invoicing REST API. It handles all the boilerplate code for sending, cancelling and requesting invoices.
Documentation
- Official documentation is available 👉 on our documentation site
- myDATA webpage: AADE myDATA
- ERP myDATA documentation (PDF): AADE ERP myDATA REST API v2.0.2
- Provider myDATA documentation (PDF): AADE Provider myDATA REST API v2.0.2
Requirements
To use this package, you will need first a aade id and a Subscription key. You can get these credentials by signing up to mydata rest api.
- Development: Sign up to mydata development api
- Production: Sign up to mydata production api
- guzzlehttp/guzzle >= 7.0
| Version | PHP | myDATA | Support |
|---|---|---|---|
| ^v5.x | 8.1 | v2.0.2 | Active |
| ^v5.x | 8.1 | v2.0.1 | Ended |
| ^v5.x | 8.1 | v1.0.12 | Ended |
| ^v4.x | 8.1 | v1.0.8 | Ended |
| ^v3.x | 8.1 | v1.0.7 | Ended |
| ^v2.x | 8.1 | v1.0.5 | Ended |
| ^v1.x | 8.0 | v1.0.3 | Ended |
Installation
To install through Composer, run the following command:
composer require firebed/aade-mydata
Setup
Once you have the user id and the subscription key, use the following code to set the environment and the credentials:
$env = "dev"; // For production use "prod" $user_id = "your-user-id"; $subscription_key = "your-subscription-key"; MyDataRequest::setEnvironment($env); MyDataRequest::setCredentials($user_id, $subscription_key);
For development, you may need to disable client verification if you are not using https:
MyDataRequest::verifyClient(false);
Transmitting through a provider (Gateway)
ΑΑΔΕ is retiring the ERP transmission channel: invoices have to be transmitted through a
licensed e-invoicing provider. Since 5.11 every request travels through a Gateway, so you
can switch the transport without changing the code that builds and sends your invoices.
To transmit through the Oxygen provider, install the ready-made gateway, oxygensuite/aade-mydata-oxygen, and register your provider token next to your existing setup:
composer require oxygensuite/aade-mydata-oxygen
use Firebed\AadeMyData\Http\MyDataRequest; use OxygenSuite\AadeMyData\OxygenProvider; // Your AADE setup stays: the requests that remain on the ERP channel still use it. MyDataRequest::setEnvironment($env); MyDataRequest::setCredentials($user_id, $subscription_key); // From now on SendInvoices, CancelInvoice and SendPaymentsMethod go through the provider. OxygenProvider::register(token: 'your-company-api-token');
Everything else — requesting documents, classifications, and so on — keeps talking to
ΑΑΔΕ directly. The bridge's README documents what is routed, the responses you get back,
and the attributes a provider needs that myDATA has no field for: the issue time
(setIssueTime(), required), the unit price (setUnitPrice()), the line discount
(setDiscount()) and free extra fields.
To write a gateway for another provider, see Custom gateway.
Send invoice example
use Firebed\AadeMyData\Http\SendInvoices; use Firebed\AadeMyData\Models\Invoice; use Firebed\AadeMyData\Exceptions\MyDataException; // Prepare your invoices, for simplicity we will use an array of empty // Invoice objects. You should populate these objects with your own data. $invoices = [new Invoice(), new Invoice()]; $sender = new SendInvoices(); try { $responses = $sender->handle($invoices); $errors = []; foreach ($responses as $response) { if ($response->isSuccessful()) { // This invoice was successfully sent to myDATA. // Each response has an index value which corresponds // to the index (-1) of the $invoices array. $index = $response->getIndex(); $uid = $response->getInvoiceUid(); $mark = $response->getInvoiceMark(); $cancelledByMark = $response->getCancellationMark(); $qrUrl = $response->getQrUrl(); // If you need to relate the response to your local invoice // $invoice = $invoices[$index - 1]; print_r(compact('index', 'uid', 'mark', 'cancelledByMark', 'qrUrl')); } else { // There were some errors for a specific invoice. See errors for details. foreach ($response->getErrors() as $error) { $errors[$response->getIndex() - 1][] = $error->getCode() . ': ' . $error->getMessage(); } } } } catch (MyDataException $e) { // There was a communication error. None of the invoices were sent. echo "Σφάλμα επικοινωνίας: " . $e->getMessage(); }
Available methods
| Method | Availability |
|---|---|
| Validate VAT Number | ✅ |
| SendInvoices | ✅ |
| CancelInvoice | ✅ |
| RequestDocs | ✅ |
| RequestTransmittedDocs | ✅ |
| RequestMyIncome | ✅ |
| RequestMyExpenses | ✅ |
| RequestVatInfo | ✅ |
| RequestE3Info | ✅ |
| SendPaymentsMethod | ✅ |
| SendIncomeClassification | ✅ |
| SendExpensesClassification | ✅ |
| CancelDeliveryNote (Για παρόχους) | ✅ |
| CancelReceivingNote (Για παρόχους) | ✅ |
Digital Goods Movement (Ψηφιακή Διακίνηση Αγαθών)
Digital Goods Movement methods allow real-time tracking and management of goods in transit. These methods are available only for the ERP channel and are not supported by invoice service providers.
| Method | Description |
|---|---|
| RegisterTransfer | Register a transfer |
| ConfirmDeliveryOutcome | Confirm delivery outcome |
| ConfirmDeliveryReturn | Confirm delivery return |
| RejectDeliveryNote | Reject a delivery note |
| RequestDeliveryNoteStatus | Request delivery note status (by mark or qrUrl) |
| GenerateGroupQrCode | Generate group QR code |
| RequestGroupQrDetails | Request group QR details |
Quick example
use Firebed\AadeMyData\Http\DigitalGoodsMovement\RegisterTransfer; use Firebed\AadeMyData\Models\DigitalGoodsMovement\Transport; use Firebed\AadeMyData\Models\DigitalGoodsMovement\TransportDetails; use Firebed\AadeMyData\Models\DigitalGoodsMovement\Location; use Firebed\AadeMyData\Enums\DigitalGoodsMovement\TransportType; $details = new TransportDetails(); $details->setVehicleNumber('AHN0011'); $details->setTransportType(TransportType::PRIVATE_USE_TRUCK); $details->setCarrierVatNumber('777777777'); $details->setLocation(new Location(41.303921, -81.901693)); $transport = new Transport(); $transport->setQrUrl('https://mydataapidev.aade.gr/TimologioQR/QRInfo?q=test_qr_url'); $transport->setTransportDetail($details); $request = new RegisterTransfer(); $response = $request->handle($transport);
For detailed documentation and examples of all methods, see the Digital Goods Movement documentation.
Digital Client (Car rental, parking/wash, workshops)
The Digital Client API is specifically designed to serve businesses in industries such as car rentals, parking services, vehicle washing and workshops.
Please refer to the ΑΑΔΕ Digital Client, developed by Oxygen Invoicing Provider. It provides a robust, seamless and complete solution for managing customer and vehicle data while enabling smooth and uninterrupted data exchange between ERP systems and Greece's Independent Authority for Public Revenue (Ανεξάρτητη Αρχή Δημοσίων Εσόδων, ΑΑΔΕ).
Upgrade Guide
If you are upgrading from a previous version, please see upgrade guide
Testing
composer test
Contributing
Please see CONTRIBUTING for details.
Licence
AADE myDATA is licenced under the MIT License.
Copyright 2022 © Okan Giritli