Mallzee eTryOn API

---
openapi: 3.0.0
info:
  version: 1.0.0
  title: We Are Unfolded eTryOn
servers:
  - url: 'https://etryon.weareunfolded.com'
security:
  - ApiKeyAuth: []

paths:
  /products/predictions:
    post:
      summary: Product performance prediction
      description: 'Predicts the performance of a product'
      operationId: productPerformance
      tags:
        - product
      requestBody:
          description: 'The details of the product and market segements being targeted to make the product prediction'
          required: true
          content:
              application/json:
                  schema:
                      $ref: '#/components/schemas/PerformanceInput'
                  examples:
                    productPrediction:
                        $ref: '#/components/examples/PerformanceInput'
      responses:
        '200':
          description: 'Product performance results'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PerformanceOutput'
              example:
                predictions:
                    -
                      demographic: '>55 & male'
                      popularity:
                          -
                            -
                              0.2345
                      items:
                          -
                            'shirts | collarless and striped'
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                  value:
                    code: 400
                    message: 'Invalid product properties'
  /products/recommendations:
    post:
      summary: Product recommendations
      description: 'Returns recommended products based on the given customer product history'
      operationId: productRecommendations
      tags:
        - products
      requestBody:
          description: 'The details of the product and current user information make the product recommendations'
          required: true
          content:
              application/json:
                  schema:
                      $ref: '#/components/schemas/RecommendationsInput'
                  examples:
                      productRecommendation:
                        $ref: '#/components/examples/RecommendationsInput'
      responses:
        '200':
          description: 'Product recommendation results'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecommendationsOutput'
              example:
                product_ids:
                    - 288517e2-3f17-4e31-b6e6-1f8d6ca5edf9
                    - 7eb602dc-975e-4642-91cf-6e069bc9cf03
                    - 29a7bb26-f826-4e06-86e1-b2fb11d1d317
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                  value:
                    code: 400
                    message: 'Invalid product properties'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header
  schemas:
    PerformanceInput:
      type: object
      properties:
          img_url:
              type: string
          img_data:
              type: string
          demographic:
              type: string
    PerformanceOutput:
        type: object
        properties:
            predictions:
                type: array
                items:
                    type: object
                    properties:
                        demographic:
                            type: string
                        primary_score:
                            type: string
                        popularity:
                            type: array
                            items:
                              type: array
                              items:
                                type: number
                                format: int32
                        items:
                            type: array
                            items:
                              type: string
    RecommendationsInput:
        type: object
        properties:
            product_ids:
                type: array
                items:
                    type: number
                    format: string
    RecommendationsOutput:
        type: object
        properties:
            product_ids:
                type: array
                items:
                    type: string
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
  examples:
    PerformanceInput:
        value:
            img_url: 'https://images.mallzee.com/products/d33e1e13-3828-4178-926b-a1ca24997136'
            demographic_group: '>55 & male'
    RecommendationsInput:
      value:
        product_ids: [550233.0, 528142.0, 392402.0, 528142.0, 612462.0, 527922.0, 110311.0, 392291.0, 762340.0, 796430.0, 612439.0]