openapi: 3.0.0
info:
  title: Partner-Installed-Product
  version: '1.0'
  description: 'Service to retrieve public information about Installed Products warranty start/end dates by providing Serial number along with Product Range, Commercial Ref, and expose them to External consumers (Partner)'
  contact:
    name: Contact Us
    url: https://se.com
    email: distributorapiportal.global@se.com
servers:
  - url: 'https://api.qa.se.com/v1/reference-data/partner-installed-product'
    description: QA/test environment
  - url: 'https://api.se.com/v1/reference-data/partner-installed-product'
    description: Production server
paths:
  /installed-products:
    parameters: []
    get:
      summary: Get IP Warranty details
      tags: [Installed-Products]
      operationId: get-installed-products-warranty-details
      description: 'Retrieve Installed Products public details through Product Range / Serial Number / Commercial Ref. '
      parameters:
        - schema:
            type: string
          in: query
          name: serialnumber
          required: true
          description: Installed Product Serial Number
        - schema:
            type: string
          in: query
          name: commercialreference
          description: Product Commercial Reference
        - schema:
            type: string
          in: query
          name: productrange
          description: Product Range
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  serialNumber:
                    type: string
                    example: '39755175'
                    description: Installed Product Serial Number
                  warrantyStartDate:
                    type: string
                    example: '2021-07-08'
                    description: Factory Warranty Start Date of the Installed Product
                  warrantyEndDate:
                    type: string
                    description: Factory Warranty End Date of the Installed Product
                    example: '2022-07-07'
                  extendedWarrantyStartDate:
                    type: string
                    example: '2022-01-10'
                    description: Start Date of the Service Contract associated to the Installed Product (where Contract Included Service = Extended Warranty)
                  extendedWarrantyEndDate:
                    type: string
                    example: '2023-10-29'
                    description: End Date of the Service Contract associated to the Installed Product (where Contract Included Service = Extended Warranty)
                  productSku:
                    type: string
                    description: Product SKU
                    example: GALUPS300
                  productName:
                    type: string
                    description: Product Name
                    example: GALUPS-Smart 300  
              examples:
                example-1:
                  value:
                    serialNumber: '39755175'
                    warrantyStartDate: '2021-07-08'
                    warrantyEndDate: '2022-07-07'
                    extendedWarrantyStartDate: '2022-01-10'
                    extendedWarrantyEndDate: '2023-10-29'
                    productSku: GALUPS300
                    productName: GALUPS-Smart 300
        '207':
          description: Partial Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                Example 1:
                  value:
                    code: MISSING_FIELD or 12345
                    userMessage: 'Required field is missing: productSku'
                    developerMessage: 'Product master API ParseException: required tag <sku> expected'
                    moreInfo: 'https://example.com/product-master/v1/error/12345'            
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - oauth2: []
components:
  schemas:
    ErrorResponse:
      type: object
      title: Error Response - OAS3
      description: Error response returned to the consumer when an HTTP error status has occurred.
      properties:
        code:
          type: string
          example: MISSING_FIELD or 12345
          description: |-
            Service-defined error code which may be numeric or a string.

            Errors detected by the APIM platform result in the following codes.

            BAD_REQUEST (for 400)
            UNAUTHORIZED (for 401)
            FORBIDDEN (for 403)
            NOT_FOUND (for 404)
            GONE (for 410)
            PRECONDITION_FAILED (for 412)
            TOO_MANY_REQUESTS (for 429)
            INTERNAL_SERVER_ERROR (for 500)
            NOT_IMPLEMENTED (for 501)

            Any specific service validation errors would replace BAD_REQUEST.
        userMessage:
          type: string
          example: 'Request is invalid and cannot be processed due one or more issues such as syntax errors, missing required fields, out of range values, conflicting query parameters, or unknown URI.'
          description: Human-readable general description of the error.
        developerMessage:
          type: string
          description: Optional human-readable description of the error details.
          example: 'Required field is missing: productSku'
        moreInfo:
          type: string
          description: 'Optional error details or link to error documentation, which has more information about the error.'
          example: 'https://example.com/product-master/v1/error/12345'
      required:
        - code
        - userMessage
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: '/token'
          refreshUrl: ''
          scopes: {}