# Slouží k vytvoření objednávky. Odpověď je v header (Location)

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /order/batch:
    post:
      summary: Slouží k vytvoření objednávky. Odpověď je v header (Location)
      deprecated: false
      description: ''
      operationId: CreateOrders
      tags:
        - API Metody/OrderBatch
        - OrderBatch
      parameters:
        - 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:
          application/json:
            schema:
              type: object
              x-apidog-refs:
                01JJRFBVP6PQRZ26030DSFDQYB:
                  $ref: >-
                    #/components/schemas/Eps.Api.MyApi2.Web.Models.OrderBatch.CreateOrderBatchModel
                  x-apidog-overrides:
                    orders: &ref_10
                      minItems: 1
                      type: array
                      items:
                        type: object
                        x-apidog-refs:
                          01JJRFC8MYB0S4GEE2X1XMWHAW: &ref_12
                            $ref: >-
                              #/components/schemas/Eps.Api.MyApi2.Web.Models.OrderBatch.OrderModel
                            x-apidog-overrides:
                              orderType: &ref_7
                                $ref: >-
                                  #/components/schemas/Eps.Api.MyApi2.Web.Models.Enum.OrderType
                                description: |-
                                  Typ objednávky: 
                                  CollectionOrder – objednání svozu, 
                                  TransportOrder – objednávková 
                                  přeprava (Balík z libovolné adresy)
                              sender: &ref_8
                                oneOf:
                                  - type: object
                                    x-apidog-refs:
                                      01JJRFGP3X5STZ4HP1WBDBK518: &ref_13
                                        $ref: >-
                                          #/components/schemas/Eps.Api.MyApi2.Web.Models.OrderBatch.SenderAddressModel
                                        x-apidog-overrides:
                                          country: &ref_0
                                            minLength: 1
                                            type: string
                                            description: |-
                                              Kód země podle číselníku Délka 2

                                              Pokud se jedná o mezinárodní zásilku 
                                              (PackProductType = IMPO), pak 
                                              country příjemce se nesmí rovnat 
                                              country odesílatele a zároveň je pak 
                                              toto pole je povinné.

                                              Pokud se jedná o tuzemskou zásilku 
                                              (PackProductType = BUSS), pak 
                                              country příjemce se musí rovnat country 
                                              odesílatele
                                          phone: &ref_1
                                            maxLength: 30
                                            type: string
                                            description: |-
                                              Telefon Délka: 30
                                              Vyplněný kontaktní údaj výrazně 
                                              zvyšuje úspěšnost doručení
                                            nullable: true
                                          email: &ref_2
                                            maxLength: 50
                                            type: string
                                            description: |-
                                              Email Délka: 50
                                              Vyplněný kontaktní údaj výrazně 
                                              zvyšuje úspěšnost doručení
                                            nullable: true
                                        required:
                                          - country
                                    x-apidog-orders:
                                      - 01JJRFGP3X5STZ4HP1WBDBK518
                                    properties:
                                      name:
                                        maxLength: 250
                                        type: string
                                        description: 'Název firmy / jméno Délka: 250'
                                        nullable: true
                                      name2:
                                        maxLength: 250
                                        type: string
                                        description: 'Dodatek (Název firmy / jméno) Délka: 250'
                                        nullable: true
                                      street:
                                        maxLength: 60
                                        type: string
                                        description: 'Ulice Délka: 60'
                                        nullable: true
                                      city:
                                        maxLength: 50
                                        type: string
                                        description: 'Město Délka: 50'
                                        nullable: true
                                      zipCode:
                                        maxLength: 10
                                        minLength: 1
                                        type: string
                                        description: 'PSČ Délka: 10'
                                      country: *ref_0
                                      contact:
                                        maxLength: 50
                                        type: string
                                        description: 'Kontaktní osoba. Délka: 50'
                                        nullable: true
                                      phone: *ref_1
                                      email: *ref_2
                                    required:
                                      - zipCode
                                      - country
                                    x-apidog-ignore-properties:
                                      - name
                                      - name2
                                      - street
                                      - city
                                      - zipCode
                                      - country
                                      - contact
                                      - phone
                                      - email
                                  - &ref_6
                                    $ref: '#/components/schemas/EmptyNullableObject'
                              recipient: &ref_9
                                oneOf:
                                  - type: object
                                    x-apidog-refs:
                                      01JJRFN82M1C41Y0ATEEHNW4P6: &ref_14
                                        $ref: >-
                                          #/components/schemas/Eps.Api.MyApi2.Web.Models.OrderBatch.RecipientAddressModel
                                        x-apidog-overrides:
                                          country: &ref_3
                                            minLength: 1
                                            type: string
                                            description: >-
                                              Kód země podle číselníku
                                              /codelist/country Délka 2


                                              Pokud se jedná o mezinárodní zásilku 

                                              (PackProductType = CONN), pak 

                                              country příjemce se nesmí rovnat 

                                              country odesílatele a zároveň je pak 

                                              toto pole je povinné.


                                              Pokud se jedná o tuzemskou zásilku 

                                              (PackProductType = BUSS), pak 

                                              country příjemce se musí rovnat country 

                                              odesílatele
                                          phone: &ref_4
                                            maxLength: 30
                                            type: string
                                            description: |
                                              Telefon Délka: 30
                                              Vyplněný kontaktní údaj výrazně 
                                              zvyšuje úspěšnost doručení
                                            nullable: true
                                          email: &ref_5
                                            maxLength: 50
                                            type: string
                                            description: |
                                              Email Délka: 50
                                              Vyplněný kontaktní údaj výrazně 
                                              zvyšuje úspěšnost doručení
                                            nullable: true
                                        required:
                                          - country
                                    x-apidog-orders:
                                      - 01JJRFN82M1C41Y0ATEEHNW4P6
                                    properties:
                                      name:
                                        maxLength: 250
                                        type: string
                                        description: 'Název firmy / jméno Délka: 250'
                                        nullable: true
                                      name2:
                                        maxLength: 250
                                        type: string
                                        description: 'Dodatek (Název firmy / jméno) Délka: 250'
                                        nullable: true
                                      street:
                                        maxLength: 60
                                        type: string
                                        description: 'Ulice Délka: 60'
                                        nullable: true
                                      city:
                                        maxLength: 50
                                        type: string
                                        description: 'Město Délka: 50'
                                        nullable: true
                                      zipCode:
                                        maxLength: 10
                                        minLength: 1
                                        type: string
                                        description: 'PSČ Délka: 10'
                                      country: *ref_3
                                      contact:
                                        maxLength: 50
                                        type: string
                                        description: 'Kontaktní osoba. Délka: 50'
                                        nullable: true
                                      phone: *ref_4
                                      email: *ref_5
                                    required:
                                      - zipCode
                                      - country
                                    x-apidog-ignore-properties:
                                      - name
                                      - name2
                                      - street
                                      - city
                                      - zipCode
                                      - country
                                      - contact
                                      - phone
                                      - email
                                  - *ref_6
                                description: |-
                                  Příjemce
                                  Pokud je svoz ( CollectionOrder ) 
                                  NEYPLŇUJE SE
                            required:
                              - orderType
                        x-apidog-orders:
                          - 01JJRFC8MYB0S4GEE2X1XMWHAW
                        properties:
                          orderType: *ref_7
                          referenceId:
                            maxLength: 50
                            minLength: 1
                            type: string
                            description: Jedinečná reference!
                          shipmentCount:
                            maximum: 2147483647
                            minimum: 1
                            type: integer
                            description: 'Počet balíků Max: 50 Délka: 2'
                            format: int32
                          email:
                            maxLength: 100
                            type: string
                            description: 'Notifikační email pro objednavatele Délka: 2'
                            nullable: true
                          note:
                            maxLength: 300
                            type: string
                            description: Poznámka Délka 50
                            nullable: true
                          customerReference:
                            maxLength: 40
                            type: string
                            description: 'Zákaznická reference. Délka: 9,2'
                            nullable: true
                          sendDate:
                            type: string
                            description: 'Datum odeslání Délka: 9,2'
                            format: date-time
                          sendTimeFrom:
                            type: string
                            description: Čas odeslání od
                            format: date-span
                            nullable: true
                          sendTimeTo:
                            type: string
                            description: Čas odeslání do
                            format: date-span
                            nullable: true
                          productType:
                            type: string
                            description: 'BUSS / IMPO Délka: 4'
                            nullable: true
                          sender: *ref_8
                          recipient: *ref_9
                        required:
                          - orderType
                          - referenceId
                          - shipmentCount
                          - sendDate
                        x-apidog-ignore-properties:
                          - orderType
                          - referenceId
                          - shipmentCount
                          - email
                          - note
                          - customerReference
                          - sendDate
                          - sendTimeFrom
                          - sendTimeTo
                          - productType
                          - sender
                          - recipient
                      description: Objednávky
                  required:
                    - orders
              x-apidog-orders:
                - 01JJRFBVP6PQRZ26030DSFDQYB
              properties:
                orders: *ref_10
              required:
                - orders
              x-apidog-ignore-properties:
                - orders
            example: ''
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
                x-apidog-ignore-properties: []
          headers:
            X-Correlation-ID:
              description: Correlation Id of request otherwise id of response
              schema:
                $ref: '#/components/schemas/XCorrelationIdSchema'
            Location:
              description: Newly created entity location
              schema:
                type: string
          x-apidog-name: Created
        '400':
          description: BadRequest
          content:
            application/problem+json:
              schema:
                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
                x-apidog-orders:
                  - 01JJM1T57Q7MR935YK7NW4AM69
                x-apidog-refs:
                  01JJM1T57Q7MR935YK7NW4AM69: &ref_11
                    $ref: >-
                      #/components/schemas/Eps.Api.Infrastructure.WebApi.Model.ProblemJsonModel
                x-apidog-ignore-properties:
                  - errors
                  - type
                  - title
                  - status
                  - detail
                  - instance
          headers: {}
          x-apidog-name: Bad Request
        '500':
          description: InternalServerError
          content:
            application/problem+json:
              schema:
                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
                x-apidog-orders:
                  - 01JJM1TDVYYNDP2NSCRPM0NTT2
                x-apidog-refs:
                  01JJM1TDVYYNDP2NSCRPM0NTT2: *ref_11
                x-apidog-ignore-properties:
                  - errors
                  - type
                  - title
                  - status
                  - detail
                  - instance
          headers: {}
          x-apidog-name: Server Error
        '503':
          description: ServiceUnavailable
          content:
            application/problem+json:
              schema:
                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
                x-apidog-orders:
                  - 01JJM1TPK65DBF1FN902Z3A8DN
                x-apidog-refs:
                  01JJM1TPK65DBF1FN902Z3A8DN: *ref_11
                x-apidog-ignore-properties:
                  - errors
                  - type
                  - title
                  - status
                  - detail
                  - instance
          headers: {}
          x-apidog-name: Service Unavailable
      security: []
      x-apidog-folder: API Metody/OrderBatch
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/796227/apis/api-13465910-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.MyApi2.Web.Models.OrderBatch.CreateOrderBatchModel:
      required:
        - orders
      type: object
      properties:
        orders:
          minItems: 1
          type: array
          items: *ref_12
          description: Objednávky
      additionalProperties: false
      description: Create order batch model
      x-apidog-orders:
        - orders
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    Eps.Api.MyApi2.Web.Models.OrderBatch.OrderModel:
      required:
        - orderType
        - referenceId
        - shipmentCount
        - sendDate
      type: object
      properties:
        orderType: *ref_7
        referenceId:
          maxLength: 50
          minLength: 1
          type: string
          description: Jedinečná reference!
        shipmentCount:
          maximum: 2147483647
          minimum: 1
          type: integer
          description: 'Počet balíků Max: 50 Délka: 2'
          format: int32
        email:
          maxLength: 100
          type: string
          description: 'Notifikační email pro objednavatele Délka: 2'
          nullable: true
        note:
          maxLength: 300
          type: string
          description: Poznámka Délka 50
          nullable: true
        customerReference:
          maxLength: 40
          type: string
          description: 'Zákaznická reference. Délka: 9,2'
          nullable: true
        sendDate:
          type: string
          description: 'Datum odeslání Délka: 9,2'
          format: date-time
        sendTimeFrom:
          type: string
          description: Čas odeslání od
          format: date-span
          nullable: true
        sendTimeTo:
          type: string
          description: Čas odeslání do
          format: date-span
          nullable: true
        productType:
          type: string
          description: 'BUSS / IMPO Délka: 4'
          nullable: true
        sender:
          oneOf:
            - *ref_13
            - *ref_6
        recipient:
          oneOf:
            - *ref_14
            - *ref_6
      additionalProperties: false
      description: Order model
      x-apidog-orders:
        - orderType
        - referenceId
        - shipmentCount
        - email
        - note
        - customerReference
        - sendDate
        - sendTimeFrom
        - sendTimeTo
        - productType
        - sender
        - recipient
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    Eps.Api.MyApi2.Web.Models.OrderBatch.RecipientAddressModel:
      required:
        - zipCode
        - country
      type: object
      properties:
        name:
          maxLength: 250
          type: string
          description: 'Název firmy / jméno Délka: 250'
          nullable: true
        name2:
          maxLength: 250
          type: string
          description: 'Dodatek (Název firmy / jméno) Délka: 250'
          nullable: true
        street:
          maxLength: 60
          type: string
          description: 'Ulice Délka: 60'
          nullable: true
        city:
          maxLength: 50
          type: string
          description: 'Město Délka: 50'
          nullable: true
        zipCode:
          maxLength: 10
          minLength: 1
          type: string
          description: 'PSČ Délka: 10'
        country:
          minLength: 1
          type: string
          description: Kód země podle číselníku Délka 2
        contact:
          maxLength: 50
          type: string
          description: 'Kontaktní osoba. Délka: 50'
          nullable: true
        phone:
          maxLength: 30
          type: string
          description: 'Telefon Délka: 30'
          nullable: true
        email:
          maxLength: 50
          type: string
          description: 'Email Délka: 50'
          nullable: true
      additionalProperties: false
      description: Recipient address model
      x-apidog-orders:
        - name
        - name2
        - street
        - city
        - zipCode
        - country
        - contact
        - phone
        - email
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    EmptyNullableObject:
      description: Injected nullable object
      type: 'null'
      x-apidog-folder: ''
    Eps.Api.MyApi2.Web.Models.OrderBatch.SenderAddressModel:
      required:
        - zipCode
        - country
      type: object
      properties:
        name:
          maxLength: 250
          type: string
          description: 'Název firmy / jméno Délka: 250'
          nullable: true
        name2:
          maxLength: 250
          type: string
          description: 'Dodatek (Název firmy / jméno) Délka: 250'
          nullable: true
        street:
          maxLength: 60
          type: string
          description: 'Ulice Délka: 60'
          nullable: true
        city:
          maxLength: 50
          type: string
          description: 'Město Délka: 50'
          nullable: true
        zipCode:
          maxLength: 10
          minLength: 1
          type: string
          description: 'PSČ Délka: 10'
        country:
          minLength: 1
          type: string
          description: Kód země podle číselníku Délka 2
        contact:
          maxLength: 50
          type: string
          description: 'Kontaktní osoba. Délka: 50'
          nullable: true
        phone:
          maxLength: 30
          type: string
          description: 'Telefon Délka: 30'
          nullable: true
        email:
          maxLength: 50
          type: string
          description: 'Email Délka: 50'
          nullable: true
      additionalProperties: false
      description: Sender address model
      x-apidog-orders:
        - name
        - name2
        - street
        - city
        - zipCode
        - country
        - contact
        - phone
        - email
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    Eps.Api.MyApi2.Web.Models.Enum.OrderType:
      enum:
        - CollectionOrder
        - TransportOrder
      type: string
      description: Order type
      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: ''
  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: []

```
