firebed / aade-mydata
Implementation of requests for AADE myDATA.
Installs: 2 954
Dependents: 1
Suggesters: 0
Security: 0
Stars: 79
Watchers: 12
Forks: 24
Open Issues: 0
Type:package
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
- 5.x-dev
- 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-DCL
- dev-master
This package is auto-updated.
Last update: 2025-02-21 18:40:46 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 almost all the boilerplate code for sending, cancelling and requesting invoices.
Documentation
- Official documentation is available 👉 on our documentation site
- myDATA webpage: AADE myDATA
- myDATA documentation (PDF): AADE myDATA REST API v1.0.10
Requirements
In order 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 | v1.0.10 | Active |
^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);
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 | ✅ |
Digital Client (Car rental, parking/wash, workshops)
Method | Availability |
---|---|
SendClient | In progress |
UpdateClient | In progress |
RequestClients | In progress |
CancelClient | In progress |
ClientCorrelations | In progress |
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