openapi: 3.0.1
info:
  title: manufacturing-api
  description: Support for more advanced integrations for manufacturing records data
  version: v1
servers:
  - url: https://manufacturing-api-test.milwaukeetool.com
    description: TEST API Environment
  - url: https://manufacturing-api.milwaukeetool.com
    description: Production API Environment
paths:
  /v1/audit/{product_id}/{mpbid}:
    post:
      parameters:
        - name: Content-Type
          in: header
          required: true
          schema:
            type: string
        - name: mpbid
          in: path
          required: true
          schema:
            type: string
        - name: product_id
          in: path
          required: true
          schema:
            type: string
        - name: Content-Disposition
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
        '400':
          description: 400 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content: {}
        '403':
          description: 403 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content: {}
        '413':
          description: 413 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content: {}
      security:
        - api_key: []
      tags:
        - /v1/audit/{product_id}/{mpbid}
    options:
      parameters:
        - name: product_id
          in: path
          required: true
          schema:
            type: string
        - name: mpbid
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/audit/{product_id}/{mpbid}
  /v1/mobile/iteminstances/associate:
    post:
      security:
        - auth0-authorizer: []
        - api_key: []
      tags:
        - /v1/mobile/iteminstances/associate
      responses:
        '200':
          description: 200 response
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/mobile/iteminstances/associate
  /v1/mobile/iteminstances/disassociate:
    post:
      security:
        - auth0-authorizer: []
        - api_key: []
      tags:
        - /v1/mobile/iteminstances/disassociate
      responses:
        '200':
          description: 200 response
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/mobile/iteminstances/disassociate
  /v1/security/assetcodes:
    post:
      security:
        - api_key: []
      tags:
        - /v1/security/assetcodes
      responses:
        '200':
          description: 200 response
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/security/assetcodes
  /v1/security/getservicepassword:
    post:
      security:
        - api_key: []
      tags:
        - /v1/security/getservicepassword
      responses:
        '200':
          description: 200 response
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/security/getservicepassword
  /v1/security/linkassetcode:
    post:
      security:
        - api_key: []
      tags:
        - /v1/security/linkassetcode
      responses:
        '200':
          description: 200 response
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/security/linkassetcode
  /v1/security/provision:
    post:
      security:
        - api_key: []
      tags:
        - /v1/security/provision
      responses:
        '200':
          description: 200 response
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/security/provision
  /v1/service/iteminstances/recondition:
    post:
      security:
        - auth0-authorizer: []
        - api_key: []
      tags:
        - /v1/service/iteminstances/recondition
      responses:
        '200':
          description: 200 response
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/service/iteminstances/recondition
  /v1/tool/allocate:
    post:
      summary: Allocate MPBIDs
      description: >-
        Note: this API should not be used unless explicitly directed to do so by
        a member of the JEDI team. Unauthorized use of this API may result in
        missing and unrecoverable data.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ToolAllocationRequest'
        required: true
      responses:
        '200':
          description: A set of device records for the given product
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllocationResponse'
      security:
        - api_key: []
      tags:
        - /v1/tool/allocate
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/tool/allocate
  /v1/tool/allocate_serial_number:
    post:
      summary: Allocate Serial Number
      description: >-
        Note: this API should not be used unless explicitly directed to do so by
        a member of the JEDI team.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SerialNumberAllocationRequest'
        required: true
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content: {}
        '400':
          description: 400 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content: {}
        '500':
          description: 500 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content: {}
      security:
        - api_key: []
      tags:
        - /v1/tool/allocate_serial_number
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/tool/allocate_serial_number
  /v1/tool/records:
    get:
      security:
        - auth_token: []
        - api_key: []
      tags:
        - /v1/tool/records
      description: >-
        Currently supports querying for a tool record using a single query
        parameter 

        (which may contain multiple, comman separated values), one of [toolId,
        mpbid, serialNumber]
      parameters:
        - in: query
          required: false
          name: toolId
          schema:
            type: string
          description: (Optional) single toolId or comma-separated list of toolIds.
          example: https://mke.tl/0000001FF,https://mke.tl/0000004HE
        - in: query
          required: false
          name: mpbid
          schema:
            type: string
          description: (Optional) single mpbid or comma-separated list of mpbids.
          example: FFFF000766
        - in: query
          required: false
          name: serialNumber
          schema:
            type: string
          description: >-
            (Optional) single serialNumber or comma-separated list of
            serialNumbers.
          example: M64AM220300048
      responses:
        '200':
          description: 200 Success Response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetToolRecordQueryResponse'
              examples:
                Single Record:
                  value:
                    records:
                      - mfgProductionDate: 1642136328000
                        uniqueDeviceId: 3C006A000250315338363020
                        description: Gen 4 M18 FUEL Drill
                        source: Unknown
                        platform: M18
                        mpbid: 01150002D3
                        bleModule: UNKNOWN
                        createdAt: 1616164700000
                        toolId: https://mke.tl/0000004I8
                        mfgLastUpdateDate: 1641795977000
                        model: 2903-20
                        firmwareVersion: '10010605'
                        updatedAt: 1642136330000
                        image: >-
                          https://onekey-tool-images-na.s3.amazonaws.com/default-images/No%20Image%20Available.jpg
                        p_id_hex: '0115'
                        default_p_id: '0115'
                        partNumber: 35866D65
                        p_id: 277
                        serialNumber: M64AM220300021
                        bornOnDate: 1641795989000
                        imei: '350457795727930'
                        iccId: 891004234814455936F
                PartialSuccess:
                  value:
                    records:
                      - mfgProductionDate: 1642139011000
                        uniqueDeviceId: 3B0062000250315338363020
                        description: Gen 4 M18 FUEL Drill
                        source: Unknown
                        platform: M18
                        mpbid: '01150002E2'
                        bleModule: UNKNOWN
                        createdAt: 1616164700000
                        toolId: https://mke.tl/0000004HE
                        mfgLastUpdateDate: 1641796811000
                        model: 2903-20
                        firmwareVersion: '10010605'
                        updatedAt: 1648830910000
                        image: >-
                          https://onekey-tool-images-na.s3.amazonaws.com/default-images/No%20Image%20Available.jpg
                        p_id_hex: '0115'
                        default_p_id: '0115'
                        partNumber: 35866D65
                        region: US
                        p_id: 277
                        serialNumber: M64AM220300048
                        bornOnDate: 1641796823000
                    errors:
                      - code: ERR0001
                        message: Item not found
                        context: https://mke.tl/BOGUS
        '400':
          description: 400 Bad Request
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetToolRecordResponseError'
              examples:
                Bad Request:
                  value:
                    code: ERR0003
                    message: >-
                      searching by multiple query parameters is not supported at
                      this time.
                    context: Bad Request - 'https://mke.tl/0000004I8, M64AM220300021
        '403':
          description: 403 Forbidden
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetToolRecordResponseError'
              examples:
                Forbidden:
                  value:
                    code: ERR0004
                    message: >-
                      User does not have the required permissions to access the
                      requested data
                    context: Forbidden - Invalid Client Id
        '404':
          description: 404 Not Found
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetToolRecordResponseError'
              examples:
                Not Found:
                  value:
                    code: ERR0001
                    message: Item not found
                    context: https://mke.tl/BOGUS
        '500':
          description: 500 Unknown Error
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetToolRecordResponseError'
              examples:
                Server Error:
                  value:
                    code: ERR0002
                    message: Unhandled Exception
                    context: An Unknown Error Occurred
    post:
      responses:
        '200':
          description: 200 response
      security:
        - api_key: []
      tags:
        - /v1/tool/records
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - Manufacturer
                - Item
              properties:
                Manufacturer:
                  type: string
                  description: A unique name given to each manufacturer
                Item:
                  type: object
                  required:
                    - MPBID
                    - BOD
                    - METCOPassword
                    - UserPassword
                    - ServicePassword
                    - AdminPassword
                    - EncryptionKeyLo
                    - EncryptionKeyHi
                    - uniqueDeviceId
                  properties:
                    MPBID:
                      description: >-
                        Base 16 encoding of unique TOOL id. 4 hex chars for
                        product id 6 hex chars for sequence number
                      type: string
                      minLength: 10
                      maxLength: 10
                      example: '0000000000'
                    SN:
                      type: string
                      description: Serial Number of the tool
                      example: A0000000 000000 0000000
                    BOD:
                      type: string
                      description: >-
                        Base 16 encoding of EPOCH born on date 8 hex chars,
                        whitespace allowed
                      minLength: 8
                      maxLength: 8
                      example: 17A9BD1670C
                    METCOPassword:
                      type: string
                      description: 16 hex chars, whitespace allowed
                      minLength: 16
                      maxLength: 16
                      example: FFFFFFFFFFFFFFFF
                    UserPassword:
                      type: string
                      description: 16 hex chars, whitespace allowed
                      minLength: 16
                      maxLength: 16
                      example: FFFFFFFFFFFFFFFF
                    ServicePassword:
                      type: string
                      description: 16 hex chars, whitespace allowed
                      minLength: 16
                      maxLength: 16
                      example: FFFFFFFFFFFFFFFF
                    AdminPassword:
                      type: string
                      description: 16 hex chars, whitespace allowed
                      minLength: 16
                      maxLength: 16
                      example: FFFFFFFFFFFFFFFF
                    EncryptionKeyLo:
                      type: string
                      description: 16 hex chars, whitespace allowed
                      minLength: 16
                      maxLength: 16
                      example: FFFFFFFFFFFFFFFF
                    EncryptionKeyHi:
                      type: string
                      description: 16 hex chars, whitespace allowed
                      minLength: 16
                      maxLength: 16
                      example: FFFFFFFFFFFFFFFF
                    MACAddress:
                      type: string
                      description: 12 hex chars, whitespace allowed
                      minLength: 12
                      maxLength: 12
                      example: FFFFFFFFFFFF
                    FirmwareVersion:
                      type: string
                      description: >-
                        Firmware version installed on tool at time of assembly.
                        Read from memory address 0x000D. 8 hex chars, whitespace
                        allowed
                      minLength: 8
                      maxLength: 8
                      example: FFFFFFFF
                    FirmwarePartNumber:
                      type: string
                      description: >-
                        The firmware part number of the tool at time of
                        assembly. Read from memory address 0x0009. 8 hex chars,
                        whitespace allowed
                      minLength: 8
                      maxLength: 8
                      example: FFFFFFFF
                    uniqueDeviceId:
                      type: string
                      description: >-
                        The Unique Device ID of the MCU in the tool. Can be
                        variable in length by product.
                      example: A1B2C3D40110022003300440
                    ProductionDate:
                      type: string
                      description: Date tool was produced, UTC
                      example: '2021-07-12T18:01:25.132Z'
                    LastUpdateDate:
                      type: string
                      description: Date tool was last updated, UTC
                      example: '2021-07-12T18:01:25.132Z'
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/tool/records
  /v1/toolimport/associate:
    post:
      security:
        - api_key: []
      tags:
        - /v1/toolimport/associate
      responses:
        '200':
          description: 200 response
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/toolimport/associate
  /v1/toolimport/defect:
    post:
      security:
        - api_key: []
      tags:
        - /v1/toolimport/defect
      responses:
        '200':
          description: 200 response
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/toolimport/defect
  /v1/toolimport/disassociate:
    post:
      security:
        - api_key: []
      tags:
        - /v1/toolimport/disassociate
      responses:
        '200':
          description: 200 response
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/toolimport/disassociate
  /v1/toolimport/link:
    post:
      security:
        - api_key: []
      tags:
        - /v1/toolimport/link
      responses:
        '200':
          description: 200 response
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/toolimport/link
  /v1/toolimport/modify:
    post:
      security:
        - api_key: []
      tags:
        - /v1/toolimport/modify
      responses:
        '200':
          description: 200 response
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/toolimport/modify
  /v1/toolimport/reserved-mpbid:
    post:
      security:
        - api_key: []
      tags:
        - /v1/toolimport/reserved-mpbid
      responses:
        '200':
          description: 200 response
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/toolimport/reserved-mpbid
  /v1/toolimport/unlink:
    post:
      security:
        - api_key: []
      tags:
        - /v1/toolimport/unlink
      responses:
        '200':
          description: 200 response
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v1/toolimport/unlink
  /v2/tool/records:
    post:
      responses:
        '200':
          description: 200 response
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ToolRecords'
            examples:
              '0':
                value:
                  records:
                    - id:
                        mpbid: FFFF000000
                        serialNumber: GA12340000000
                        toolId: https://mke.tl/M000004C3
                        vendorId: ABCD 1234
                      firmware:
                        partNumber: 35866D65
                        version: '0E010602'
                      uniqueDeviceId: 1234567890ABCDEFGHIJ
                      bornOnDate: AC01DF
                      link:
                        pcbaTool: 123456ABCDEF
                        mpbid: '0001000000'
                      ble:
                        macAddress: 00:00:5e:00:53:af
                        version: 0.1.2.3
                        moduleType: BGM220
                      productionDate: '0001-01-01T00:00:00'
                      lastUpdateDate: '0001-01-01T00:00:00'
                      password:
                        admin: '0000000000000000'
                        user: '11111111111111111'
                        metco: '22222222222222222'
                        service: '4444444444444444'
                      cellular:
                        imei: '350457795727930'
                        iccId: 891004234814455936F
                      region: UL
                      ttiPartNumber: '0123456789'
                      client:
                        timestamp: 1638171069
                        name: Quicklink-Mfg
                        version: 1.2.3
                        facility: ''
                        lineId: '1'
                        stationId: A
                        user: ABCD
        required: true
      security:
        - api_key: []
      tags:
        - /v2/tool/records
    options:
      responses:
        '200':
          description: 200 response
          headers:
            Access-Control-Allow-Origin:
              schema:
                type: string
            Access-Control-Allow-Methods:
              schema:
                type: string
            Access-Control-Max-Age:
              schema:
                type: string
            Access-Control-Allow-Headers:
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Empty'
      tags:
        - /v2/tool/records
components:
  schemas:
    ToolRecordLink:
      title: ToolRecordLink
      type: object
      properties:
        pcbaTool:
          type: string
          description: The reference code of the tool the PCBA logger is attached to
        mpbid:
          type: string
          description: The MPBID of the tool the PCBA logger is attached to
      description: Tool Record Link
    Empty:
      title: Empty Schema
      type: object
    SerialNumberAllocationRequest:
      title: SerialNumberAllocationRequest
      required:
        - count
        - facility
        - prefix
        - splBreak
      type: object
      properties:
        count:
          maximum: 10000
          minimum: 1
          type: number
          description: Number of serial numbers to allocate
        prefix:
          type: string
          description: >-
            Prefix which defines each catalog number. The prefix letters are
            alpha-numeric characters - required for service purposes and the
            SPL, and aids in identifying the tool model. The prefix is to be
            assigned by Engineering (Technical Literature).
        splBreak:
          type: string
          description: >-
            Alpha character (A-Z) for Serial breaks and indicates major changes.
            The character is to begin with "A". For each major change that
            occurs after the initial release, the alpha character is to index
            upward to the next letter (A to B; B to C; etc.). The character is
            assigned by Engineering.
        facility:
          type: string
          description: >-
            Alphanumeric single character that represents the facility where the
            tool is being manufactured.
      description: Manufacturing request to generate a block of serial numbers
    ToolRecordID:
      title: ToolRecordID
      type: object
      properties:
        mpbid:
          type: string
          description: >-
            he unique identifier of the tool A.K.A. Milwaukee Product Binary
            Identifier.
        serialNumber:
          type: string
          description: >-
            A unique tool identifier printed on each tool. It is comprised of
            tool, facility, date, and unit information.
        toolId:
          type: string
          description: The full unique URL which is encoded into the QR code
        vendorId:
          type: string
          description: A unique ID as defined by an external vendor for this tool.
      description: Tool Record ID
    ToolRecordClient:
      title: ToolRecordClient
      type: object
      properties:
        timestamp:
          minimum: 1609459200
          type: integer
          format: int64
        supplierId:
          type: string
          description: >-
            The supplier ID code as defined in ES 19-1 Identification & Date
            Coding Procedure.
        facility:
          type: string
          description: >-
            Numeric (0-9) or alpha (A-Z) and identifies the facility where the
            product is manufactured (not where the rating plate is made) as
            defined in ES 19-1 Identification & Date Coding Procedure.
        lineId:
          type: string
          description: >-
            A unique identifier for the production line building the tools
            requested.
        stationId:
          type: string
          description: >-
            A unique identifier for the station on the production line building
            the tools requested.
        name:
          type: string
          description: >-
            The unique name of the software application being used to request
            data.
        version:
          type: string
          description: The version of the software application being used to request data.
        user:
          type: string
          description: >-
            The system user name or operator number for the person requesting
            the data.
      description: Tool Record Client Information
    ToolRecords:
      title: ToolRecords
      required:
        - records
      type: object
      properties:
        records:
          maxItems: 10000
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/ToolRecord'
      description: One or more Tool Records
    ToolAllocationRequest:
      title: ToolAllocationRequest
      required:
        - client
        - productId
        - size
      type: object
      properties:
        productId:
          maximum: 65535
          minimum: 1
          type: number
          description: Product ID used to allocate the MPBIDs
        size:
          maximum: 10000
          minimum: 1
          type: number
          description: Number of MPBIDs to allocate for the given Product ID
        customerPO:
          type: string
          description: >-
            (Optional) Purchase order number or NPD project ID associated with
            this batch of tools.
        prefix:
          type: string
          description: >-
            (Optional) Prefix which defines each catalog number. The prefix
            letters are alpha-numeric characters - required for service purposes
            and the SPL, and aids in identifying the tool model. The prefix is
            to be assigned by Engineering (Technical Literature).
        splBreak:
          type: string
          description: >-
            (Optional) Alpha character (A-Z) for Serial breaks and indicates
            major changes. The character is to begin with "A". For each major
            change that occurs after the initial release, the alpha character is
            to index upward to the next letter (A to B; B to C; etc.). The
            character is assigned by Engineering.
        client:
          $ref: '#/components/schemas/ToolRecordClient'
      description: Manufacturing request to reserve a block of MPBIDs
    ToolRecord:
      title: ToolRecord
      required:
        - client
        - id
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ToolRecordID'
        client:
          $ref: '#/components/schemas/ToolRecordClient'
        link:
          $ref: '#/components/schemas/ToolRecordLink'
        firmware:
          $ref: '#/components/schemas/ToolRecordFirmware'
        ble:
          $ref: '#/components/schemas/ToolRecordBLE'
        password:
          $ref: '#/components/schemas/ToolRecordPassword'
        cellular:
          $ref: '#/components/schemas/ToolRecordCellular'
        uniqueDeviceId:
          type: string
          description: A unique identifier of the PCBA the firmware is programmed onto.
        bornOnDate:
          type: string
          description: >-
            Born On Date. Unix timestamp representing the date at which the tool
            was produced in HEX format.
        productionDate:
          type: string
          description: The date the tool was produced in ISO 8601 format.
        lastUpdateDate:
          type: string
          description: The date the tool record was last updated in ISO 8601 format.
        region:
          type: string
          description: >-
            The region the tool was produced in. See
            [here](/docs/Manufacturing/API#defined-region-codes) for a list of
            valid region codes.
        ttiPartNumber:
          type: string
          description: The TTI part number of the tool.
      description: Tool Record
    ToolRecordFirmware:
      title: ToolRecordFirmware
      type: object
      properties:
        partNumber:
          type: string
          description: >-
            The part number of the PCBA which is running the firmware. AKA "SW
            Part Number"
        version:
          type: string
          description: The version of the firmware running on the tool in HEX format.
      description: Firmware Information
    ToolRecordBLE:
      title: ToolRecordBLE
      type: object
      properties:
        macAddress:
          type: string
          description: The MAC address of the BLE module in HEX format.
        version:
          type: string
          description: The version of the BLE module in HEX format.
        moduleType:
          type: string
          description: The type of BLE module installed in this tool.
      description: BLE Information
    ToolRecordPassword:
      title: ToolRecordPassword
      type: object
      properties:
        admin:
          type: string
          description: The admin password of the tool in HEX format.
        user:
          type: string
          description: The user password of the tool in HEX format.
        metco:
          type: string
          description: The metco password of the tool in HEX format.
        service:
          type: string
          description: The service password of the tool in HEX format.
      description: Password Information
    ToolRecordCellular:
      title: ToolRecordCellular
      type: object
      properties:
        imei:
          type: string
          description: The IMEI of the cellular module.
        iccId:
          type: string
          description: The ICCID of the cellular module.
      description: Cellular Information
    AllocationResponse:
      title: Allocation Response
      type: object
      properties:
        manufacturer:
          type: string
          description: A unique name given to each manufacturer
        productId:
          title: Product ID
          type: integer
          description: >-
            The product id the MPBIDs are being allocated for. Must be a number
            between 1 and 65,535 inclusive
          example: 65535
          minimum: 1
          maximum: 65535
        createdDateTime:
          type: number
          description: Unix timestamp indicating when the allocation occurred
          format: int64
          minimum: 1609459200
        devices:
          type: array
          items:
            $ref: '#/components/schemas/AllocationDevice'
          minItems: 0
          maxItems: 100
        currentSerialID:
          type: number
          format: int32
          description: >-
            The highest allocated sequence number within all devices of the same
            product ID
    AllocationDevice:
      type: object
      properties:
        sequenceNumber:
          type: number
          format: int32
          description: >-
            The sequence order of this device is within all devices of the same
            product ID
        mpbid:
          description: >-
            Base 16 encoding of unique TOOL id. 4 hex chars for product id 6 hex
            chars for sequence number
          type: string
          minLength: 10
          maxLength: 10
          example: '0000000000'
        bod:
          type: string
          description: >-
            Base 16 encoding of EPOCH born on date 8 hex chars, whitespace
            allowed
          minLength: 8
          maxLength: 8
          example: 17A9BD1670C
        metcoPassword:
          type: string
          description: 16 hex chars, whitespace allowed
          minLength: 16
          maxLength: 16
          example: FFFFFFFFFFFFFFFF
        userPassword:
          type: string
          description: 16 hex chars, whitespace allowed
          minLength: 16
          maxLength: 16
          example: FFFFFFFFFFFFFFFF
        servicePassword:
          type: string
          description: 16 hex chars, whitespace allowed
          minLength: 16
          maxLength: 16
          example: FFFFFFFFFFFFFFFF
        adminPassword:
          type: string
          description: 16 hex chars, whitespace allowed
          minLength: 16
          maxLength: 16
          example: FFFFFFFFFFFFFFFF
    GetToolRecordResponseRecord:
      type: object
      properties:
        mfgProductionDate:
          type: integer
          format: int64
          minimum: 1609459200
          description: The date of production by the manufacturer
        description:
          type: string
          description: A description of the tool record returned.
        source:
          type: string
          description: Where the tool record information originated.
        uniqueDeviceId:
          type: string
          description: A unique identifier of the PCBA the firmware is programmed onto.
        mpbid:
          type: string
          description: >-
            The unique identifier programmed into a tool. Milwaukee Product
            Binary Identifier. Comprised of a 4 digit product identifier and a 6
            digit sequence number.
        vpinProjectNumber:
          type: string
          description: The VPIN project number for this tool.
        platform:
          type: string
          description: The battery platform the tool belongs to. One of M18, M12, or MX.
        bleModule:
          type: string
          description: The type of BLE module this tool has.
        createdAt:
          type: integer
          format: int64
          minimum: 1609459200
          description: The timestamp for when the tool record was created.
        embedTick:
          type: boolean
          description: Indicates whether or not the tool record supports an embedded Tick.
        servicePassword:
          type: string
          description: >-
            Tool specific Service Password which is programmed on the tool
            record. Only present when called by user with certain roles
        userPassword:
          type: string
          description: >-
            Tool specific User Password which is programmed on the tool record.
            Only present when called by user with certain roles
        adminPassword:
          type: string
          description: >-
            Tool specific Admin Password which is programmed on the tool record.
            Only present when called by user with certain roles
        metcoPassword:
          type: string
          description: >-
            Tool specific METCO Password which is programmed on the tool record.
            Only present when called by user with certain roles
        mfgLastUpdateDate:
          type: integer
          format: int64
          minimum: 1609459200
          description: >-
            The timestamp for when this tool was last updated by the
            manufacturing process.
        mx_product_key:
          type: string
          description: ''
        model:
          type: string
          description: Model number for a tool manufactured in the NA region
        modelEMEA:
          type: string
          description: Model number for a tool manufactured in the EMEA region
        modelANZ:
          type: string
          description: Model number for a tool manufactured in the ANZ region
        modelAP:
          type: string
          description: Model number for a tool manufactured in the AP region
        serialNumber:
          type: string
          description: >-
            A unique tool identifier printed on each tool. It is comprised of
            tool, facility, date, and unit information.
        firmwareVersion:
          type: string
          description: The version of the firmware running on the tool.
        onekey:
          type: boolean
          description: Indicates whether or not the record is a One-Key tool
        updatedAt:
          type: integer
          format: int64
          minimum: 1609459200
          description: The timestamp for when this tool was last updated.
        image:
          type: string
          description: >-
            The default image associated with the tool, represented as a URI
            where the image is stored.
          format: uri
        okCard:
          type: boolean
          description: Indicates whether or not the tool record supports a One-Key card.
        ttiNumber:
          type: string
          description: The TTI part number for this tool.
        p_id_hex:
          type: string
          minimum: 4
          maximum: 4
          description: 4 character Hexadecimal product id
        macAddress:
          type: string
          description: The tool specific MAC address for the BLE module on the tool
        default_p_id:
          type: string
          minimum: 4
          maximum: 4
          description: 4 character Hexadecimal product id.
        bornOnDate:
          type: integer
          format: int64
          minimum: 1609459200
          description: >-
            Unix timestamp representing the original date of manufacturing as
            programmed on to the tool.
        partNumber:
          type: string
          description: >-
            The part number of the PCBA which is running the firmware. AKA 'SW
            Part Number'.
        mx_product_key_generated:
          type: string
          description: ''
        p_id:
          type: number
          description: The numerical representation of this tools product ID.
        toolId:
          type: string
          description: >-
            Unique identifier for a given tool in the form of a URI. The URI
            will provide additional information about the tool.
          format: uri
        region:
          type: string
          description: >-
            The region the tool is being built for. Additional region code
            information can be found here:
            https://jedi.milwaukeetool.com/?page_id=264
        imei:
          type: string
          description: The IMEI number for the tool.
        iccId:
          type: string
          description: The ICCID number for the tool.
    GetToolRecordResponseError:
      type: object
      properties:
        code:
          type: string
          description: Enumerated code value indicating type of error
        message:
          type: string
          description: >-
            Programmatic error message for debugging purposes, not intended for
            end-users and subject to change.
        context:
          type: string
          description: Contextual data relevant to the error code.
    GetToolRecordQueryResponse:
      type: object
      properties:
        records:
          type: array
          items:
            $ref: '#/components/schemas/GetToolRecordResponseRecord'
          minItems: 0
          maxItems: 50
        errors:
          type: array
          items:
            $ref: '#/components/schemas/GetToolRecordResponseError'
          minItems: 0
          maxItems: 50
  securitySchemes:
    api_key:
      type: apiKey
      name: x-api-key
      in: header
    auth0-authorizer:
      type: apiKey
      name: Authorization
      in: header
      x-amazon-apigateway-authtype: custom
    auth_token:
      type: http
      scheme: bearer
      bearerFormat: JWT
