# Slouží k uložení celních dokumentů k zásilce

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /shipment/{shipmentNumber}/documents:
    post:
      summary: Slouží k uložení celních dokumentů k zásilce
      deprecated: false
      description: >-
        ## Význam a použití

        Tato metoda slouží k nahrání celních dokumentů k existující zásilce do
        systému PPL. Používá se u mezinárodních zásilek, kde je potřeba k
        zásilce připojit celní dokumentaci (faktury, proforma faktury, celní
        prohlášení apod.), která je nutná pro celní odbavení.


        ### Parametry

        **Path parametry:**


        **shipmentNumber** (string, povinný) — číslo zásilky, ke které se
        dokumenty nahrávají. Zásilka musí již existovat v systému PPL (tj.
        musela být předtím vytvořena přes [POST
        /shipment/batch](https://ppl-cpl-api.apidog.io/vytvo%C5%99en%C3%AD-z%C3%A1silky-13465914e0)).


        **Query parametry:**


        **documentFileType** (povinný) — typ nahrávaného dokumentu. Hodnoty musí
        odpovídat číselníku [„Typy dokumentů"
        (codelist/documentType)](https://ppl-cpl-api.apidog.io/typy-dokument%C5%AF-27079525e0),
        který je k dispozici v sekci Codelist v dokumentaci. V jednom requestu
        lze vždy nahrávat pouze jeden typ dokumentu. Pokud k zásilce patří více
        typů dokumentů, je nutné je nahrát zvlašť zavoláním dalšího requestu.


        ### Body:


        **files** — samotný soubor (nebo soubory) s celním dokumentem. Nahrává
        se jako multipart/form-data, tedy standardní file upload.


        **Omezení pro soubory:**


        - Podporované formáty: pdf, doc, docx, xls, xlsx, jpg, jpeg, png, odt,
        ods, txt

        - Maximální velikost všech souborů na jeden request: 1 MB

        - Maximální počet souborů na jeden request: 5


        ### Typický workflow


        1. Vytvořit zásilku přes [POST
        /shipment/batch](https://ppl-cpl-api.apidog.io/vytvo%C5%99en%C3%AD-z%C3%A1silky-13465914e0)
        → metodou [GET
        /shipment/batch/{batchId}](https://ppl-cpl-api.apidog.io/z%C3%ADsk%C3%A1n%C3%AD-stavu-importu-z%C3%A1silky-13465916e0)
        počkat na stav Complete a získat shipmentNumber

        2. Zjistit a vybrat povolené typy dokumentů z [GET
        /codelist/documentFileType](https://ppl-cpl-api.apidog.io/typy-dokument%C5%AF-27079525e0)

        3. Nahrát celní dokumenty přes tento endpoint

        4. V případě potřeby ověřit stav zásilky přes [GET
        /shipment/{shipmentNumber}](https://ppl-cpl-api.apidog.io/slou%C5%BE%C3%AD-k-z%C3%ADsk%C3%A1n%C3%AD-informac%C3%AD-trackingu-k-z%C3%A1silce-13465913e0)
      tags:
        - API Metody/Shipment
        - Shipment
      parameters:
        - name: shipmentNumber
          in: path
          description: Identifikátor zásilky
          required: true
          example: ''
          schema:
            type: string
        - name: documentFileType
          in: query
          description: Typ souboru dokumentu - vybírejte z GET /codelist/documentFileType
          required: true
          schema:
            type: string
        - name: Accept-Language
          in: header
          description: 'Language specification, default language: cs-CZ'
          required: false
          example: ''
          schema:
            $ref: '#/components/schemas/AcceptLanguageSchema'
        - name: X-Correlation-ID
          in: header
          description: Correlation Id of request
          required: false
          example: ''
          schema:
            $ref: '#/components/schemas/XCorrelationIdSchema'
        - name: X-LogLevel
          in: header
          description: The forced log level
          required: false
          example: ''
          schema:
            $ref: '#/components/schemas/XLogLevelSchema'
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: >-
                    Podporované soubory jsou "pdf", "doc", "docx", "xls",
                    "xlsx","jpg", "jpeg", "png", "odt", "ods","txt"

                    maximální velikost souboru na jeden request je 1 MB

                    Maximální počet souborů je 5 souborů na jeden request
                  example: ''
              required:
                - files
            examples: {}
      responses:
        '200':
          description: Success
          headers:
            X-Correlation-ID:
              description: Correlation Id of request otherwise id of response
              schema:
                $ref: '#/components/schemas/XCorrelationIdSchema'
          x-apidog-name: ''
        '400':
          description: BadRequest
          content:
            application/problem+json:
              schema: &ref_1
                $ref: >-
                  #/components/schemas/Eps.Api.Infrastructure.WebApi.Model.ProblemJsonModel
          headers: {}
          x-apidog-name: ''
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema: &ref_0
                $ref: >-
                  #/components/schemas/Eps.Api.Infrastructure.WebApi.Model.ProblemJsonBasicModel
          headers:
            WWW-Authenticate:
              description: >-
                Contains reason of 401 result -
                https://tools.ietf.org/html/rfc6750#section-3
              schema:
                type: string
            X-Correlation-ID:
              description: Correlation Id of request otherwise id of response
              schema:
                $ref: '#/components/schemas/XCorrelationIdSchema'
          x-apidog-name: ''
        '403':
          description: Unauthorized
          content:
            application/problem+json:
              schema: *ref_0
          headers:
            X-Correlation-ID:
              description: Correlation Id of request otherwise id of response
              schema:
                $ref: '#/components/schemas/XCorrelationIdSchema'
          x-apidog-name: ''
        '404':
          description: NotFound
          content:
            application/problem+json:
              schema: *ref_1
          headers: {}
          x-apidog-name: ''
        '500':
          description: Server Error
          content:
            application/json:
              schema: *ref_0
          headers:
            X-Correlation-ID:
              description: Correlation Id of request otherwise id of response
              schema:
                $ref: '#/components/schemas/XCorrelationIdSchema'
          x-apidog-name: ''
        '503':
          description: Server Error
          content:
            application/json:
              schema: *ref_0
          headers:
            X-Correlation-ID:
              description: Correlation Id of request otherwise id of response
              schema:
                $ref: '#/components/schemas/XCorrelationIdSchema'
          x-apidog-name: ''
      security:
        - Bearer: []
          x-apidog:
            schemeGroups:
              - id: riWzK7M2z0l36aTKczGvi
                schemeIds:
                  - Bearer
            required: true
            use:
              id: riWzK7M2z0l36aTKczGvi
            scopes:
              riWzK7M2z0l36aTKczGvi:
                Bearer: []
      x-apidog-folder: API Metody/Shipment
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/796227/apis/api-27079527-run
components:
  schemas:
    AcceptLanguageSchema:
      type: string
      description: Accept-Language header schema
      x-apidog-folder: ''
    XCorrelationIdSchema:
      type: string
      description: X-Correlation-ID header schema
      x-apidog-folder: ''
    XLogLevelSchema:
      enum:
        - Trace
        - Debug
        - Information
        - Warning
        - Error
        - Critical
      type: string
      description: X-LogLevel header schema
      x-apidog-folder: ''
    Eps.Api.Infrastructure.WebApi.Model.ProblemJsonModel:
      type: object
      properties:
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          x-apidog-orders: []
          properties: {}
          x-apidog-ignore-properties: []
          nullable: true
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties:
        type: string
      x-apidog-orders:
        - errors
        - type
        - title
        - status
        - detail
        - instance
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    Eps.Api.Infrastructure.WebApi.Model.ProblemJsonBasicModel:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties:
        type: string
      x-apidog-orders:
        - type
        - title
        - status
        - detail
        - instance
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    oauth2:
      type: apikey
      description: Get access token from authentication server.
      name: Authorization
      in: header
    Bearer:
      type: jwt
      description: >-
        JWT Authorization header using the Bearer scheme. Example:
        "Authorization: Bearer {token}"
      scheme: bearer
      bearerFormat: JWT
servers: []
security: []

```
