> ## Documentation Index
> Fetch the complete documentation index at: https://invopop-singapore.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# myDATA & IAPR Guide

> Send invoices and credit notes to the Greek IAPR via the myDATA platform.

## Introduction

The myDATA (My Digital Accounting and Tax Application) platform is Greece’s standardized electronic invoicing and bookkeeping system, managed by the Independent Authority for Public Revenue (IAPR). This system enables businesses to report invoices and accounting data in real time, ensuring compliance with Greek tax regulations.

This guide will walk you through the process of reporting invoices to the IAPR using myDATA, first registering a supplier, and then issuing invoices and credit notes in their name.

## Prerequisites

To issue invoices in Greece, you will need:

* Supplier details, including company name, TIN, and address.
* Customer details for B2B transactions, including name, TIN or international ID, and address.
* Line and item details, including quantity, price, description, applicable VAT rates, and, optionally, income classification codes.
* To have chosen an invoice series.

## Setup

To issue invoices, follow these instructions in the [Invopop Console](https://console.invopop.com):

<Steps>
  <Step title="Connect ILYDA Greece App">
    1. Navigate to **Configuration** → **Apps**.
    2. Find **ILYDA Greece** in the app discovery list.
    3. Click **Connect** to activate.

    <Frame>
      <img src="https://mintcdn.com/invopop-singapore/e7r7hAu6qvW2ozEr/guides/images/gr-iapr-app.png?fit=max&auto=format&n=e7r7hAu6qvW2ozEr&q=85&s=d06944632a28f895f9b69f5ac282120b" width="350px" alt="ILYDA Greece App" data-path="guides/images/gr-iapr-app.png" />
    </Frame>

    <Info>
      The ILYDA Greece app will send your invoices to the appropriate environment based on whether your current workspace is Sandbox or Live.
    </Info>
  </Step>

  <Step title="Prepare Invoice Workflow">
    <Tabs>
      <Tab title="Template">
        <Card iconType="duotone" title="IAPR Invoice Workflow" icon="code-branch" href="https://console.invopop.com/redirect/workflows/new?template=gr-iapr-invoice" cta="Add to my workspace">
          This workflow will issue an invoice through IAPR.
        </Card>
      </Tab>

      <Tab title="Code">
        Copy and paste into a new [Empty Invoice workflow](https://console.invopop.com/redirect/workflows/new?template=empty-invoice) code view.

        ```json Example IAPR invoice workflow with states theme={"system"}
        {
          "name": "Issue IAPR Invoice",
          "description": "Send GOBL invoices to the Greek IAPR via ILYDA eInvoicing.",
          "schema": "bill/invoice",
          "steps": [
            {
              "id": "883baa10-abd5-11ef-8b96-dd5de8906f90",
              "name": "Set Silo Entry State",
              "config": {
                "state": "processing"
              },
              "summary": "Set state to `processing`{.state .processing}",
              "provider": "silo.state"
            },
            {
              "id": "e9fad100-abd4-11ef-8b96-dd5de8906f90",
              "name": "Add Sequential Code",
              "config": {
                "name": "IAPR Invoices",
                "start": 1,
                "padding": 3
              },
              "summary": "Dynamic · IAPR Invoices · 1",
              "provider": "sequence.enumerate"
            },
            {
              "id": "fc75e4f0-8721-11ef-a962-73e3f2037a52",
              "name": "Sign Envelope",
              "provider": "silo.close"
            },
            {
              "id": "649aca50-9064-11ef-8f9e-39835766d0bc",
              "name": "Send to IAPR (via ILYDA)",
              "provider": "ilyda.send"
            },
            {
              "id": "6f77ad10-a32b-11ef-9707-79bbd71238cd",
              "name": "Set State",
              "config": {
                "state": "sent"
              },
              "summary": "Set state to `sent`{.state .sent}",
              "provider": "silo.state"
            }
          ],
          "rescue": [
            {
              "id": "e8c9c0a0-a32a-11ef-9707-79bbd71238cd",
              "name": "Set State",
              "config": {
                "state": "error"
              },
              "summary": "Set state to `error`{.state .error}",
              "provider": "silo.state"
            }
          ]
        }
        ```
      </Tab>

      <Tab title="Build from scratch">
        First, review our [workflows guide](/guides/features/workflows) to understand the basics.

        In [Console](https://console.invopop.com) create a new workflow and select [Empty Invoice workflow](https://console.invopop.com/redirect/workflows/new?template=empty-invoice) in the template selector, then add the following steps:

        1. **Set State** - to `processing`.
        2. **Add Sequential Code** - with dynamic sequences and a name like "IAPR Invoices".
        3. **Sign Envelope**: The envelope must be signed before processing.
        4. **Send to IAPR (via ILYDA)**.
        5. **Set State** - to `sent`.

        Finally, in the Error Handling area, add the **Set State** action and select `Error`.

        Add any additional steps you may need, and save the new workflow.
      </Tab>
    </Tabs>
  </Step>
</Steps>

## Running

In this section, we'll provide details on how to register new suppliers and issue invoices on their behalf.

### Register a supplier

<Warning>
  Supplier registration is only possible in production. In the sandbox environment, your invoices must use a supplier with the tax ID code set to `177472438` which is the TIN of the test supplier pre-enabled in that environment.
</Warning>

Invopop has partnered with [ILYDA](https://ilyda.gr) to issue invoices in Greece. Each supplier must be registered with ILYDA to issue invoices on their behalf. This involves:

* Authorizing ILYDA as an electronic invoicing provider in Taxisnet.
* Declaring ILYDA as invoice issuer in myDATA.
* Signing a service provision agreement with ILYDA.

Please contact us via Slack or [support@invopop.com](mailto:support@invopop.com) whenever you need to onboard a new supplier. We will walk you through the process.

### Send an invoice

The following examples are of partial GOBL documents you can copy and paste directly into the [Invopop Console](https://console.invopop.com) or store via the API as silo entries. Then, you must run the "Issue IAPR Invoice" workflow created during setup.

As usual, the recommended approach for running jobs is to perform two steps; first, upload the document to the [silo](/api-ref/silo/entries/create-an-entry-put), second [create a job](/api-ref/transform/jobs/create-a-job-put).

GOBL Invoices sent to myDATA require the following properties to perform the correct normalization and validation steps. Invopop will try to assign these automatically, but we recommend defining them explicitly before uploading:

* `$region` to be set to [`EL`](https://docs.gobl.org/regimes/gr)
* `$addons` to include [`gr-mydata-v1`](https://docs.gobl.org/addons/gr-mydata-v1)

<AccordionGroup>
  <Accordion title="B2B Invoice">
    In this example, we're issuing a simple invoice from a Greek supplier to another Greek customer.

    Notice:

    * we've added the `gr-mydata-v1` addon; this ensures the document will be validated and normalized using the myDATA v1 rules built into the GOBL library,
    * we've set the `services` tag; this makes the addon set the `gr-mydata-invoice-type` extension automatically to `2.1` (service invoice),
    * similarly, the `cash` payment method will cause the addon to set the `gr-mydata-payment-means` extension to `3` (cash),
    * other extensions (`ext`) have been explicitly set where values cannot be determined any other way,
    * only VAT rates (`standard` and `exempt`) have been specified; percentages and values for the `gr-mydata-vat-rate` extension will be set automatically, and,
    * there are no totals or calculations; all these will be made automatically when uploading.

    ```json B2B Invoice theme={"system"}
    {
      "$schema": "https://gobl.org/draft-0/bill/invoice",
      "$regime": "EL",
      "$addons": ["gr-mydata-v1"],
      "$tags": ["services"],
      "series": "XXGR",
      "supplier": {
        "name": "Ελληνικά Τρόφιμα Α.Ε.",
        "tax_id": {
          "country": "EL",
          "code": "177472438"
        },
        "addresses": [
          {
            "num": "12",
            "street": "Λεωφόρος Βουλιαγμένης",
            "locality": "Αθήνα",
            "code": "11636",
            "country": "GR"
          }
        ],
        "emails": [
          {
            "addr": "hellenicfoods@example.com"
          }
        ]
      },
      "customer": {
        "name": "Αιγαίο Λιανική Α.Ε.",
        "tax_id": {
          "country": "EL",
          "code": "841442160"
        },
        "addresses": [
          {
            "num": "45",
            "street": "Οδός Εγνατίας",
            "locality": "Θεσσαλονίκη",
            "code": "54625",
            "country": "GR"
          }
        ],
        "emails": [
          {
            "addr": "aegeanretail@example.com"
          }
        ]
      },
      "lines": [
        {
          "quantity": "20",
          "item": {
            "name": "Υπηρεσίες Ανάπτυξης",
            "price": "90.00",
            "unit": "h",
            "ext": {
              "gr-mydata-income-cat": "category1_3",
              "gr-mydata-income-type": "E3_561_001"
            }
          },
          "discounts": [
            {
              "reason": "Ειδική Έκπτωση",
              "percent": "10%"
            }
          ],
          "taxes": [
            {
              "cat": "VAT",
              "rate": "standard"
            }
          ]
        },
        {
          "quantity": "1",
          "item": {
            "name": "Tax-exempt item",
            "price": "100.00",
            "ext": {
              "gr-mydata-income-cat": "category1_3",
              "gr-mydata-income-type": "E3_561_001"
            }
          },
          "taxes": [
            {
              "cat": "VAT",
              "rate": "exempt",
              "ext": {
                "gr-mydata-exemption": "3"
              }
            }
          ]
        }
      ],
      "payment": {
        "instructions": {
          "key": "cash"
        }
      }
    }
    ```
  </Accordion>
</AccordionGroup>

## FAQ

If you have further questions, don't hesitate to contact the [Invopop support team](mailto:support@invopop.com).

<AccordionGroup>
  <Accordion title="Where can I find the mapping of GOBL fields to myDATA?">
    For further details on how GOBL prepares data for conversion, see the [Greek Tax Regime](https://github.com/invopop/gobl/blob/main/regimes/gr/README.md).
  </Accordion>
</AccordionGroup>
