swagger: '2.0'
info:
  description: Product store mapping microservice.
  version: 0.0.1
  title: Product store mapping
host: qa-ows-product-store-mapping.theorchard.io
basePath: /
schemes:
- https
paths:
  /mapping/product/{product_id}/store/{dms_id}:
    get:
      summary: Retrieving a product with tracks from the store mapping.
      produces:
      - application/json
      parameters:
        - in: header
          name: Content-Type
          pattern: ^application/json$
          required: true
          type: string
        - in: header
          name: Correlation-Id
          required: true
          type: string
        - name: product_id
          in: path
          required: true
          type: integer
        - name: dms_id
          in: path
          required: true
          type: integer
      responses:
        '200':
          description: |
            200 OK
  /mapping/product/{product_id}/store/{store_id}/product:
    get:
      summary: Get a product level store mapping for this dms.
      produces:
      - application/json
      parameters:
        - in: header
          name: Content-Type
          pattern: ^application/json$
          required: true
          type: string
          default: application/json
        - in: header
          name: Correlation-Id
          required: true
          type: string
        - name: product_id
          in: path
          required: true
          type: integer
        - name: store_id
          in: path
          required: true
          type: integer
      responses:
        '200':
          description: |
            dictionary of mapping data.
    post:
      summary: Save mapping data for specific product.
      operationId: saveMappingData
      produces:
      - application/json
      parameters:
        - in: header
          name: Content-Type
          pattern: ^application/json$
          required: true
          type: string
          default: application/json
        - in: body
          name: body
          schema:
            example:
              {
                "provider": "Orchard",
                "video_order_id": "USALL0300140",
                "store_unique_id": 0
              }
        - name: product_id
          in: path
          required: true
          type: integer
        - name: store_id
          in: path
          required: true
          type: integer
      responses:
        '200':
          description: |
            HTTP 200 OK
            -----------
            dictionary of mapping data.
            {
              "product_id": 1024,
              "store_id": 463,
              "provider": "Orchard",
              "video_order_id": "USALL0300140",
              "store_unique_id": 0
            }
        '400':
          description: |
            HTTP 400 Bad Request
            -----------
            {
              "code": "InvalidInput",
              "message": "product_id, store_id, provider and video_order_id all are required."
            }
    delete:
      summary: Delete mapping data for specific product.
      operationId: deleteMappingData
      produces:
      - application/json
      parameters:
        - in: header
          name: Content-Type
          pattern: ^application/json$
          required: true
          type: string
          default: application/json
        - name: product_id
          in: path
          required: true
          type: integer
        - name: store_id
          in: path
          required: true
          type: integer
      responses:
        '200':
          description: |
            HTTP 200 OK
            -----------
            {
              "success": "mapping deleted succssfully"
            }
  /mapping/track/{track_unique_id}/store/{dms_id}/track:
    get:
      summary: Get a track level store mapping for this dms.
      produces:
      - application/json
      parameters:
        - in: header
          name: Content-Type
          pattern: ^application/json$
          required: true
          type: string
          default: application/json
        - in: header
          name: Correlation-Id
          required: true
          type: string
        - name: track_unique_id
          in: path
          required: true
          type: integer
        - name: dms_id
          in: path
          required: true
          type: integer
      responses:
        '200':
          description: |
            dictionary of mapping data.

definitions: {}
securityDefinitions: {}
