API documentation
Step 2 – Issue an invoice
Issue a Sales Invoice (1.1) paid in cash, filling in only the issuer's VAT number.
In this step you issue a real document in the test environment: a Sales Invoice (1.1) of €12.40, paid in cash. Every value is ready. You only fill in the issuer's VAT number.
1. Prepare the request body
Save the following as invoice.json:
{
"document": {
"provider": "flexy",
"document_type": "invoice",
"series": "A",
"aa": "YYYYMMDDHHMMSS",
"date": "YYYY-MM-DD",
"provider_details": {
"document_type": "1.1",
"payment_method_type": 3
},
"issuer": {
"legal_name": "Δοκιμαστικός Εκδότης",
"legal_number": "<VAT NUMBER>",
"address": {
"address_line": "Πανεπιστημίου 123",
"city": "Αθήνα",
"zip": "10678",
"country": "GR"
}
},
"counterpart": {
"legal_name": "Δοκιμαστικός Πελάτης",
"legal_number": "801434350",
"address": {
"address_line": "Σταδίου 456",
"city": "Θεσσαλονίκη",
"zip": "54625",
"country": "GR"
}
},
"items": [
{
"title": "Προϊόν δοκιμής",
"description": "Γραμμή δοκιμής",
"quantity": "1",
"unit_measure": "ΤΕΜ",
"unit_value": "10.00",
"unit_total": "10.00",
"taxes": [
{
"title": "ΦΠΑ 24%",
"value_type": "percentage",
"value": "24.00",
"tax_sign": "+",
"on_vat": true,
"provider_details": { "provider_code": "1" }
}
],
"provider_details": {
"classification_category": "category1_1",
"classification_type": "E3_561_001",
"vat_classification_category": "1"
}
}
],
"totals": {
"line_extension_amount": "10.00",
"tax_exclusive_amount": "10.00",
"tax_amount": "2.40",
"tax_inclusive_amount": "12.40",
"payable_amount": "12.40"
},
"tax_breakdown": [
{
"tax_category_id": "S",
"tax_rate_percent": "24.00",
"taxable_amount": "10.00",
"tax_amount": "2.40"
}
]
}
}You only fill in the issuer's VAT number. The page fills in date and aa every time you open it:
| Field | Value |
|---|---|
issuer.legal_number | You: replace <VAT NUMBER> with the VAT number (ΑΦΜ) of the business issuing the invoice (9 digits). |
date | The page: today's date (Greek time), in YYYY-MM-DD format. |
aa | The page: the current date and time down to the second, e.g. 20261004153012 for 4 Oct 2026 15:30:12. Every submission gets a new sequence number this way; for a new submission, reload the page. |
2. Send it
curl https://provider-staging.flexy.gr/api/v1/documents/ \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
--data-binary @invoice.json
3. The response
Once AADE registers the document, the API answers with HTTP 201:
{
"document": {
"document_type": "invoice",
"aa": "20261004102731",
"series": "A",
"issue_date": "2026-10-04",
"id": "969950c9-2bfa-48c8-ba15-ebe12d02b743",
"provider": "flexy",
"status": "success",
"mydata_mark": 400001972081610,
"mydata_uid": "A2C1DBB4600F9CF22CCE6370CEDF72036220B39A",
"qr_code_url": "https://mydataapidev.aade.gr/TimologioQR/QRInfo?q=…",
"aade_authentication_code": "…",
"provider_identity": { "name": "FLEXY Ι.Κ.Ε.", "website": "www.flexy.gr", "licence_number": null },
"verification_url": "https://provider-staging.flexy.gr/api/v1/public/verify/<public_key>?mark=400001972081610",
"peppol_xml_available": false,
"reception_emails": [],
"reception_providers": [],
"issuer_vat_number": "<VAT NUMBER>",
"counterpart_vat_number": "801434350",
"total_gross_value": "12.40"
// … and more fields, e.g. document_data with the whole document as you sent it
}
}
| Field | Meaning |
|---|---|
status | success: AADE registered the document. If AADE did not answer, mark_pending: the document is issued and we transmit it later ourselves (step 7). |
mydata_mark | The MARK (unique registration number) AADE assigned. |
mydata_uid | The document's UID in myDATA. |
qr_code_url | AADE's link for the document. With provider: "flexy" the QR you print is verification_url. |
aade_authentication_code | The authentication string (Συμβολοσειρά Αυθεντικοποίησης) AADE assigned. |
provider_identity | The provider's name (name), website (website) and ΥΠΑΗΕΣ licence number (licence_number) as they stood when the document was issued. Until the licence is granted, licence_number is null. |
verification_url | The provider page that shows the whole document, with the MARK and a link to AADE. It contains the MARK. |
peppol_xml_available | Whether the electronic invoice can be downloaded now (step 4). Right after issuing it is false: the file is ready a few seconds after AADE registers the document. |
reception_emails, reception_providers | How the recipient takes delivery, from AADE's answer: the e-mails it declared at AADE for receiving documents, and the VAT numbers of the providers it receives through. Empty lists when it declared none; null when AADE could not be asked (rare, after a late transmission). |
cancellation_mark | Delivery notes (9.1–9.3) and quantity receipt notes (10.1–10.2) only: the MARK AADE gave their cancellation (step 9); null while the note is not cancelled. |
id | The document's identifier at Flexy. |
aade_authentication_code, provider_identity, verification_url, peppol_xml_available, reception_emails and
reception_providers are filled only for provider: "flexy"; for mydata and oxygen they are null.
What you print (A.1112/2025 Article 7 §5–§6): the name, website and licence number from
provider_identity, the MARK, the UID, aade_authentication_code, the issue date and time, and a QR
of verification_url.
A ready A4 PDF of the same document is at GET /api/v1/public/documents/<public_key>/pdf/, with no API key
(public_key from the response). It returns application/pdf as the file <series>-<aa>.pdf, or 404 for an
unknown key. Limit: 60 requests per minute.
What the example contains
| Value | Meaning |
|---|---|
provider: "flexy" | Flexy transmits the document to AADE as the provider. |
provider_details.document_type: "1.1" | Sales Invoice. |
provider_details.payment_method_type: 3 | Paid in cash (myDATA code 3) for the whole payable amount. |
issuer | The business issuing the invoice. Of its details, AADE receives the VAT number; the name and address can stay as they are. |
counterpart | The invoice's customer: a test customer (VAT 801434350). It must differ from the issuer. |
items | One line: 1 piece × €10.00, 24% VAT (VAT category 1), income classification category1_1 / E3_561_001 (wholesale). |
totals, tax_breakdown | €10.00 net + €2.40 VAT = €12.40. They must agree with the lines. |
Something is wrong
| HTTP | code | Cause | What to do |
|---|---|---|---|
400 | required | A field is missing. attr says which, e.g. aa or items.0.description. | Add the field. |
400 | invalid | The amounts do not agree with each other, or the date is in the future. detail explains exactly what. | Fix what detail mentions. |
400 | provider_validation_error | AADE rejected the document; detail carries its message. With It has already been sent for another invoice, this aa was already sent. With Issuer must be different from counterpart, the issuer has the customer's VAT number. | For a new aa, reload the page and send again. Otherwise fix what detail mentions. |
400 | transmission_failure_window | A document with transmission_failure: 1 and a date older than yesterday. | See step 6. |
403 | onboarding_not_approved | Your registration has not been approved yet. | Email us at [email protected]. |
403 | entity_not_declared | A step that lets Flexy transmit for the business is missing (contract, Taxisnet authorisation or commencement statement); detail names it. Nothing was sent to AADE. | Email us at [email protected]. |
500 | error | An error on Flexy's side, e.g. your test account is not fully set up. | Email us at [email protected]. |
For 401 errors see step 1.
Continue with step 3: the same invoice, paid by card.