FlexyAPI documentation

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:

FieldValue
issuer.legal_numberYou: replace <VAT NUMBER> with the VAT number (ΑΦΜ) of the business issuing the invoice (9 digits).
dateThe page: today's date (Greek time), in YYYY-MM-DD format.
aaThe 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
  }
}
FieldMeaning
statussuccess: AADE registered the document. If AADE did not answer, mark_pending: the document is issued and we transmit it later ourselves (step 7).
mydata_markThe MARK (unique registration number) AADE assigned.
mydata_uidThe document's UID in myDATA.
qr_code_urlAADE's link for the document. With provider: "flexy" the QR you print is verification_url.
aade_authentication_codeThe authentication string (Συμβολοσειρά Αυθεντικοποίησης) AADE assigned.
provider_identityThe 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_urlThe provider page that shows the whole document, with the MARK and a link to AADE. It contains the MARK.
peppol_xml_availableWhether 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_providersHow 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_markDelivery 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.
idThe 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

ValueMeaning
provider: "flexy"Flexy transmits the document to AADE as the provider.
provider_details.document_type: "1.1"Sales Invoice.
provider_details.payment_method_type: 3Paid in cash (myDATA code 3) for the whole payable amount.
issuerThe business issuing the invoice. Of its details, AADE receives the VAT number; the name and address can stay as they are.
counterpartThe invoice's customer: a test customer (VAT 801434350). It must differ from the issuer.
itemsOne 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

HTTPcodeCauseWhat to do
400requiredA field is missing. attr says which, e.g. aa or items.0.description.Add the field.
400invalidThe amounts do not agree with each other, or the date is in the future. detail explains exactly what.Fix what detail mentions.
400provider_validation_errorAADE 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.
400transmission_failure_windowA document with transmission_failure: 1 and a date older than yesterday.See step 6.
403onboarding_not_approvedYour registration has not been approved yet.Email us at [email protected].
403entity_not_declaredA 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].
500errorAn 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.