﻿swagger: "2.0"
info:
  title: mf-rnp
  description: Rejestr należności publicznoprawnych
  version: 1.0.0
schemes:
  - http
host: "localhost:8127"
paths:
  /wpisy/osfiz:
    post:
      tags:
        - Wpisy
      produces:
        - application/json
      operationId: getWyszukajZobowiazanegoOsFiz
      summary: Wpisy dotyczące konsumenta
      description: "Pobranie danych dotyczących wpisów w Rejestrze Należności Publicznoprawnych, na podstawie określonego zestawu parametrów."
      parameters:
        - name: body
          description: "Podaj jeden z atrybutów:\n\n  * pesel\n  * imieNazwiskoData\n  * nip\n  * zagranicznyNumerIndentyfikacyjny\n  * paszport"
          in: body
          required: true
          schema:
            $ref: "#/definitions/OSFIZ"
      responses:
        "200":
          description: 200 OK
          schema:
            $ref: "#/definitions/Wpis"
          examples:
            application/json:
              dataWyszukania: "2020-01-01"
              kryteriaWyszukiwania:
                pesel: "9988998899"
              lacznaKwotaNaleznosciIOdsetek: "1500"
              wpisy:
                - oznaczenieWierzyciela:
                    nazwa: Wierzyciel przykladowy
                    nip: "123456789"
                  trescWpisu:
                    dataWpisaniaNaleznosciDoRNP: "2010-01-01"
                    kwotaNaleznosciIOdsetek: "1500"
                    odroczenieTerminuZaplaty: tak
                    podstawaPrawnaNaleznosci:
                      dataDecyzji: "2015-01-01"
                      przepisPrawa: przepis prawa
        "400":
          description: 400 Bad Request
          schema:
            type: object
            properties:
              status:
                type: string
              message:
                type: string
        "404":
          description: 404 Data not found
          schema:
            type: object
            properties:
              status:
                type: string
              message:
                type: string
      x-auth-type: "Application & Application User"
      x-throttling-tier: Unlimited
  /wpisy/podmgosp:
    post:
      tags:
        - Wpisy
      produces:
        - application/json
      operationId: getWyszukajZobowiazanegoOsPraw
      summary: Wpisy dotyczące pozostałych podmiotów
      description: "Pobranie danych dotyczących wpisów w Rejestrze Należności Publicznoprawnych, na podstawie określonego zestawu parametrów."
      parameters:
        - name: body
          in: body
          required: true
          description: "Podaj jeden z atrybutów:\n\n  * nip\n  * regon\n  * paszport\n  * zagranicznyNumerIndentyfikacyjny\n  * firmaNazwaAdres\n  * imieNazwiskoDataAdres"
          schema:
            $ref: "#/definitions/PODMGOSP"
      responses:
        "200":
          description: 200 OK
          schema:
            $ref: "#/definitions/Wpis"
          examples:
            application/json:
              dataWyszukania: "2020-01-01"
              kryteriaWyszukiwania:
                nip: "9988998899"
              lacznaKwotaNaleznosciIOdsetek: "1500"
              wpisy:
                - oznaczenieWierzyciela:
                    nazwa: Wierzyciel przykladowy
                    nip: "123456789"
                  trescWpisu:
                    dataWpisaniaNaleznosciDoRNP: "2010-01-01"
                    kwotaNaleznosciIOdsetek: "1500"
                    odroczenieTerminuZaplaty: tak
                    podstawaPrawnaNaleznosci:
                      dataDecyzji: "2015-01-01"
                      przepisPrawa: przepis prawa
        "400":
          description: 400 Bad Request
          schema:
            type: object
            properties:
              status:
                type: string
              message:
                type: string
        "404":
          description: 404 Data not found
          schema:
            type: object
            properties:
              status:
                type: string
              message:
                type: string
      x-auth-type: "Application & Application User"
      x-throttling-tier: Unlimited
definitions:
  kryteriaWyszukiwaniaAll:
    type: object
    properties:
      nip:
        $ref: "#/definitions/NIP"
      pesel:
        $ref: "#/definitions/PESEL"
      regon:
        $ref: "#/definitions/Regon"
      paszport:
        $ref: "#/definitions/Paszport"
      zagranicznyNumerIndentyfikacyjny:
        $ref: "#/definitions/ZagranicznyNumerIndentyfikacyjny"
      imieNazwiskoDataAdres:
        $ref: "#/definitions/ImieNazwiskoDataAdres"
      firmaNazwaAdres:
        $ref: "#/definitions/FirmaNazwaAdres"
    minProperties: 1
    maxProperties: 1
  kryteriaWyszukiwania:
    type: object
    properties:
      nip:
        $ref: "#/definitions/NIP"
      pesel:
        $ref: "#/definitions/PESEL"
      regon:
        $ref: "#/definitions/Regon"
      paszport:
        $ref: "#/definitions/Paszport"
      zagranicznyNumerIndentyfikacyjny:
        $ref: "#/definitions/ZagranicznyNumerIndentyfikacyjny"
      imieNazwiskoDataAdres:
        $ref: "#/definitions/ImieNazwiskoDataAdres"
      firmaNazwaAdres:
        $ref: "#/definitions/FirmaNazwaAdres"
    minProperties: 1
    maxProperties: 1
  PODMGOSP:
    type: object
    description: Dopuszalny jeden z atrybutów.
    properties:
      nip:
        $ref: "#/definitions/NIP"
      regon:
        $ref: "#/definitions/Regon"
      paszport:
        $ref: "#/definitions/Paszport"
      zagranicznyNumerIndentyfikacyjny:
        $ref: "#/definitions/ZagranicznyNumerIndentyfikacyjny"
      firmaNazwaAdres:
        $ref: "#/definitions/FirmaNazwaAdres"
      imieNazwiskoDataAdres:
        $ref: "#/definitions/ImieNazwiskoDataAdres"
    minProperties: 1
    maxProperties: 1
  OSFIZ:
    description: Dopuszalny jeden z atrybutów.
    type: object
    properties:
      pesel:
        $ref: "#/definitions/PESEL"
      nip:
        $ref: "#/definitions/NIP"
      paszport:
        $ref: "#/definitions/Paszport"
      zagranicznyNumerIndentyfikacyjny:
        $ref: "#/definitions/ZagranicznyNumerIndentyfikacyjny"
      imieNazwiskoData:
        $ref: "#/definitions/ImieNazwiskoData"
    minProperties: 1
    maxProperties: 1
  NIP:
    type: string
    example: "5364200628"
    pattern: "[1-9]((\\\\d[1-9])|([1-9]\\\\d))\\\\d{7}"
  PESEL:
    type: string
    example: "11280418054"
    pattern: "\\\\d{11}"
  Regon:
    type: string
    example: "777565683"
    pattern: "(\\\\d{9}|\\\\d{14})"
  ImieNazwisko:
    type: object
    properties:
      Imie:
        type: string
        example: Jan
        maxLength: 120
        minLength: 2
      Nazwisko:
        type: string
        example: Nowak
        maxLength: 300
        minLength: 2
    required:
      - Imie
      - Nazwisko
  ZagranicznyNumerIndentyfikacyjny:
    type: object
    properties:
      numerIdentyfikacyjny:
        type: string
        maxLength: 30
        minLength: 3
      imieNazwisko:
        $ref: "#/definitions/ImieNazwisko"
    required:
      - numerIdentyfikacyjny
    example:
      numerIdentyfikacyjny: EB123xc
      imieNazwisko:
        Imie: John
        Nazwisko: Kanen
  Adres:
    type: object
    properties:
      kodKraju:
        type: string
        example: POL
        maxLength: 3
        minLength: 3
      wojewodztwo:
        type: string
        example: ""
        maxLength: 50
      miejscowosc:
        type: string
        example: ""
        maxLength: 50
      gmina:
        type: string
        example: ""
        maxLength: 50
      kodPocztowy:
        type: string
        pattern: "^\\\\d{2}-\\\\d{3}|\\\\d{5}$"
      nrDomu:
        type: string
        maxLength: 30
      nrLokalu:
        type: string
        maxLength: 30
      poczta:
        type: string
        maxLength: 50
      powiat:
        type: string
        maxLength: 50
      Ulica:
        type: string
        maxLength: 120
    required:
      - KodPocztowy
      - Miejscowosc
      - NrDomu
  ImieNazwiskoData:
    type: object
    properties:
      imieNazwisko:
        $ref: "#/definitions/ImieNazwisko"
      dataUrodzenia:
        type: string
        example: "1999-12-24"
        pattern: "[12]\\\\d{3}-[01]\\\\d-[0123]\\\\d"
    required:
      - ImieNazwisko
      - DataUrodzenia
    minProperties: 2
  ImieNazwiskoDataAdres:
    type: object
    properties:
      imieNazwisko:
        $ref: "#/definitions/ImieNazwisko"
      dataUrodzenia:
        type: string
        pattern: "[12]\\\\d{3}-[01]\\\\d-[0123]\\\\d"
      adres:
        $ref: "#/definitions/Adres"
    required:
      - ImieNazwisko
    minProperties: 2
  FirmaNazwaAdres:
    type: object
    properties:
      firmaNazwa:
        type: string
        maxLength: 2000
      adres:
        $ref: "#/definitions/Adres"
    required:
      - FirmaNazwa
      - adres
  Paszport:
    type: object
    properties:
      nrPaszportu:
        type: string
        maxLength: 30
      imieNazwisko:
        $ref: "#/definitions/ImieNazwisko"
      kodKraju:
        type: string
        maxLength: 3
        minLength: 3
    required:
      - nrPaszportu
  Wpis:
    type: object
    properties:
      dataWyszukania:
        type: string
        pattern: "[12]\\\\d{3}-[01]\\\\d-[0123]\\\\d"
      kryteriaWyszukiwania:
        $ref: "#/definitions/kryteriaWyszukiwania"
      lacznaKwotaNaleznosciIOdsetek:
        type: string
        maxLength: 30
        pattern: "\\\\d\\\\.+\\\\d\\\\d+"
      wpisy:
        $ref: "#/definitions/ListaPozycjiNaleznosci"
  ListaPozycjiNaleznosci:
    type: array
    items:
      $ref: "#/definitions/PozycjaNaleznosci"
    minItems: 1
  PozycjaNaleznosci:
    type: object
    properties:
      oznaczenieWierzyciela:
        $ref: "#/definitions/OznaczenieWierzyciela"
      trescWpisu:
        $ref: "#/definitions/DaneNaleznosci"
  OznaczenieWierzyciela:
    type: object
    properties:
      nazwa:
        type: string
        description: Nazwa pełna wierzyciela
        maxLength: 2000
      nip:
        $ref: "#/definitions/NIP"
      adres:
        $ref: "#/definitions/Adres"
  PodstawaPrawnaNaleznosci:
    type: object
    properties:
      rodzajDokumentu:
        type: string
        maxLength: 30
      nazwaPodmiotu:
        type: string
        maxLength: 300
      nazwaOrganuWyrok:
        type: string
        maxLength: 300
      dataDecyzji:
        type: string
        format: date
        pattern: "[12]\\\\d{3}-[01]\\\\d-[0123]\\\\d"
      numerDecyzji:
        type: string
        maxLength: 128
      dataWyrokuPostanowienia:
        type: string
        format: date
        pattern: "[12]\\\\d{3}-[01]\\\\d-[0123]\\\\d"
      sygnaturaWyrokuPostanowienia:
        type: string
        maxLength: 128
      dataMandatuKarnego:
        type: string
        format: date
        pattern: "[12]\\\\d{3}-[01]\\\\d-[0123]\\\\d"
      seriaINumerMandatuKarnego:
        type: string
        maxLength: 128
      przepisPrawa:
        type: string
        maxLength: 1024
  DaneZobowiazanego:
    type: object
    properties:
      nip:
        $ref: "#/definitions/NIP"
      pesel:
        $ref: "#/definitions/PESEL"
      regon:
        $ref: "#/definitions/Regon"
      nrPaszportu:
        type: string
        description: Numer identyfikacyjy nadany w innym kraju
        maxLength: 30
      zagranicznyNumerIdentyfikacyjny:
        type: string
        maxLength: 30
      firmaNazwa:
        type: string
        description: Nazwa lub firma
        maxLength: 2000
      adres:
        $ref: "#/definitions/Adres"
      dataUrodzenia:
        type: string
        format: date
        description: data urodzenia (YYYY-MM-DD)
        example: "1999-12-24"
        pattern: "[12]\\\\d{3}-[01]\\\\d-[0123]\\\\d"
      imieNazwisko:
        $ref: "#/definitions/ImieNazwisko"
      kodKraju:
        type: string
        description: Kod kraju wydania paszportu
        maxLength: 3
        minLength: 3
  TakNie:
    type: string
    enum:
      - tak
      - nie
  Kwota:
    type: string
    pattern: "\\\\d\\\\.+\\\\d\\\\d+"
  WIP:
    type: string
    maxLength: 255
    minLength: 1
  DaneNaleznosci:
    type: object
    properties:
      zobowiazany:
        $ref: "#/definitions/DaneZobowiazanego"
      rodzajNaleznosci:
        type: string
      podstawaPrawnaNaleznosci:
        $ref: "#/definitions/PodstawaPrawnaNaleznosci"
      smiercLubUstanieBytuPrawnego:
        $ref: "#/definitions/TakNie"
      kwotaNaleznosciIOdsetek:
        $ref: "#/definitions/Kwota"
      terminPlatnosciNaleznosci:
        type: string
        format: date
        pattern: "[12]\\\\d{3}-[01]\\\\d-[0123]\\\\d"
      dataWpisaniaNaleznosciDoRNP:
        type: string
        format: date
        pattern: "[12]\\\\d{3}-[01]\\\\d-[0123]\\\\d"
      odroczenieTerminuZaplaty:
        $ref: "#/definitions/TakNie"
      rozlozenieNaRaty:
        $ref: "#/definitions/TakNie"
      postepowanieUpadlosciowe:
        $ref: "#/definitions/TakNie"
      postepowanieRestrukturyzacyjne:
        $ref: "#/definitions/TakNie"
      wstrzymanieWykonania:
        $ref: "#/definitions/TakNie"
      postepowanieAdministracyjnePodatkoweSadowoadministracyjne:
        $ref: "#/definitions/TakNie"
      postepowanieWTrybieNadzwyczajnym:
        $ref: "#/definitions/TakNie"
      sprzeciw:
        $ref: "#/definitions/TakNie"
      umorzeniePostepowaniaEgzekucyjnego:
        $ref: "#/definitions/TakNie"
      wip:
        $ref: "#/definitions/WIP"
