openapi: 3.0.0
info:
  title: VisibilityIQ Customer Management
  version: 1.0.0
servers:
  - url: https://api.zebra.com/v3/services/partners
    description: For US
  - url: https://api.zebra.com/v3/eu/services/partners
    description: For EU
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /company:
    get:
      tags:
        - List of Companies/Customers
      summary: Retrieves company/customer details from VIQ
      description: Retrieves company/customer details from VIQ
      operationId: Get customer details
      parameters:
        - name: companyName
          in: header
          required: false
          style: simple
          explode: false
          schema:
            type: string
      responses:
        "200":
          description: Successfull operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiGetResponse"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiResponse401"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiResponse500"
      deprecated: false
    put:
      tags:
        - Update Company/Customer
      summary: Update customer details in VIQ
      description: Update customer details in VIQ
      operationId: Update Customer
      parameters:
        - name: companyName
          in: header
          description: Company name
          required: true
          style: simple
          explode: false
          schema:
            type: string
        - name: companyDisplayName
          in: header
          description: Descriptive name of the company.
          required: false
          style: simple
          explode: false
          schema:
            type: string
        - name: deviceType
          in: header
          description:
            If the company will enroll only Mobile Computer or Scanner or
            Printer, provide the device type. Not required if company will enroll all
            device types.
          required: false
          style: simple
          explode: false
          schema:
            type: string
        - name: contractId
          in: header
          description:
            If the company has one or more Zebra contracted devices, provide
            any one Zebra contract Id.
          required: false
          style: simple
          explode: false
          schema:
            type: string
      responses:
        "200":
          description: Successfull operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiEditResponse"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiResponse400"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiResponse401"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiResponse500"
      deprecated: false
    post:
      tags:
        - Onboard Company/Customer
      summary: Onboard customer in VIQ
      description: Onboard a new customer/company in VIQ
      operationId: Onboard Customer
      parameters:
        - name: companyName
          in: header
          description: Company name
          required: true
          style: simple
          explode: false
          schema:
            type: string
        - name: companyDisplayName
          in: header
          description: Descriptive name of the company.
          required: false
          style: simple
          explode: false
          schema:
            type: string
        - name: deviceType
          in: header
          description:
            If the company will enroll only Mobile Computer or Scanner or
            Printer, provide the device type. Not required if company will enroll all
            device types.
          required: false
          style: simple
          explode: false
          schema:
            type: string
        - name: contractId
          in: header
          description:
            If the company has one or more Zebra contracted devices, provide
            any one Zebra contract Id.
          required: false
          style: simple
          explode: false
          schema:
            type: string
      responses:
        "201":
          description: Successfull operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiResponse"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiResponse400"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiResponse401"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiResponse500"
      deprecated: false
    delete:
      tags:
        - Delete Company/Customer
      summary: Remove company/customer from VIQ
      description: Delete company/customer from VIQ
      operationId: Delete customer
      parameters:
        - name: companyName
          in: header
          description: Company name
          required: true
          style: simple
          explode: false
          schema:
            type: string
      responses:
        "200":
          description: Successfull operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiDeleteResponse"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiResponse400"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiResponse401"
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiResponse500"
      deprecated: false
components:
  schemas:
    ApiResponse400:
      required:
        - response_description
        - response_status
      type: object
      properties:
        id:
          type: string
          description: id
          example: "123"
        status:
          type: integer
          description: status
          example: 400
        code:
          type: string
          description: code
          example: 1.2.1
        title:
          type: string
          description: title
          example: "ERROR: Bad Request"
        detail:
          type: string
          description: detail
          example: Required parameter missing
        source:
          type: object
          properties:
            parameter:
              type: string
              example: companyName
            pointer:
              type: string
              example: header/companyName
          description: source
    ApiResponse401:
      required:
        - response_description
        - response_status
      type: object
      properties:
        fault:
          type: object
          properties:
            faultstring:
              type: string
              example: Invalid ApiKey
            detail:
              type: object
              properties:
                errorcode:
                  type: string
                  example: oauth.v2.InvalidApiKey
              description: detail
          description: source
    ApiResponse500:
      required:
        - response_description
        - response_status
      type: object
      properties:
        timestamp:
          type: string
          description: timestamp
          example: 2023-01-03T12:10:00
        status:
          type: integer
          description: status
          example: 500
        error:
          type: string
          description: error
          example: Internal Server Error
        path:
          type: string
          description: detail
          example: /partners/company
    ApiResponse:
      required:
        - customer -partnerName -companyName -companyDisplayName
        - message
      type: object
      properties:
        message:
          type: string
          description: status discription
          example: Customer Onboarded Successfully
        customer:
          type: array
          example:
            partnerName: TEST PARTNER
            companyName: TEST COMPANY 12
            companyDisplayName: Test Company 12
          items:
            type: string
    ApiDeleteResponse:
      required:
        - customer -partnerName -companyName
        - message
      type: object
      properties:
        message:
          type: string
          description: status discription
          example: Company Deleted Successfully
        customer:
          type: array
          example:
            partnerName: TEST PARTNER
            companyName: TEST COMPANY 12
          items:
            type: string
    ApiEditResponse:
      required:
        - customer -partnerName -companyName
        - message
      type: object
      properties:
        message:
          type: string
          description: status discription
          example: Customer Details Updated Successfully
        customer:
          type: array
          example:
            partnerName: TEST PARTNER
            companyName: TEST COMPANY 12
          items:
            type: string
    ApiGetResponse:
      required:
        - data -records - companyName - companyDescriptiveName - partnerName - partnerDescriptiveName
          - contractId
        - status
      type: object
      properties:
        status:
          type: string
          description: status discription
          example: Success
        data:
          type: array
          example:
            records:
              - companyName: TEST COMPANY
                companyDescriptiveName: TEST COMPANY
                partnerName: TEST PARTNER
                partnerDescriptiveName: TEST PARTNER
                contractId: 12XX
          items:
            $ref: "#/components/schemas/dataObject"
    dataObject:
      required:
        - records - companyName - companyDescriptiveName - partnerName - partnerDescriptiveName
          - contractId
      type: object
      properties:
        records:
          type: object
          properties:
            companyName:
              type: string
              description: Company Name
            companyDescriptiveName:
              type: string
              description: Descriptive name of the company.
            partnerName:
              type: string
              description: Partner Name
            partnerDescriptiveName:
              type: string
              description: Descriptive name of the partner.
            contractId:
              type: string
              description: Device Type
          description: An object containing references to the source of the error
    ApiError:
      type: object
      properties:
        id:
          type: string
          description: A unique identifier for this particular occurrence of the problem
        status:
          type: integer
          description: The HTTP status code applicable to this problem
          format: int32
        code:
          type: string
          description: An application-specific error code, expressed as a string value
        title:
          type: string
          description:
            A short, human-readable summary of the problem that SHOULD
            NOT change from occurrence to occurrence of the problem, except for purposes
            of localization
        detail:
          type: string
          description:
            A human-readable explanation specific to this occurrence of
            the problem. Like title, this field’s value can be localized
        source:
          type: object
          properties:
            pointer:
              type: string
              description:
                A JSON Pointer [RFC6901] to the associated entity in the
                request document [e.g. "/data" for a primary data object, or "/data/attributes/title"
                for a specific attribute]
            parameter:
              type: string
              description:
                A string indicating which URI query parameter caused the
                error
          description: An object containing references to the source of the error
  responses:
    Response400:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ApiError"
    Response401:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ApiError"
    Response500:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ApiError"
  parameters:
    companyName:
      name: companyName
      in: header
      description: Company name
      required: true
      style: simple
      explode: false
      schema:
        type: string
    companyDisplayName:
      name: companyDisplayName
      in: header
      description: Descriptive name of the company.
      required: false
      style: simple
      explode: false
      schema:
        type: string
    deviceType:
      name: deviceType
      in: header
      description:
        If the company will enroll only Mobile Computer or Scanner or Printer,
        provide the device type. Not required if company will enroll all device types.
      required: false
      style: simple
      explode: false
      schema:
        type: string
    contractId:
      name: contractId
      in: header
      description:
        If the company has one or more Zebra contracted devices, provide
        any one Zebra contract Id.
      required: false
      style: simple
      explode: false
      schema:
        type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
    ApiKeyAuth:
      type: apiKey
      name: X-APIKey
      in: header
