openapi: 3.0.0 info: version: '1.1' title: MDR Gateway API description: Usługa umożliwiająca przesyłanie sprawozdań MDR contact: name: Aplikacje Krytyczne url: 'http://akmf.pl' servers: - url: 'https://mdr-testte.mf.gov.pl/api/' description: test - url: 'https://mdr.mf.gov.pl/api/' description: produkcja x-governance: owner: Ministerstwo Finansów status: project paths: /mdr/upload: post: tags: - MDR summary: Przesyłanie pliku MDR description: Przesyła plik MDR wraz z metadanymi requestBody: content: multipart/form-data: schema: type: object required: - meta - xml properties: meta: $ref: '#/components/schemas/metadane' xml: $ref: '#/components/schemas/plikMdr' signature: # może występować więcej niż raz, każdy musi być poprawny $ref: '#/components/schemas/podpisXadesDetached' # encoding: meta: contentType: application/json xml: contentType: application/xml signature: contentType: application/xml responses: '201': description: żądanie MDR zostało utworzone content: application/json: schema: $ref: '#/components/schemas/mdrStatus' '400': description: błędne dane żądania content: application/json: schema: $ref: '#/components/schemas/errorResponse' '500': description: błąd przetwarzania content: application/json: schema: $ref: '#/components/schemas/errorResponse' '/mdr/{requestId}/status': get: tags: - MDR summary: Pobieranie statusu MDR description: >- Pobiera status przetwarzania żądania przesłania pliku MDR na podstawie podanej wartości requestId parameters: - name: requestId in: path description: Numer żadania przesłania dokumentu required: true schema: type: string responses: '200': description: zwraca status pliku MDR content: application/json: schema: $ref: '#/components/schemas/mdrStatus' '404': description: żądanie nie istnieje content: application/json: schema: $ref: '#/components/schemas/errorResponse' '500': description: błąd przetwarzania content: application/json: schema: $ref: '#/components/schemas/errorResponse' '/mdr/{requestId}/upo': get: tags: - UPO summary: Pobieranie UPO dla MDR description: >- Pobiera Urzędowe Poświadczenie Odbioru (UPO) dla przetworzonych żądań MDR parameters: - name: requestId in: path description: Numer żadania przesłania dokumentu required: true schema: type: string responses: '200': description: plik UPO content: application/xml: schema: $ref: '#/components/schemas/upoFileXml' application/pdf: schema: $ref: '#/components/schemas/upoFilePdf' '404': description: żądanie nie istnieje content: application/json: schema: $ref: '#/components/schemas/errorResponse' '500': description: błąd przetwarzania content: application/json: schema: $ref: '#/components/schemas/errorResponse' '/nsp/{nspId}/status': get: tags: - NSP summary: Pobieranie statusu NSP description: Pobiera status NSP na podstawie podanego nspId parameters: - name: nspId in: path description: Numer żadania przesłania dokumentu required: true schema: type: string responses: '200': description: pomyślnie pobrano status NSP content: application/json: schema: $ref: '#/components/schemas/nspStatus' '404': description: nie znaleziono NSP o podanym numerze content: application/json: schema: $ref: '#/components/schemas/errorResponse' components: schemas: errorResponse: type: object description: Identyfikator i opis błędu required: - kodBledu - opisBledu properties: kodBledu: description: kod błędu type: integer opisBledu: description: tekstowy opis błędu type: string requestId: description: unikalny identyfikator żądania w formacie UUID type: string dodatkoweInformacje: description: dodatkowe informacje o błędzie type: string mdrStatus: type: object description: Status żądania przesłania MDR required: - requestId - kod - opis properties: requestId: description: unikalny identyfikator żądania w formacie UUID type: string kod: description: kod błędu type: integer opis: description: tekstowy opis błędu type: string sumaKontrolna: type: object description: Sumy kontrolne pliku required: - md5 - sha properties: md5: type: string sha: type: string metadane: type: object description: Metadane żądania required: - email - nazwaPliku - sumaKontrolna properties: email: type: string nazwaPliku: type: string sumaKontrolna: $ref: '#/components/schemas/sumaKontrolna' plikMdr: description: Plik MDR w formacie XML type: string format: binary podpisXadesDetached: description: Podpis w formacie Xades Detached type: string format: binary upoFilePdf: description: Urzędowe Poświadczenie Odbioru (UPO) w formacie PDF type: string format: binary upoFileXml: description: Urzędowe Poświadczenie Odbioru (UPO) w formacie XML type: string format: xml nspStatus: description: Status NSP type: object required: - status properties: status: type: string enum: - pending - valid - invalidated