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=…",
    "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.
mydata_markThe MARK (unique registration number) AADE assigned.
mydata_uidThe document's UID in myDATA.
qr_code_urlThe QR link, which opens the document at AADE.
idThe document's identifier at Flexy.

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.
403onboarding_not_approvedYour registration has not been approved yet.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.