> ## Documentation Index
> Fetch the complete documentation index at: https://docs.finventi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Testing Guide

> Complete testing scenarios and requirements before moving to production.

## Overview

Complete both scenarios in the test environment before moving to production: report persons for a sub-report and year, then correct one of them. Run them once for each sub-report, since `SIPL`, `SLIK` and `SKIS` carry different person data and are authorised separately.

See [Testing](/regulatory/rrc/testing) for the test environment and the practices shared by every report.

## Test Scenarios

<Tabs>
  <Tab title="Report Persons">
    Create a submission for one sub-report and year, push your persons, then submit.

    <AccordionGroup>
      <Accordion title="Test Case 1: Create Submission" icon="plus">
        **Objective**: Create a new submission for one sub-report and reporting year.

        **Request**: `POST /reports/mai55/v1/submissions`

        **Request Body**:

        ```json theme={null}
        {
          "type": "SIPL",
          "reportingYear": 2025,
          "webhookUrl": "https://example.com/mai55/webhook"
        }
        ```

        <Info>
          `webhookUrl` is optional. Include it and the connector calls it with the final verdict once the submission finishes processing:

          ```json theme={null}
          {"submissionId": "6f1b0c1e-6c0b-4c39-9a2e-1d9d2f0f7a11", "status": "ACCEPTED"}
          ```

          Whitelist the sending IP addresses first. They are listed under [Webhook](/regulatory/rrc/mai55/overview#webhook). Test whichever route you plan to use in production.
        </Info>

        **Expected Response**: `HTTP 201 Created`

        ```json theme={null}
        {
          "submissionId": "6f1b0c1e-6c0b-4c39-9a2e-1d9d2f0f7a11",
          "type": "SIPL",
          "kind": "SUBMISSION"
        }
        ```

        <Info>
          Confirm `kind` is `SUBMISSION` and `type` matches what you asked for. Store the `submissionId`. It scopes every call in Test Cases 2 to 4.
        </Info>
      </Accordion>

      <Accordion title="Test Case 2: Push Persons" icon="users">
        **Objective**: Add the persons you report for the year. Call this as many times as you need.

        Push to the path matching the submission's sub-report. Pushing to another one is rejected.

        <Tabs>
          <Tab title="SIPL">
            **Request**: `POST /reports/mai55/v1/submissions/{submissionId}/sipl/persons`

            The example pushes two: a natural person and a legal entity.

            ```json theme={null}
            [
              {
                "clientPersonId": "CLIENT-000123",
                "individual": {
                  "firstName": "Jonas",
                  "lastName": "Jonaitis",
                  "personCode": "39001010000"
                },
                "accounts": [
                  {
                    "accountNumber": "LT121000011101001000",
                    "accountType": "CURRENT_ACCOUNT",
                    "income": 18500.00
                  }
                ]
              },
              {
                "clientPersonId": "CLIENT-000124",
                "organisation": {
                  "name": "UAB Inventi",
                  "code": "123456789",
                  "issuedBy": "LT"
                },
                "accounts": [
                  {
                    "accountNumber": "LT601010012345678901",
                    "accountType": "CURRENT_ACCOUNT",
                    "income": 42500.00
                  }
                ]
              }
            ]
            ```

            <Note>
              Only persons whose income across all their accounts reaches 15,000 EUR are reportable under `SIPL`. The total is summed from the accounts rather than sent.
            </Note>
          </Tab>

          <Tab title="SLIK">
            **Request**: `POST /reports/mai55/v1/submissions/{submissionId}/slik/persons`

            Balances as they stood at the end of the reporting year.

            ```json theme={null}
            [
              {
                "clientPersonId": "CLIENT-000123",
                "individual": {
                  "firstName": "Jonas",
                  "lastName": "Jonaitis",
                  "personCode": "39001010000"
                },
                "accounts": [
                  {
                    "accountNumber": "LT121000011101001000",
                    "accountType": "CURRENT_ACCOUNT",
                    "balance": 15320.44
                  },
                  {
                    "accountNumber": "LT601010012345678901",
                    "accountType": "SAVINGS_ACCOUNT",
                    "balance": 4800.00
                  }
                ]
              }
            ]
            ```
          </Tab>

          <Tab title="SKIS">
            **Request**: `POST /reports/mai55/v1/submissions/{submissionId}/skis/persons`

            Debts still outstanding on 31 December of the reporting year.

            ```json theme={null}
            [
              {
                "clientPersonId": "CLIENT-000123",
                "individual": {
                  "firstName": "Jonas",
                  "lastName": "Jonaitis",
                  "personCode": "39001010000"
                },
                "debts": [
                  {
                    "agreementNumber": "CR-2024-000123",
                    "agreementDate": "2024-03-15",
                    "repaymentDate": "2029-03-15",
                    "debtKind": "Consumer credit",
                    "debtAmount": 15000.00,
                    "reportableDebtAmount": 9800.50,
                    "repaymentType": "Periodic payments in equal amounts",
                    "jointLiability": 2,
                    "interestRate": 7.5
                  }
                ]
              }
            ]
            ```
          </Tab>
        </Tabs>

        <Info>
          `clientPersonId` is your own key. It must be unique within the submission, and it is how you amend or withdraw the person later. Send the optional `Idempotency-Key` header so a retry returns the original response instead of pushing the batch twice.
        </Info>

        **Expected Response**: `HTTP 201 Created`

        ```json theme={null}
        [
          {
            "status": "SUCCESS",
            "clientPersonId": "CLIENT-000123",
            "errors": []
          },
          {
            "status": "SUCCESS",
            "clientPersonId": "CLIENT-000124",
            "errors": []
          }
        ]
        ```
      </Accordion>

      <Accordion title="Test Case 3: Submit" icon="paper-plane">
        **Objective**: Hand the submission off to be reported to the tax authority.

        **Request**: `POST /reports/mai55/v1/submissions/{submissionId}:submit`

        No request body.

        **Expected Response**: `HTTP 200 OK`

        <Warning>
          After this call the submission is no longer editable. Push all persons first.
        </Warning>
      </Accordion>

      <Accordion title="Test Case 4: Track Progress" icon="chart-line">
        **Objective**: Follow the submission until the tax authority accepts it.

        <Info>
          Use these calls instead of the webhook, or alongside it whenever you want to check a submission by hand.
        </Info>

        **Request**: `GET /reports/mai55/v1/submissions/{submissionId}/status`

        **Expected Response**: `HTTP 200 OK`

        ```json theme={null}
        {
          "submissionId": "6f1b0c1e-6c0b-4c39-9a2e-1d9d2f0f7a11",
          "type": "SIPL",
          "status": "PROCESSING"
        }
        ```

        Poll until `status` becomes `REPORTED`.
      </Accordion>
    </AccordionGroup>
  </Tab>

  <Tab title="Correct Reported Person">
    To change a sub-report and year you have already reported, create a submission for the same pair again. The same endpoints now act on what the tax authority already holds, keyed by `clientPersonId`.

    <AccordionGroup>
      <Accordion title="Test Case 1: Create Correction" icon="rotate">
        **Objective**: Create a correction round for a sub-report and year you have already reported.

        **Request**: `POST /reports/mai55/v1/submissions`

        **Request Body**:

        ```json theme={null}
        {
          "type": "SIPL",
          "reportingYear": 2025
        }
        ```

        **Expected Response**: `HTTP 201 Created`

        ```json theme={null}
        {
          "submissionId": "b3c9a4d2-1f77-4f0e-8d3a-5c6b7e8f9a01",
          "type": "SIPL",
          "kind": "CORRECTION"
        }
        ```

        <Info>
          Confirm that `kind` is now `CORRECTION` and use this `submissionId` for the subsequent requests.
        </Info>

        <Warning>
          Only one round per sub-report and year runs at a time. If the first submission is still being processed, this call returns `HTTP 409`. Wait for it to reach `REPORTED` and try again.
        </Warning>
      </Accordion>

      <Accordion title="Test Case 2: Update Person" icon="pen-to-square">
        **Objective**: Amend an already-reported person.

        Send the complete person with all their accounts or debts, not just the changed ones. `PUT` replaces the person rather than merging into them, so whatever you leave out stops being reported.

        Amend through the path matching the submission's sub-report, exactly as when you pushed.

        <Tabs>
          <Tab title="SIPL">
            **Request**: `PUT /reports/mai55/v1/submissions/{submissionId}/sipl/persons/{clientPersonId}`

            Here the income paid into the account changed.

            ```json theme={null}
            {
              "clientPersonId": "CLIENT-000123",
              "individual": {
                "firstName": "Jonas",
                "lastName": "Jonaitis",
                "personCode": "39001010000"
              },
              "accounts": [
                {
                  "accountNumber": "LT121000011101001000",
                  "accountType": "CURRENT_ACCOUNT",
                  "income": 21750.00
                }
              ]
            }
            ```
          </Tab>

          <Tab title="SLIK">
            **Request**: `PUT /reports/mai55/v1/submissions/{submissionId}/slik/persons/{clientPersonId}`

            Here the current account's year-end balance was restated. The savings account is unchanged but still sent, because leaving it out would stop it being reported.

            ```json theme={null}
            {
              "clientPersonId": "CLIENT-000123",
              "individual": {
                "firstName": "Jonas",
                "lastName": "Jonaitis",
                "personCode": "39001010000"
              },
              "accounts": [
                {
                  "accountNumber": "LT121000011101001000",
                  "accountType": "CURRENT_ACCOUNT",
                  "balance": 16980.10
                },
                {
                  "accountNumber": "LT601010012345678901",
                  "accountType": "SAVINGS_ACCOUNT",
                  "balance": 4800.00
                }
              ]
            }
            ```
          </Tab>

          <Tab title="SKIS">
            **Request**: `PUT /reports/mai55/v1/submissions/{submissionId}/skis/persons/{clientPersonId}`

            Here the amount still owed at the end of the year was restated.

            ```json theme={null}
            {
              "clientPersonId": "CLIENT-000123",
              "individual": {
                "firstName": "Jonas",
                "lastName": "Jonaitis",
                "personCode": "39001010000"
              },
              "debts": [
                {
                  "agreementNumber": "CR-2024-000123",
                  "agreementDate": "2024-03-15",
                  "repaymentDate": "2029-03-15",
                  "debtKind": "Consumer credit",
                  "debtAmount": 15000.00,
                  "reportableDebtAmount": 8450.00,
                  "repaymentType": "Periodic payments in equal amounts",
                  "jointLiability": 2,
                  "interestRate": 7.5
                }
              ]
            }
            ```
          </Tab>
        </Tabs>

        **Expected Response**: `HTTP 200 OK`

        ```json theme={null}
        {
          "status": "SUCCESS",
          "clientPersonId": "CLIENT-000123",
          "errors": []
        }
        ```

        <Note>
          Amending a person the tax authority has never seen is rejected. Add such a person with `POST` instead.
        </Note>
      </Accordion>

      <Accordion title="Test Case 3: Delete Person" icon="trash">
        **Objective**: Withdraw a reported person's entry, with every account or debt it carried.

        **Request**: `DELETE /reports/mai55/v1/submissions/{submissionId}/{sipl|slik|skis}/persons/{clientPersonId}`

        Use the path matching the submission's sub-report. No request body.

        **Expected Response**: `HTTP 204 No Content`

        <Info>
          A person the tax authority has never seen returns `HTTP 404`. A person you withdrew earlier may be pushed again under the same `clientPersonId` in a later round, and is reported afresh rather than as a correction.
        </Info>
      </Accordion>

      <Accordion title="Test Case 4: Submit Correction" icon="paper-plane">
        **Objective**: Send the correction to the tax authority.

        Like the first submission, a correction only reaches the tax authority once you submit it.

        **Request**: `POST /reports/mai55/v1/submissions/{submissionId}:submit`

        **Expected Response**: `HTTP 200 OK`

        Track it with `GET .../status` as in the first scenario. You can open as many correction rounds for a sub-report and year as you need, one at a time.
      </Accordion>
    </AccordionGroup>
  </Tab>
</Tabs>
