openapi: 3.0.0
info:
  title: 'MES API'
  description: 'MES API Documentation. '
  version: 1.0.0
servers:
  -
    url: 'http://displate.loc/external-api/'
    description: 'Local Development'
  -
    url: 'https://uat01.displate.com/external-api/'
    description: UAT
  -
    url: 'https://displate.com/external-api/'
    description: Production
paths:
  '/v1/dtp/orders/{orderItemId}/pdf-url':
    get:
      tags:
        - MES_API_V1
      description: 'Get print file URL for a specific order item.'
      operationId: getPrintFileUrlV1
      parameters:
        -
          name: orderItemId
          in: path
          description: 'Order Item ID'
          required: true
          schema:
            type: integer
      responses:
        200:
          description: 'Print file URL fetched successfully.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPrintFileUrlResponseV1'
        500:
          description: 'Internal server error'
  /v1/dtp/orders/comments:
    get:
      tags:
        - MES_API_V1
      description: 'Get comments for orders for a given time period.'
      operationId: getCommentsForOrdersV1
      parameters:
        -
          $ref: '#/components/parameters/GetCommentsFromV1'
        -
          $ref: '#/components/parameters/GetCommentsToV1'
      responses:
        200:
          description: 'Comments fetched successfully.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCommentsResponseV1'
        400:
          description: 'Validation error'
  '/v1/dtp/print-orders/{orderId}/suspend':
    post:
      tags:
        - MES_API_V1
      description: 'Suspend a print order with a reason.'
      operationId: suspendOrderV1
      parameters:
        -
          name: orderId
          in: path
          description: 'Order ID'
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SuspendOrderRequestV1'
      responses:
        200:
          description: 'Order suspended successfully.'
        400:
          description: 'Validation error'
        422:
          description: 'Invalid order ID'
  /v1/product-passport-data:
    post:
      tags:
        - MES_API_V1
      description: 'Store product passport data for a product.'
      operationId: storeProductPassportDataV1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StoreProductPassportDataRequestV1'
      responses:
        200:
          description: 'Product passport data stored successfully.'
        500:
          description: 'Internal server error'
  '/v1/shipping/orders/{orderId}/label':
    post:
      tags:
        - MES_API_V1
      description: 'Generate a shipping label for a specific order.'
      operationId: generateLabelV1
      parameters:
        -
          name: orderId
          in: path
          description: 'Order ID'
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateLabelRequestV1'
      responses:
        200:
          description: 'Label generated successfully.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateLabelResponseV1'
        400:
          description: 'Validation error'
        409:
          description: 'Carrier error'
        500:
          description: 'Internal server error'
  '/v1/dtp/orders/{id}/send':
    post:
      tags:
        - MES_API_V1
      description: 'Mark an order as sent.'
      operationId: markOrderAsSendV1
      parameters:
        -
          name: id
          in: path
          description: 'Order ID'
          required: true
          schema:
            type: integer
      responses:
        200:
          description: 'Order marked as sent successfully.'
        404:
          description: 'Order not found'
        500:
          description: 'Internal server error'
  /v1/dtp/orders/send:
    post:
      tags:
        - MES_API_V1
      description: 'Mark multiple orders as sent.'
      operationId: markOrdersAsSendV1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendOrdersRequestV1'
      responses:
        200:
          description: 'Orders marked as sent successfully.'
        500:
          description: 'Internal server error'
  '/v1/dtp/print/file/{sku}':
    get:
      tags:
        - MES_API_V1
      description: 'Get print file URL by SKU.'
      operationId: getPrintFileV1
      parameters:
        -
          name: sku
          in: path
          description: 'Product SKU'
          required: true
          schema:
            type: string
      responses:
        200:
          description: 'Print file URL fetched successfully.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPrintFileUrlResponseV1'
        500:
          description: 'Internal server error'
  /v2/dtp/orders/comments:
    get:
      tags:
        - MES_API_V2
      description: 'Get comments for orders for a given time period and fulfillment center.'
      operationId: getCommentsForOrdersV2
      parameters:
        -
          $ref: '#/components/parameters/GetCommentsFromV2'
        -
          $ref: '#/components/parameters/GetCommentsToV2'
        -
          $ref: '#/components/parameters/GetCommentsFulfillmentCenterV2'
      responses:
        200:
          description: 'Comments fetched successfully.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCommentsResponseV2'
        400:
          description: 'Validation error'
  '/v3/shipping/orders/{orderId}/labels':
    get:
      tags:
        - MES_API_V3
      description: 'Get shipping labels for a specific order.'
      operationId: getOrderLabelsV3
      parameters:
        -
          name: orderId
          in: path
          description: 'Order ID'
          required: true
          schema:
            type: integer
      responses:
        200:
          description: 'Order labels fetched successfully.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrderLabelsResponseV3'
        400:
          description: 'Validation error'
        404:
          description: 'Order not found'
  /v4/dtp/alpha/orders:
    get:
      tags:
        - MES_API_V4_ALPHA
      description: 'Get dpt orders for a given time period and fulfillment center.'
      operationId: getDtpOrdersV4Alpha
      parameters:
        -
          $ref: '#/components/parameters/GetDtpOrdersFromV4'
        -
          $ref: '#/components/parameters/GetDtpOrdersToV4'
      responses:
        200:
          description: 'Dtp orders fetched successfully.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDtpOrdersResponseV4'
  /v4/dtp/alpha/orders/detailed:
    get:
      tags:
        - MES_API_V4_ALPHA
      description: 'Get detailed orders for a given time period, fulfillment center and filters.'
      operationId: getDetailedOrdersV4Alpha
      parameters:
        -
          $ref: '#/components/parameters/GetDetailedOrdersPageV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersFromV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersToV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersOrderTypeIdV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersIsPaymentReceivedInFullV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersIsRefundedV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersIsCanceledV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersFormatIdV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersProductUpgradeMaskV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersBrandIdV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersItemTypeIdV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersIsSuspendedV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersShowPdfUrlV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersReferrerV4'
      responses:
        200:
          description: 'Detailed orders fetched successfully.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDetailedOrdersResponseV4'
  /v4/dtp/orders:
    get:
      tags:
        - MES_API_V4
      description: 'Get dpt orders for a given time period and fulfillment center.'
      operationId: getDtpOrdersV4
      parameters:
        -
          $ref: '#/components/parameters/GetDtpOrdersFromV4'
        -
          $ref: '#/components/parameters/GetDtpOrdersToV4'
      responses:
        200:
          description: 'Dtp orders fetched successfully.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDtpOrdersResponseV4'
  /v4/dtp/orders/detailed:
    get:
      tags:
        - MES_API_V4
      description: 'Get detailed orders for a given time period, fulfillment center and filters.'
      operationId: getDetailedOrdersV4
      parameters:
        -
          $ref: '#/components/parameters/GetDetailedOrdersPageV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersFromV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersToV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersOrderTypeIdV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersIsPaymentReceivedInFullV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersIsRefundedV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersIsCanceledV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersFormatIdV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersProductUpgradeMaskV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersBrandIdV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersItemTypeIdV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersIsSuspendedV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersShowPdfUrlV4'
        -
          $ref: '#/components/parameters/GetDetailedOrdersReferrerV4'
      responses:
        200:
          description: 'Detailed orders fetched successfully.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDetailedOrdersResponseV4'
  /v5/dtp/orders:
    get:
      tags:
        - MES_API_V5
      description: 'Get dpt orders for a given time period and fulfillment center.'
      operationId: getDtpOrdersV5
      parameters:
        -
          $ref: '#/components/parameters/GetDtpOrdersFromV5'
        -
          $ref: '#/components/parameters/GetDtpOrdersToV5'
        -
          $ref: '#/components/parameters/GetDtpOrdersFulfillmentCenterV5'
      responses:
        200:
          description: 'Dtp orders fetched successfully.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDtpOrdersResponseV5'
  /v5/dtp/orders/detailed:
    get:
      tags:
        - MES_API_V5
      description: 'Get detailed orders for a given time period, fulfillment center and filters.'
      operationId: getDetailedOrdersV5
      parameters:
        -
          $ref: '#/components/parameters/GetDetailedOrdersPageV5'
        -
          $ref: '#/components/parameters/GetDetailedOrdersFromV5'
        -
          $ref: '#/components/parameters/GetDetailedOrdersToV5'
        -
          $ref: '#/components/parameters/GetDetailedOrdersFulfillmentCenterV5'
        -
          $ref: '#/components/parameters/GetDetailedOrdersOrderTypeIdV5'
        -
          $ref: '#/components/parameters/GetDetailedOrdersIsPaymentReceivedInFullV5'
        -
          $ref: '#/components/parameters/GetDetailedOrdersIsRefundedV5'
        -
          $ref: '#/components/parameters/GetDetailedOrdersIsCanceledV5'
        -
          $ref: '#/components/parameters/GetDetailedOrdersFormatIdV5'
        -
          $ref: '#/components/parameters/GetDetailedOrdersProductUpgradeMaskV5'
        -
          $ref: '#/components/parameters/GetDetailedOrdersBrandIdV5'
        -
          $ref: '#/components/parameters/GetDetailedOrdersItemTypeIdV5'
        -
          $ref: '#/components/parameters/GetDetailedOrdersIsSuspendedV5'
        -
          $ref: '#/components/parameters/GetDetailedOrdersShowPdfUrlV5'
        -
          $ref: '#/components/parameters/GetDetailedOrdersReferrerV5'
      responses:
        200:
          description: 'Detailed orders fetched successfully.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDetailedOrdersResponseV5'
  '/v5/dtp/orders/{orderId}/reject':
    post:
      tags:
        - MES_API_V5
      description: 'Reject an order.'
      operationId: rejectOrderV5
      parameters:
        -
          $ref: '#/components/parameters/RejectOrderOrderIdV5'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RejectOrderRequestRequestV5'
      responses:
        200:
          description: 'Order rejected successfully.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RejectOrderResponseV5'
components:
  schemas:
    GenerateLabelRequestV1:
      description: 'Request to generate a shipping label for an order.'
      required:
        - carrierName
      properties:
        carrierName:
          description: 'Carrier name for label generation.'
          type: string
          enum:
            - dhl
            - dhlparcel
            - fedex
            - ups
            - lodzups
            - amazonups
            - fedexroad
          example: dhl
      type: object
    GetCommentsRequestV1:
      description: "Request to get order's comments for given date range."
      required:
        - from
        - to
    SendOrdersRequestV1:
      description: 'Request to mark multiple orders as sent.'
      required:
        - orderIds
      properties:
        orderIds:
          description: 'Array of order IDs to mark as sent. Must contain at least one ID.'
          type: array
          items:
            type: integer
            minimum: 1
          minItems: 1
          example:
            - 12345
            - 67890
            - 11111
      type: object
    StoreProductPassportDataRequestV1:
      description: 'Request to store product passport data.'
      required:
        - itemId
        - formatId
        - productUpgradeMask
        - itemTypeId
        - printingDate
        - printingPlace
        - referenceNumber
      properties:
        itemId:
          description: 'Item ID'
          type: integer
          example: 12345
        orderItemId:
          description: 'Order Item ID (optional)'
          type: integer
          example: 67890
          nullable: true
        formatId:
          description: 'Format ID'
          type: integer
          example: 1
        productUpgradeMask:
          description: 'Product upgrade mask'
          type: integer
          example: 0
        itemTypeId:
          description: 'Item type ID'
          type: integer
          enum:
            - 1
            - 2
            - 3
            - 6
          example: 1
        serial:
          description: 'Serial number (optional)'
          type: string
          example: SN123456
          nullable: true
        printingDate:
          description: 'Printing date in Y-m-d format'
          type: string
          format: date
          example: '2025-01-15'
        printingPlace:
          description: 'Printing place'
          type: string
          example: 'Factory A'
        referenceNumber:
          description: 'Reference number'
          type: string
          example: REF-2025-001
      type: object
    SuspendOrderRequestV1:
      description: 'Request to suspend an order with a reason.'
      required:
        - reason
      properties:
        reason:
          description: 'Reason for suspending the order. Max 120 characters, alphanumeric with spaces, dots, commas and hyphens.'
          type: string
          maxLength: 120
          pattern: '^[a-z0-9 \.,\-]+$'
          example: 'Customer requested delay'
      type: object
    GenerateLabelResponseV1:
      title: 'Generate Label Response'
      required:
        - label
        - tracking
        - name
      properties:
        label:
          description: 'Base64 encoded label image.'
          type: string
        tracking:
          description: 'Tracking number.'
          type: string
        name:
          description: 'Carrier name.'
          type: string
      type: object
    GetCommentsResponseV1:
      title: 'Get Comments Response'
      required:
        - data
        - metadata
      properties:
        data:
          description: 'List of order comments.'
          type: array
          items:
            $ref: '#/components/schemas/GetCommentsResponseItemV1'
        metadata:
          $ref: '#/components/schemas/GetCommentsResponseMetadataV1'
      type: object
    GetCommentsResponseItemV1:
      title: 'Order Comment Response Item'
      required:
        - orderId
        - comment
      properties:
        orderId:
          description: 'Order identifier.'
          type: integer
          example: 8506893
        comment:
          description: 'Comment assigned to the order.'
          type: string
          example: 'Sample comment'
      type: object
    GetCommentsResponseMetadataV1:
      title: 'Get Comments Response Metadata'
      required:
        - from
        - to
      properties:
        from:
          description: 'Start date of the requested range.'
          type: string
          format: date
          example: '2025-10-01'
        to:
          description: 'End date of the requested range.'
          type: string
          format: date
          example: '2025-10-02'
      type: object
    GetPrintFileUrlResponseV1:
      title: 'Get Print File URL Response'
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/GetPrintFileUrlResponseDataV1'
      type: object
    GetPrintFileUrlResponseDataV1:
      title: 'Print File Data'
      required:
        - pdfUrl
      properties:
        pdfUrl:
          description: 'URL to the PDF print file.'
          type: string
          format: uri
      type: object
    GetCommentsRequestV2:
      description: "Request to get order's comments for given date range."
      required:
        - from
        - to
    GetCommentsResponseV2:
      title: 'Get Comments Response'
      required:
        - data
        - metadata
      properties:
        data:
          description: 'List of order comments.'
          type: array
          items:
            $ref: '#/components/schemas/OrderCommentResponseItemV2'
        metadata:
          $ref: '#/components/schemas/GetCommentsResponseMetadataV2'
      type: object
    GetCommentsResponseMetadataV2:
      title: 'Get Comments Response Metadata'
      required:
        - from
        - to
      properties:
        from:
          description: 'Start date of the requested range.'
          type: string
          format: date
          example: '2025-10-01'
        to:
          description: 'End date of the requested range.'
          type: string
          format: date
          example: '2025-10-02'
      type: object
    OrderCommentResponseItemV2:
      title: 'Order Comment Response Item'
      required:
        - orderId
        - comment
      properties:
        orderId:
          description: 'Order identifier.'
          type: integer
          example: 8506893
        comment:
          description: 'Comment assigned to the order.'
          type: string
          example: 'Sample comment'
      type: object
    GetOrderLabelsResponseV3:
      title: 'Get Order Labels Response'
      required:
        - labels
      properties:
        labels:
          description: 'List of order labels.'
          type: array
          items:
            $ref: '#/components/schemas/GetOrderLabelsResponseItemV3'
      type: object
    GetOrderLabelsResponseItemV3:
      title: 'Order Label Item'
      required:
        - trackingNumbers
        - carrier
      properties:
        trackingNumbers:
          description: 'List of tracking numbers.'
          type: array
          items:
            type: string
        carrier:
          description: 'Carrier name.'
          type: string
        base64LabelImage:
          description: 'Base64 encoded label image.'
          type: string
          nullable: true
      type: object
    GetDetailedOrdersRequestV4:
      description: 'Get detailed orders data for given date range and filters.'
      required:
        - page
        - from
        - to
    GetDtpOrdersRequestV4:
      description: 'Get orders data for given date range and fulfillment centers.'
      required:
        - from
        - to
    GetDetailedOrdersResponseV4:
      title: 'Get Detailed Orders Response'
      required:
        - data
        - metadata
      properties:
        data:
          description: 'List of detailed orders item'
          type: array
          items:
            $ref: '#/components/schemas/GetDetailedOrdersResponseItemV4'
        metadata:
          $ref: '#/components/schemas/MetadataV4'
      type: object
    GetDetailedOrdersResponseItemV4:
      title: 'Get Detailed Orders Response Item'
      required:
        - orderItemId
        - isRefunded
        - isCanceled
        - isPaymentReceivedInFull
        - hasSubscription
        - isSuspended
        - carrierId
        - trackingNumbers
        - referrer
      properties:
        orderItemId:
          description: 'Order item ID'
          type: string
        isRefunded:
          description: 'Is refunded'
          type: boolean
        isCanceled:
          description: 'Is canceled'
          type: boolean
        isPaymentReceivedInFull:
          description: 'Is payment received in full'
          type: boolean
        pdfUrl:
          description: 'PDF URL'
          type: string
          nullable: true
        hasSubscription:
          description: 'Has subscription'
          type: boolean
        isSuspended:
          description: 'Is suspended'
          type: boolean
        carrierId:
          description: 'Carrier ID'
          type: integer
        trackingNumbers:
          description: 'Tracking numbers'
          type: array
          items:
            type: string
        referrer:
          description: Referrer
          type: string
      type: object
    GetDtpOrdersResponseV4:
      title: 'Get Dtp Orders Response'
      required:
        - data
        - metadata
      properties:
        data:
          description: 'List of DTP orders'
          type: array
          items:
            $ref: '#/components/schemas/GetDtpOrdersResponseRowV4'
        metadata:
          $ref: '#/components/schemas/MetadataV4'
      type: object
    GetDtpOrdersResponseRowV4:
      title: 'Get Dtp Orders Response Row'
      required:
        - order
        - item
        - payment
        - shipment
        - extras
      properties:
        order:
          $ref: '#/components/schemas/GetDtpOrderResponseRowOrderV4'
        item:
          $ref: '#/components/schemas/GetDtpOrdersResponseRowItemV4'
        payment:
          $ref: '#/components/schemas/GetDtpOrderResponseRowPaymentV4'
        shipment:
          $ref: '#/components/schemas/GetDtpOrderResponseRowShipmentV4'
        extras:
          $ref: '#/components/schemas/GetDtpOrderResponseRowExtrasV4'
      type: object
    GetDtpOrderResponseRowExtrasV4:
      title: 'Get Dtp Orders Response Row Extras'
      required:
        - holograms
      properties:
        holograms:
          description: 'List of holograms.'
          type: array
          items:
            type: string
      type: object
    GetDtpOrdersResponseRowItemV4:
      title: 'Get Dtp Orders Response Row Item'
      required:
        - id
        - itemTypeId
        - formatId
        - productUpgradeMask
        - limitedCounter
        - imageUrl
        - itemCollectionId
        - sku
      properties:
        id:
          description: 'Item ID'
          type: integer
        itemTypeId:
          description: 'Item type ID'
          type: integer
        formatId:
          description: 'Format ID'
          type: integer
        productUpgradeMask:
          description: 'Product upgrade mask'
          type: integer
        limitedCounter:
          description: 'Limited counter'
          type: integer
        imageUrl:
          description: 'Image URL'
          type: string
        itemCollectionId:
          description: 'Item collection ID'
          type: integer
        sku:
          description: SKU
          type: string
      type: object
    GetDtpOrderResponseRowOrderV4:
      title: 'Get Dtp Order Response Row Order'
      required:
        - orderId
        - orderItemId
        - orderTypeId
        - referrer
      properties:
        orderId:
          description: 'Order ID'
          type: string
        orderItemId:
          description: 'Order item ID'
          type: string
        orderTypeId:
          description: 'Order type ID'
          type: integer
        referrer:
          description: Referrer
          type: string
      type: object
    GetDtpOrderResponseRowPaymentV4:
      title: 'Get Dtp Order Response Row Payment'
      required:
        - isReceivedInFull
        - receiveDate
        - isRefunded
        - isCanceled
        - hasSubscription
      properties:
        isReceivedInFull:
          description: 'Is received in full'
          type: boolean
        receiveDate:
          description: 'Receive date'
          type: string
        isRefunded:
          description: 'Is refunded'
          type: boolean
        isCanceled:
          description: 'Is canceled'
          type: boolean
        hasSubscription:
          description: 'Has subscription'
          type: boolean
      type: object
    GetDtpOrderResponseRowShipmentV4:
      title: 'Get Dtp Order Response Row Shipment'
      required:
        - quantity
        - carrierId
        - addressCountryCode
        - addressCity
        - addressZip
        - export
      properties:
        quantity:
          description: Quantity
          type: integer
        carrierId:
          description: 'Carrier ID'
          type: integer
        addressCountryCode:
          description: 'Address country code'
          type: string
        addressState:
          description: 'Address state'
          type: string
          nullable: true
        addressCity:
          description: 'Address city'
          type: string
        addressZip:
          description: 'Address ZIP'
          type: string
        internalComment:
          description: 'Internal comment'
          type: string
        export:
          description: Export
          type: string
      type: object
    MetadataV4:
      title: Metadata
      required:
        - count
        - paginator
      properties:
        count:
          description: 'Total count'
          type: integer
        paginator:
          $ref: '#/components/schemas/PaginatorV4'
      type: object
    PaginatorV4:
      title: Paginator
      required:
        - currentPage
        - perPage
        - pages
      properties:
        currentPage:
          description: 'Current page'
          type: integer
        perPage:
          description: 'Items per page'
          type: integer
        pages:
          description: 'Total number of pages'
          type: integer
      type: object
    GetDetailedOrdersRequestV5:
      description: 'Get detailed orders data for given date range and filters.'
      required:
        - page
        - from
        - to
    GetDtpOrdersRequestV4Alpha:
      description: 'Get orders data for given date range and fulfillment centers.'
      required:
        - from
        - to
    RejectOrderRequestRequestV5:
      description: 'Request to reject an order with a reason.'
      required:
        - reason
      properties:
        reason:
          description: 'Rejection reason'
          type: string
          maxLength: 120
          enum:
            - invalid_file
            - printer_issue
            - adult_content
          example: printer_issue
      type: object
    GetDetailedOrdersResponseV5:
      title: 'Get Detailed Orders Response'
      required:
        - data
        - metadata
      properties:
        data:
          description: 'List of detailed orders item'
          type: array
          items:
            $ref: '#/components/schemas/GetDetailedOrdersResponseItemV5'
        metadata:
          $ref: '#/components/schemas/MetadataV5'
      type: object
    GetDetailedOrdersResponseItemV5:
      title: 'Get Detailed Orders Response Item'
      required:
        - orderItemId
        - isRefunded
        - isCanceled
        - isPaymentReceivedInFull
        - hasSubscription
        - isSuspended
        - carrierId
        - trackingNumbers
        - referrer
      properties:
        orderItemId:
          description: 'Order item ID'
          type: string
        isRefunded:
          description: 'Is refunded'
          type: boolean
        isCanceled:
          description: 'Is canceled'
          type: boolean
        isPaymentReceivedInFull:
          description: 'Is payment received in full'
          type: boolean
        pdfUrl:
          description: 'PDF URL'
          type: string
          nullable: true
        hasSubscription:
          description: 'Has subscription'
          type: boolean
        isSuspended:
          description: 'Is suspended'
          type: boolean
        carrierId:
          description: 'Carrier ID'
          type: integer
        trackingNumbers:
          description: 'Tracking numbers'
          type: array
          items:
            type: string
        referrer:
          description: Referrer
          type: string
      type: object
    GetDtpOrdersResponseV5:
      title: 'Get Dtp Orders Response'
      required:
        - data
        - metadata
      properties:
        data:
          description: 'List of DTP orders'
          type: array
          items:
            $ref: '#/components/schemas/GetDtpOrdersResponseRowV5'
        metadata:
          $ref: '#/components/schemas/MetadataV5'
      type: object
    GetDtpOrdersResponseRowV5:
      title: 'Get Dtp Orders Response Row'
      required:
        - order
        - item
        - payment
        - shipment
        - extras
      properties:
        order:
          $ref: '#/components/schemas/GetDtpOrderResponseRowOrderV5'
        item:
          $ref: '#/components/schemas/GetDtpOrdersResponseRowItemV5'
        payment:
          $ref: '#/components/schemas/GetDtpOrderResponseRowPaymentV5'
        shipment:
          $ref: '#/components/schemas/GetDtpOrderResponseRowShipmentV5'
        extras:
          $ref: '#/components/schemas/GetDtpOrderResponseRowExtrasV5'
      type: object
    GetDtpOrderResponseRowExtrasV5:
      title: 'Get Dtp Orders Response Row Extras'
      required:
        - holograms
      properties:
        holograms:
          description: 'List of holograms.'
          type: array
          items:
            type: string
      type: object
    GetDtpOrdersResponseRowItemV5:
      title: 'Get Dtp Orders Response Row Item'
      required:
        - id
        - itemTypeId
        - formatId
        - productUpgradeMask
        - limitedCounter
        - imageUrl
        - itemCollectionId
        - sku
      properties:
        id:
          description: 'Item ID'
          type: integer
        itemTypeId:
          description: 'Item type ID'
          type: integer
        formatId:
          description: 'Format ID'
          type: integer
        productUpgradeMask:
          description: 'Product upgrade mask'
          type: integer
        limitedCounter:
          description: 'Limited counter'
          type: integer
        imageUrl:
          description: 'Image URL'
          type: string
        itemCollectionId:
          description: 'Item collection ID'
          type: integer
        sku:
          description: SKU
          type: string
      type: object
    GetDtpOrderResponseRowOrderV5:
      title: 'Get Dtp Order Response Row Order'
      required:
        - orderId
        - orderItemId
        - orderTypeId
        - referrer
        - fulfillmentCenter
        - priority
      properties:
        orderId:
          description: 'Order ID'
          type: string
        orderItemId:
          description: 'Order item ID'
          type: string
        orderTypeId:
          description: 'Order type ID'
          type: integer
        referrer:
          description: Referrer
          type: string
        fulfillmentCenter:
          description: 'Fulfillment center'
          type: string
        priority:
          description: Priority
          type: integer
      type: object
    GetDtpOrderResponseRowPaymentV5:
      title: 'Get Dtp Order Response Row Payment'
      required:
        - isReceivedInFull
        - receiveDate
        - isRefunded
        - isCanceled
        - hasSubscription
      properties:
        isReceivedInFull:
          description: 'Is received in full'
          type: boolean
        receiveDate:
          description: 'Receive date'
          type: string
        isRefunded:
          description: 'Is refunded'
          type: boolean
        isCanceled:
          description: 'Is canceled'
          type: boolean
        hasSubscription:
          description: 'Has subscription'
          type: boolean
      type: object
    GetDtpOrderResponseRowShipmentV5:
      title: 'Get Dtp Order Response Row Shipment'
      required:
        - quantity
        - carrierId
        - addressCountryCode
        - addressCity
        - addressZip
        - export
      properties:
        quantity:
          description: Quantity
          type: integer
        carrierId:
          description: 'Carrier ID'
          type: integer
        addressCountryCode:
          description: 'Address country code'
          type: string
        addressState:
          description: 'Address state'
          type: string
          nullable: true
        addressCity:
          description: 'Address city'
          type: string
        addressZip:
          description: 'Address ZIP'
          type: string
        internalComment:
          description: 'Internal comment'
          type: string
        export:
          description: Export
          type: string
      type: object
    MetadataV5:
      title: Metadata
      required:
        - count
        - paginator
      properties:
        count:
          description: 'Total count'
          type: integer
        paginator:
          $ref: '#/components/schemas/PaginatorV5'
      type: object
    PaginatorV5:
      title: Paginator
      required:
        - currentPage
        - perPage
        - pages
      properties:
        currentPage:
          description: 'Current page'
          type: integer
        perPage:
          description: 'Items per page'
          type: integer
        pages:
          description: 'Total number of pages'
          type: integer
      type: object
    RejectOrderResponseV5:
      title: 'Reject Order Response'
  parameters:
    GetCommentsFromV1:
      name: from
      in: query
      description: 'Start date in Y-m-d format'
      required: true
      schema:
        type: string
        format: date
      example: '2025-01-01'
    GetCommentsToV1:
      name: to
      in: query
      description: 'End date in Y-m-d format'
      required: true
      schema:
        type: string
        format: date
      example: '2025-01-31'
    GetCommentsFromV2:
      name: from
      in: query
      description: 'Start date in Y-m-d format'
      required: true
      schema:
        type: string
        format: date
      example: '2025-01-01'
    GetCommentsToV2:
      name: to
      in: query
      description: 'End date in Y-m-d format'
      required: true
      schema:
        type: string
        format: date
      example: '2025-01-31'
    GetCommentsFulfillmentCenterV2:
      name: fulfillment_center
      in: query
      description: 'Fulfillment center codes'
      required: true
      schema:
        type: array
        items:
          type: string
          enum:
            - MFC
            - KFC
    GetDetailedOrdersPageV4:
      name: page
      in: query
      description: 'Page number'
      required: true
      schema:
        type: integer
        minimum: 1
      example: 1
    GetDetailedOrdersFromV4:
      name: from
      in: query
      description: 'Start date as Unix timestamp'
      required: true
      schema:
        type: integer
      example: 1735689600
    GetDetailedOrdersToV4:
      name: to
      in: query
      description: 'End date as Unix timestamp'
      required: true
      schema:
        type: integer
      example: 1738281600
    GetDetailedOrdersOrderTypeIdV4:
      name: orderTypeId
      in: query
      description: 'Order type ID filter'
      required: false
      schema:
        type: integer
    GetDetailedOrdersIsPaymentReceivedInFullV4:
      name: isPaymentReceivedInFull
      in: query
      description: 'Filter by payment received in full status'
      required: false
      schema:
        type: boolean
    GetDetailedOrdersIsRefundedV4:
      name: isRefunded
      in: query
      description: 'Filter by refunded status'
      required: false
      schema:
        type: boolean
    GetDetailedOrdersIsCanceledV4:
      name: isCanceled
      in: query
      description: 'Filter by canceled status'
      required: false
      schema:
        type: boolean
    GetDetailedOrdersFormatIdV4:
      name: formatId
      in: query
      description: 'Format ID filter'
      required: false
      schema:
        type: integer
    GetDetailedOrdersProductUpgradeMaskV4:
      name: productUpgradeMask
      in: query
      description: 'Product upgrade mask filter'
      required: false
      schema:
        type: integer
    GetDetailedOrdersBrandIdV4:
      name: brandId
      in: query
      description: 'Brand ID filter'
      required: false
      schema:
        type: integer
    GetDetailedOrdersItemTypeIdV4:
      name: itemTypeId
      in: query
      description: 'Item type ID filter'
      required: false
      schema:
        type: integer
    GetDetailedOrdersIsSuspendedV4:
      name: isSuspended
      in: query
      description: 'Filter by suspended status'
      required: false
      schema:
        type: boolean
    GetDetailedOrdersShowPdfUrlV4:
      name: showPdfUrl
      in: query
      description: 'Include PDF URL in response'
      required: false
      schema:
        type: boolean
    GetDetailedOrdersReferrerV4:
      name: referrer
      in: query
      description: 'Referrer filter'
      required: false
      schema:
        type: string
    GetDtpOrdersPageV4:
      name: page
      in: query
      description: 'Page number'
      schema:
        type: integer
      example: 2
    GetDtpOrdersFromV4:
      name: from
      in: query
      description: 'Start date as Unix timestamp'
      required: true
      schema:
        type: integer
      example: 1735689600
    GetDtpOrdersToV4:
      name: to
      in: query
      description: 'End date as Unix timestamp'
      required: true
      schema:
        type: integer
      example: 1738281600
    GetDetailedOrdersPageV5:
      name: page
      in: query
      description: 'Page number'
      required: true
      schema:
        type: integer
        minimum: 1
      example: 1
    GetDetailedOrdersFromV5:
      name: from
      in: query
      description: 'Start date as Unix timestamp'
      required: true
      schema:
        type: integer
      example: 1735689600
    GetDetailedOrdersToV5:
      name: to
      in: query
      description: 'End date as Unix timestamp'
      required: true
      schema:
        type: integer
      example: 1738281600
    GetDetailedOrdersFulfillmentCenterV5:
      name: fulfillment_center
      in: query
      description: 'Fulfillment center codes'
      required: false
      schema:
        type: array
        items:
          type: string
          enum:
            - MFC
            - KFC
    GetDetailedOrdersOrderTypeIdV5:
      name: orderTypeId
      in: query
      description: 'Order type ID filter'
      required: false
      schema:
        type: integer
    GetDetailedOrdersIsPaymentReceivedInFullV5:
      name: isPaymentReceivedInFull
      in: query
      description: 'Filter by payment received in full status'
      required: false
      schema:
        type: boolean
    GetDetailedOrdersIsRefundedV5:
      name: isRefunded
      in: query
      description: 'Filter by refunded status'
      required: false
      schema:
        type: boolean
    GetDetailedOrdersIsCanceledV5:
      name: isCanceled
      in: query
      description: 'Filter by canceled status'
      required: false
      schema:
        type: boolean
    GetDetailedOrdersFormatIdV5:
      name: formatId
      in: query
      description: 'Format ID filter'
      required: false
      schema:
        type: integer
    GetDetailedOrdersProductUpgradeMaskV5:
      name: productUpgradeMask
      in: query
      description: 'Product upgrade mask filter'
      required: false
      schema:
        type: integer
    GetDetailedOrdersBrandIdV5:
      name: brandId
      in: query
      description: 'Brand ID filter'
      required: false
      schema:
        type: integer
    GetDetailedOrdersItemTypeIdV5:
      name: itemTypeId
      in: query
      description: 'Item type ID filter'
      required: false
      schema:
        type: integer
    GetDetailedOrdersIsSuspendedV5:
      name: isSuspended
      in: query
      description: 'Filter by suspended status'
      required: false
      schema:
        type: boolean
    GetDetailedOrdersShowPdfUrlV5:
      name: showPdfUrl
      in: query
      description: 'Include PDF URL in response'
      required: false
      schema:
        type: boolean
    GetDetailedOrdersReferrerV5:
      name: referrer
      in: query
      description: 'Referrer filter'
      required: false
      schema:
        type: string
    GetDtpOrdersPageV5:
      name: page
      in: query
      description: 'Page number'
      schema:
        type: integer
      example: 2
    GetDtpOrdersFromV5:
      name: from
      in: query
      description: 'Start date as Unix timestamp'
      required: true
      schema:
        type: integer
      example: 1735689600
    GetDtpOrdersToV5:
      name: to
      in: query
      description: 'End date as Unix timestamp'
      required: true
      schema:
        type: integer
      example: 1738281600
    GetDtpOrdersFulfillmentCenterV5:
      name: fulfillment_center
      in: query
      description: 'Fulfillment center codes'
      required: true
      schema:
        type: array
        items:
          type: string
          enum:
            - MFC
            - KFC
    RejectOrderOrderIdV5:
      name: orderId
      in: path
      description: 'Order ID'
      required: true
      schema:
        type: string
  securitySchemes:
    Oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /external-api/v1/token
          scopes:
            mes: 'MES client'
tags:
  -
    name: MES_API_V1
    description: MES_API_V1
  -
    name: MES_API_V2
    description: MES_API_V2
  -
    name: MES_API_V3
    description: MES_API_V3
  -
    name: MES_API_V4_ALPHA
    description: MES_API_V4_ALPHA
  -
    name: MES_API_V4
    description: MES_API_V4
  -
    name: MES_API_V5
    description: MES_API_V5
