{
  "openapi": "3.0.1",
  "info": {
    "title": "Dokumentacja usług API IRZplus dot. zgód na przemieszczenie świń",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://irz.arimr.gov.pl/grupowe",
      "description": "Środowisko produkcyjne"
    }
  ],
  "paths": {
    "/dokument/api/prod/zzps": {
      "post": {
        "tags": [
          "Składania dokumentów"
        ],
        "operationId": "zlozDyspozycjeZZPS_1",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DyspozycjaZZPS"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ZlozenieDyspozycjiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/dokument/api/prod/zps": {
      "post": {
        "tags": [
          "Składania dokumentów"
        ],
        "operationId": "zlozDyspozycjeZPS_1",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DyspozycjaZPS"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ZlozenieDyspozycjiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/dokument/api/prod/zurs": {
      "post": {
        "tags": [
          "Składania dokumentów"
        ],
        "operationId": "zlozDyspozycjeZURS_1",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DyspozycjaZURS"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ZlozenieDyspozycjiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/swinie/api/prod/zgody-na-przemieszczenie": {
      "get": {
        "tags": [
          "Pobieranie danych - zgody na przemieszczenie świń"
        ],
        "operationId": "pobierzZgodyNaPrzemieszczenie_1",
        "parameters": [
          {
            "name": "request",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/PobieranieZgodNaPrzemieszczenieApiRequest"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PobieranieZgodNaPrzemieszczenieApiResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DyspozycjaZZPS": {
        "required": [
          "numerProducenta",
          "zgloszenie"
        ],
        "type": "object",
        "properties": {
          "komorkaOrganizacyjna": {
            "type": "string"
          },
          "numerProducenta": {
            "type": "string"
          },
          "zgloszenie": {
            "$ref": "#/components/schemas/ZgloszenieZZPSDTO"
          }
        }
      },
      "ZgloszenieZZPSDTO": {
        "type": "object",
        "properties": {
          "pozycje": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BazowaPozycja"
            }
          },
          "czyKorekta": {
            "type": "boolean"
          },
          "doDzialalnosci": {
            "type": "string"
          },
          "posrednikDzialalnosc": {
            "type": "string"
          },
          "numerIdentyfikacyjnyZwierzecia": {
            "type": "string"
          },
          "planowanaDataPrzemieszczenia": {
            "type": "string",
            "format": "date"
          },
          "planowanaLiczbaSztuk": {
            "type": "integer",
            "format": "int64"
          },
          "wniPrzewoznika": {
            "type": "string"
          },
          "niepowtarzalnyNumerRejestracyjnyPrzewoznika": {
            "type": "string"
          },
          "rodzajSrodkaTransportu": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "nrRejestracyjnySrodkaTransportu": {
            "type": "string"
          },
          "zDzialalnosci": {
            "type": "string"
          }
        }
      },
      "DyspozycjaZPS": {
        "required": [
          "numerProducenta",
          "zgloszenie"
        ],
        "type": "object",
        "properties": {
          "komorkaOrganizacyjna": {
            "type": "string"
          },
          "numerProducenta": {
            "type": "string"
          },
          "zgloszenie": {
            "$ref": "#/components/schemas/ZgloszenieZPSDTO"
          }
        }
      },
      "ZgloszenieZPSDTO": {
        "type": "object",
        "properties": {
          "pozycje": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PozycjaZPSDTO"
            }
          },
          "czyKorekta": {
            "type": "boolean"
          },
          "doDzialalnosci": {
            "type": "string"
          },
          "typZdarzenia": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "liczbaSwinPrzybylo": {
            "type": "integer",
            "format": "int32"
          },
          "kodKraju": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "dataZdarzenia": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "DyspozycjaZURS": {
        "required": [
          "numerProducenta",
          "zgloszenie"
        ],
        "type": "object",
        "properties": {
          "komorkaOrganizacyjna": {
            "type": "string"
          },
          "numerProducenta": {
            "type": "string"
          },
          "zgloszenie": {
            "$ref": "#/components/schemas/ZgloszenieZURSDTO"
          }
        }
      },
      "ZgloszenieZURSDTO": {
        "type": "object",
        "properties": {
          "pozycje": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PozycjaZURSDTO"
            }
          },
          "czyKorekta": {
            "type": "boolean"
          },
          "numerRzezni": {
            "type": "string"
          },
          "numerPartiiUboju": {
            "type": "string"
          }
        }
      },
      "PobieranieZgodNaPrzemieszczenieApiRequest": {
        "type": "object",
        "properties": {
          "doDzialalnosci": {
            "type": "string"
          },
          "posrednikDzialalnosc": {
            "type": "string"
          },
          "numerIdentyfikacyjnyZwierzecia": {
            "type": "string"
          },
          "planowanaDataPrzemieszczeniaOd": {
            "type": "string",
            "format": "date"
          },
          "planowanaDataPrzemieszczeniaDo": {
            "type": "string",
            "format": "date"
          },
          "rodzajZgody": {
            "type": "string",
            "enum": [
              "ZGODA_BEZ_BADANIA",
              "ZGODA_Z_BADANIEM",
              "BRAK_ZGODY"
            ]
          },
          "numerProducenta": {
            "type": "string"
          },
          "numerDokumentuZgloszenia": {
            "type": "string"
          },
          "zdzialalnosci": {
            "type": "string"
          }
        }
      },
      "PobieranieZgodNaPrzemieszczenieApiResponse": {
        "type": "object",
        "properties": {
          "komunikat": {
            "type": "string"
          },
          "listaZgodNaPrzemieszczenieSwin": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ZgodaNaPrzemieszczenieApiResponse"
            }
          }
        }
      },
      "ZgodaNaPrzemieszczenieApiResponse": {
        "type": "object",
        "properties": {
          "doDzialalnosci": {
            "type": "string"
          },
          "posrednikDzialalnosc": {
            "type": "string"
          },
          "numerIdentyfikacyjnyZwierzecia": {
            "type": "string"
          },
          "planowanaDataPrzemieszczenia": {
            "type": "string",
            "format": "date"
          },
          "planowanaLiczbaSztuk": {
            "type": "integer",
            "format": "int64"
          },
          "rodzajZgody": {
            "type": "string",
            "enum": [
              "ZGODA_BEZ_BADANIA",
              "ZGODA_Z_BADANIEM",
              "BRAK_ZGODY"
            ]
          },
          "numerDokumentuZgloszenia": {
            "type": "string"
          },
          "dataWydaniaZgody": {
            "type": "string"
          },
          "informacjaOJednostceIW": {
            "type": "string"
          },
          "wniPrzewoznika": {
            "type": "string"
          },
          "niepowtarzalnyNumerRejestracyjnyPrzewoznika": {
            "type": "string"
          },
          "rodzajSrodkaTransportu": {
            "type": "string"
          },
          "nrRejestracyjnySrodkaTransportu": {
            "type": "string"
          },
          "zDzialalnosci": {
            "type": "string"
          }
        }
      },
      "ZlozenieDyspozycjiResponse": {
        "type": "object",
        "properties": {
          "komunikat": {
            "type": "string"
          },
          "bledy": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BladWalidacjiDTO"
            }
          },
          "numerDokumentu": {
            "type": "string"
          }
        }
      },
      "PozycjaZPSDTO": {
        "type": "object",
        "properties": {
          "lp": {
            "type": "integer",
            "format": "int64"
          },
          "statusPozycji": {
            "type": "string",
            "enum": [
              "ZATWIERDZONA",
              "DO_ZATWIERDZENIA",
              "POMINIETA"
            ]
          },
          "liczbaSwinUbylo": {
            "type": "integer",
            "format": "int32"
          },
          "transportWlasny": {
            "type": "boolean"
          },
          "wniPrzewoznika": {
            "type": "string"
          },
          "numerIdentyfikacyjnyZwierzecia": {
            "type": "string"
          },
          "rodzajSrodkaTransportu": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "nrRejestracyjnySrodkaTransportu": {
            "type": "string"
          },
          "kategoriaZwierzecia": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KategoriaZwierzeciaDTO"
            }
          },
          "numeryLochy": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IdentyfikatorLochy"
            }
          },
          "godzinaPrzemieszczenia": {
            "$ref": "#/components/schemas/LocalTime"
          },
          "numerDokumentuZZPS": {
            "type": "string"
          },
          "zDzialalnosci": {
            "type": "string"
          }
        }
      },
      "PozycjaZURSDTO": {
        "type": "object",
        "properties": {
          "lp": {
            "type": "integer",
            "format": "int64"
          },
          "statusPozycji": {
            "type": "string",
            "enum": [
              "ZATWIERDZONA",
              "DO_ZATWIERDZENIA",
              "POMINIETA"
            ]
          },
          "przyjeteZDzialalnosci": {
            "type": "string"
          },
          "dataPrzyjeciaDoRzezni": {
            "type": "string",
            "format": "date"
          },
          "dataUboju": {
            "type": "string",
            "format": "date"
          },
          "typZdarzenia": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "krajWwozu": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "liczbaSwin": {
            "type": "integer",
            "format": "int32"
          },
          "wniPrzewoznika": {
            "type": "string"
          },
          "rodzajSrodkaTransportu": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "nrRejestracyjnySrodkaTransportu": {
            "type": "string"
          },
          "transportWlasny": {
            "type": "boolean"
          },
          "numerIdentyfikacyjnyZwierzecia": {
            "type": "string"
          },
          "kategoriaZwierzecia": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KategoriaZwierzeciaZKlasyfikacjaTuszDTO"
            }
          },
          "numerDokumentuZZPS": {
            "type": "string"
          }
        }
      },
      "BazowaPozycja": {
        "type": "object",
        "properties": {
          "lp": {
            "type": "integer",
            "format": "int64"
          },
          "statusPozycji": {
            "type": "string",
            "enum": [
              "ZATWIERDZONA",
              "DO_ZATWIERDZENIA",
              "POMINIETA"
            ]
          }
        }
      },
      "KodOpisWartosciDto": {
        "type": "object",
        "properties": {
          "kod": {
            "type": "string"
          },
          "opis": {
            "type": "string"
          }
        }
      },
      "BladWalidacjiDTO": {
        "type": "object",
        "properties": {
          "kodBledu": {
            "type": "string"
          },
          "komunikat": {
            "type": "string"
          }
        }
      },
      "KategoriaZwierzeciaDTO": {
        "type": "object",
        "properties": {
          "kategoriaZwierzecia": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "liczbaSztuk": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "IdentyfikatorLochy": {
        "type": "object",
        "properties": {
          "indywidualnyNumerIdentyfikacyjnyLochy": {
            "type": "string"
          }
        }
      },
      "LocalTime": {
        "type": "object",
        "properties": {
          "hour": {
            "type": "integer",
            "format": "int32"
          },
          "minute": {
            "type": "integer",
            "format": "int32"
          },
          "second": {
            "type": "integer",
            "format": "int32"
          },
          "nano": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "KategoriaZwierzeciaZKlasyfikacjaTuszDTO": {
        "type": "object",
        "properties": {
          "kategoriaZwierzecia": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "liczbaSztuk": {
            "type": "integer",
            "format": "int32"
          },
          "klasyfikacjaTusz": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KlasyfikacjaTuszDTO"
            }
          }
        }
      },
      "KlasyfikacjaTuszDTO": {
        "type": "object",
        "properties": {
          "klasyfikacjaTuszy": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "liczbaSztuk": {
            "type": "integer",
            "format": "int32"
          },
          "masaCialaZwierzecia": {
            "type": "number",
            "format": "double"
          },
          "masaTuszy": {
            "type": "number",
            "format": "double"
          },
          "klasyfikacjaTuszLoch": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KlasyfikacjaTuszyLochyDTO"
            }
          }
        }
      },
      "KlasyfikacjaTuszyLochyDTO": {
        "type": "object",
        "properties": {
          "klasyfikacjaTuszy": {
            "$ref": "#/components/schemas/KodOpisWartosciDto"
          },
          "indywidualnyNumerIdentyfikacyjnyLochy": {
            "type": "string"
          },
          "masaCialaZwierzecia": {
            "type": "number",
            "format": "double"
          },
          "masaTuszy": {
            "type": "number",
            "format": "double"
          }
        }
      }
    }
  }
}