> ## 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.

# Create accounts

> Submit new accounts to be reported to VMI.



## OpenAPI

````yaml post /reports/sask/v1/accounts
openapi: 3.1.0
info:
  title: OpenAPI definition
  version: v0
servers:
  - url: https://api.rrc.dev.finventi.com
    description: Development
  - url: https://api.rrc.finventi.com
    description: Production
security:
  - bearer-jwt: []
tags:
  - name: MMR-SASK Push API
    description: >-
      REST API for submitting MMR-SASK accounts, representatives, and
      beneficiaries
paths:
  /reports/sask/v1/accounts:
    post:
      tags:
        - MMR-SASK Push API
      summary: Create accounts
      description: >-
        Submit a batch of new accounts to be reported to VMI. The response
        returns a refId for each successfully created account. It must be saved
        on the client side to be able to update or delete the record in the
        future.
      operationId: createAccounts
      parameters:
        - name: Idempotency-Key
          in: header
          description: >-
            Client-provided idempotency key. UUID v4 suggested, max 255
            characters. If provided, duplicate requests with the same key will
            return the cached response.
          schema:
            type: string
            maxLength: 255
            pattern: \S
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/SaskAccountCreateRequest'
            example:
              - accountType: CURRENT_ACCOUNT
                iban: LT601010012345678901
                currency: EUR
                openedDate: '2024-12-20'
                closedDate: '2025-06-30'
                owner:
                  type: F
                  name: Jonas
                  surname: Jonaitis
                  birthDate: '1990-05-15'
                  addressCountry: LV
                  address: Riga, Alberta st. 1
                  codeCountry: LV
                  codeInForeignCountry: '39001011234'
                  documentType: NON_LT_PASSPORT
                  documentNumber: AB123456
                  nationalities:
                    - LV
                representatives:
                  - dateFrom: '2024-12-18'
                    dateTo: '2025-12-31'
                    representative:
                      type: F
                      name: Jonas
                      surname: Jonaitis
                      birthDate: '1990-05-15'
                      addressCountry: LV
                      address: Riga, Alberta st. 1
                      codeCountry: LV
                      codeInForeignCountry: '39001011234'
                      documentType: NON_LT_PASSPORT
                      documentNumber: AB123456
                      nationalities:
                        - LV
        required: true
      responses:
        '201':
          description: All created
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AccountResult'
              example:
                - status: SUCCESS
                  data:
                    accountType: CURRENT_ACCOUNT
                    iban: LT601010012345678901
                    currency: EUR
                    openedDate: '2024-12-20'
                    closedDate: '2025-06-30'
                    owner:
                      type: F
                      name: Jonas
                      surname: Jonaitis
                      birthDate: '1990-05-15'
                      addressCountry: LV
                      address: Riga, Alberta st. 1
                      codeCountry: LV
                      codeInForeignCountry: '39001011234'
                      documentType: NON_LT_PASSPORT
                      documentNumber: AB123456
                      nationalities:
                        - LV
                    representatives:
                      - dateFrom: '2024-12-18'
                        dateTo: '2025-12-31'
                        representative:
                          type: F
                          name: Jonas
                          surname: Jonaitis
                          birthDate: '1990-05-15'
                          addressCountry: LV
                          address: Riga, Alberta st. 1
                          codeCountry: LV
                          codeInForeignCountry: '39001011234'
                          documentType: NON_LT_PASSPORT
                          documentNumber: AB123456
                          nationalities:
                            - LV
                        refId: a8306155-8731-4aea-9b36-d30e958fbe33
                    refId: 305697289_20250303_E5D11991C7B74CB0
        '207':
          description: Partial success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AccountResult'
              example:
                - status: SUCCESS
                  data:
                    accountType: CURRENT_ACCOUNT
                    iban: LT601010012345678901
                    currency: EUR
                    openedDate: '2024-12-20'
                    closedDate: '2025-06-30'
                    owner:
                      type: F
                      name: Jonas
                      surname: Jonaitis
                      birthDate: '1990-05-15'
                      addressCountry: LV
                      address: Riga, Alberta st. 1
                      codeCountry: LV
                      codeInForeignCountry: '39001011234'
                      documentType: NON_LT_PASSPORT
                      documentNumber: AB123456
                      nationalities:
                        - LV
                    refId: 305697289_20250303_E5D11991C7B74CB0
                - status: FAILED
                  data:
                    accountType: CURRENT_ACCOUNT
                    iban: LT601010012345678901
                    openedDate: '2024-12-20'
                    owner:
                      type: F
                      name: Jonas
                      surname: Jonaitis
                      birthDate: '1990-05-15'
                      addressCountry: LV
                      address: Riga, Alberta st. 1
                      codeCountry: LV
                      codeInForeignCountry: '39001011234'
                      documentType: NON_LT_PASSPORT
                      documentNumber: AB123456
                      nationalities:
                        - LV
                  errors:
                    - fields:
                        - currency
                      message: must not be empty
        '400':
          description: All failed
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AccountResult'
              example:
                - status: FAILED
                  data:
                    accountType: CURRENT_ACCOUNT
                    iban: LT601010012345678901
                    currency: EUR
                    openedDate: '2024-12-20'
                    owner:
                      type: F
                      name: Jonas
                      surname: Jonaitis
                      birthDate: '1990-05-15'
                      addressCountry: LV
                      address: Riga, Alberta st. 1
                      codeCountry: LV
                      codeInForeignCountry: '39001011234'
                      documentType: NON_LT_PASSPORT
                      documentNumber: AB123456
                      nationalities:
                        - LV
                    refId: 305697289_20250303_E5D1
                  errors:
                    - fields:
                        - iban
                      message: >-
                        Account with IBAN 'LT601010012345678901' and currency
                        'EUR' already exists with refId
                        '305697289_20250303_E5D1'
components:
  schemas:
    SaskAccountCreateRequest:
      type: object
      properties:
        accountType:
          $ref: '#/components/schemas/AccountType'
        iban:
          type: string
          description: Account number (IBAN)
          example: LT601010012345678901
          maxLength: 35
          minLength: 0
        currency:
          type: string
          description: Currency code (ISO 4217)
          example: EUR
          minLength: 1
        openedDate:
          type: string
          format: date
          description: Date when the account was opened
          example: '2024-12-20'
        closedDate:
          type: string
          format: date
          description: Date when the account was closed
          example: '2025-06-30'
        owner:
          $ref: '#/components/schemas/Person'
        representatives:
          type: array
          items:
            $ref: '#/components/schemas/Representative'
      required:
        - accountType
        - currency
        - iban
        - openedDate
        - owner
    AccountResult:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/Status'
        data:
          $ref: '#/components/schemas/SaskAccountResponse'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/FieldError'
    AccountType:
      type: string
      enum:
        - CURRENT_ACCOUNT
        - DEPOSIT_ACCOUNT
        - LOAN_ACCOUNT
        - SAVINGS_ACCOUNT
        - PAYMENT_CARD_ACCOUNT
        - OTHER_ACCOUNT
        - SECURITIES_ACCOUNT
        - CUSTODY_ACCOUNT
        - SMALL_ENTREPRENEUR_ACCOUNT
        - INVESTMENT_ACCOUNT
        - CRYPTO_ASSET_ACCOUNT
    Person:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/CustomerType'
          description: 'Customer type: F - natural person, J - legal person, K - other'
        personCode:
          type: string
          description: >-
            Person code (up to 11 digits): legal entity code from the Register
            of Legal Entities, natural person code from the Population Register,
            or taxpayer identification number assigned by VMI
          example: 39001011234
          pattern: ^[0-9]{0,11}$
        name:
          type: string
          description: First name. Required for natural persons
          example: Jonas
          maxLength: 120
          minLength: 0
        surname:
          type: string
          description: Last name or company name
          example: Jonaitis
          maxLength: 120
          minLength: 0
        birthDate:
          type: string
          format: date
          description: Date of birth
          example: '1990-05-15'
        addressCountry:
          type: string
          description: Address country code (ISO 3166-1 alpha-2)
          example: LT
        address:
          type: string
          description: Full address in free form
          example: Vilnius, Gedimino pr. 1
          maxLength: 240
          minLength: 0
        codeCountry:
          type: string
          description: Country code of identification document (ISO 3166-1 alpha-2)
          example: LT
        codeInForeignCountry:
          type: string
          description: Foreign country issued personal identification code
          example: 39001011234
          maxLength: 30
          minLength: 0
        documentType:
          $ref: '#/components/schemas/DocumentType'
        documentNumber:
          type: string
          description: Document number
          example: AB123456
          maxLength: 30
          minLength: 0
        nationalities:
          type: array
          description: List of nationality country codes (ISO 3166-1 alpha-2)
          example:
            - LT
          items:
            type: string
      required:
        - surname
        - type
    Representative:
      type: object
      properties:
        dateFrom:
          type: string
          format: date
          description: Date from which the representative is valid
          example: '2024-12-18'
        dateTo:
          type: string
          format: date
          description: Date until which the representative is valid
          example: '2025-12-31'
        representative:
          $ref: '#/components/schemas/Person'
      required:
        - dateFrom
        - representative
    Status:
      type: string
      enum:
        - SUCCESS
        - FAILED
    SaskAccountResponse:
      type: object
      properties:
        accountType:
          $ref: '#/components/schemas/AccountType'
        iban:
          type: string
          description: Account number (IBAN)
          example: LT601010012345678901
          maxLength: 35
          minLength: 0
        currency:
          type: string
          description: Currency code (ISO 4217)
          example: EUR
          minLength: 1
        openedDate:
          type: string
          format: date
          description: Date when the account was opened
          example: '2024-12-20'
        closedDate:
          type: string
          format: date
          description: Date when the account was closed
          example: '2025-06-30'
        owner:
          $ref: '#/components/schemas/Person'
        refId:
          type: string
          description: >-
            Unique reference ID of the account. Store it for future updates or
            deletions
          example: 305697289_20250303_E5D11991C7B74CB0
        representatives:
          type: array
          description: List of representatives for this account
          items:
            $ref: '#/components/schemas/SaskRepresentativeResponse'
      required:
        - accountType
        - currency
        - iban
        - openedDate
        - owner
        - refId
    FieldError:
      type: object
      properties:
        code:
          type: string
          description: >-
            Validation error code returned by the Lithuanian tax authority
            (VMI). Only present for records that failed VMI data validation 
          example: 51
        fields:
          type: array
          description: Fields that caused the error
          example:
            - iban
          items:
            type: string
        message:
          type: string
          description: Error message
          example: must not be empty
    CustomerType:
      type: string
      enum:
        - F
        - J
        - K
    DocumentType:
      type: string
      enum:
        - LT_PASSPORT
        - BIRTH_CERTIFICATE
        - DRIVERS_LICENSE
        - LT_PERMANENT_RESIDENCE_PERMIT
        - LT_TEMPORARY_RESIDENCE_PERMIT
        - LT_ID_CARD
        - NON_LT_PASSPORT
        - DIPLOMATIC_PASSPORT
        - NON_LT_ID_CARD
        - EU_RESIDENCE_PERMIT
        - LT_DIGITAL_TEMPORARY_RESIDENCE_PERMIT
    SaskRepresentativeResponse:
      type: object
      properties:
        dateFrom:
          type: string
          format: date
          description: Date from which the representative is valid
          example: '2024-12-18'
        dateTo:
          type: string
          format: date
          description: Date until which the representative is valid
          example: '2025-12-31'
        representative:
          $ref: '#/components/schemas/Person'
        refId:
          type: string
          description: >-
            Unique reference ID of the representative. Store it for future
            updates or deletions
          example: cc85a01c-e710-4a72-bed1-df29c2d90f23
      required:
        - dateFrom
        - refId
        - representative
  securitySchemes:
    bearer-jwt:
      type: oauth2
      description: 'Obtain JWT via client_credentials grant. Required role: MMR_SASK_REPORT'
      flows:
        clientCredentials:
          tokenUrl: >-
            http://localhost:8180/realms/sti-connector/protocol/openid-connect/token
          scopes:
            MMR_SASK_REPORT: Submit MMR-SASK reports

````