Canix Manufacturing Run API

The Manufacturing Run API from Canix — 2 operation(s) for manufacturing run.

OpenAPI Specification

canix-manufacturing-run-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Canix Manufacturing Run API
  x-logo:
    url: https://assets.website-files.com/5ee52a0f4be6ffc2aaeb52cd/5ee52a0f4be6ff20e7eb534f_canix-logo.svg
    backgroundColor: '#FFFFFF'
    altText: Canix logo
  description: '# Introduction

    This API documentation describes the endpoints used by third-party developers to get Canix data for their account.

    # Authentication

    Canix API uses API Keys for authentication. You can generate an API key on our [API page](https://app.canix.com/company/api), and on your API requests use the `X-API-KEY` header with the API key value you generated.

    We strongly recommend using a secrets manager. Plain text files like dotenv lead to accidental costly leaks. Use [Doppler](https://doppler.com/) or similar options for a developer friendly experience. AWS and Google Cloud have native solutions as well.'
  contact:
    name: Canix Support
    url: https://help.canix.com/
    email: help@canix.com
  version: 1.3.10
servers:
- url: https://api.canix.com/api/v1
  variables: {}
security:
- ApiKeyAuth: []
tags:
- name: Manufacturing Run
paths:
  /manu_batch_runs:
    get:
      tags:
      - Manufacturing Run
      summary: GetManuBatchRuns
      description: Get All Manufacturing Runs
      operationId: GetManuBatchRuns
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ManuBatchRun'
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          $ref: '#/components/responses/401NotAuthenticated'
        '403':
          $ref: '#/components/responses/403AccessDenied'
        '404':
          $ref: '#/components/responses/404NotFound'
        '500':
          $ref: '#/components/responses/500ServerError'
  /manu_batch_runs/{manu_batch_run_id}:
    get:
      tags:
      - Manufacturing Run
      summary: GetManuBatchRun
      description: Get Manufacturing Run by ID
      operationId: GetManuBatchRunById
      parameters:
      - name: manu_batch_run_id
        in: path
        description: ID of Manufacturing Run to return
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManuBatchRun'
              example:
                id: 10
                facility_id: 14
                name: Stage 2
                status: OPEN
                start_date: '2022-05-24'
                end_date: '2022-05-30'
                created_at: '2022-05-22T19:58:00.000Z'
                updated_at: '2021-05-23T05:12:01.000Z'
                location_id: 2
                bill_of_materials_id: 12
                manufacturing_batch_id: 9
                order: 2
                notes: ''
                total_cannabis_costs: 14.3
                total_nci_costs: 2.5
                total_labor_costs: 9.05
                yield: 75.0
                machine_info:
                  temperature: 20.1
                  temperature_unit: Celcius
                  solvent_id: 150
                  solvent_quantity: 10.5
                  solvent_weight_unit: Grams
                  time_in_solvent_ms: 2400
                  time_in_solvent_display_units: Second
                cannabis_inputs:
                - package_id: 3501
                  package_tag: 1A4FF0000000022000000719
                  quantity: 2.54
                  weight_unit: Grams
                  psi: 600.0
                  cost: 14.3
                non_cannabis_inputs:
                - non_cannabis_product_name: Fertilizer
                  non_cannabis_product_id: 145
                  lot: DL21309
                  lot_id: 253
                  quantity: 100.5
                  weight_unit: Grams
                  cost: 2.5
                cannabis_outputs:
                - package_id: 5200
                  package_tag: 1A4FF0000000022000001419
                  quantity: 500
                  weight_unit: Grams
                labors:
                - employee_name: Jane Doe
                  hours_worked: 0.5
                  cost: 10
                - employee_name: John Doe
                  hours_worked: 1
                  cost: 20
                wastes:
                - package_id: 4601
                  package_tag: 1A4FF0000000022000004423
                  quantity: 50
                  weight_unit: Grams
                  reason: Waste Destruction
                  date: '2022-05-24'
                  notes: waste from production
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          $ref: '#/components/responses/401NotAuthenticated'
        '403':
          $ref: '#/components/responses/403AccessDenied'
        '404':
          $ref: '#/components/responses/404NotFound'
        '500':
          $ref: '#/components/responses/500ServerError'
components:
  responses:
    400BadRequest:
      description: Bad request
    401NotAuthenticated:
      description: Not authenticated
    403AccessDenied:
      description: Access denied
    404NotFound:
      description: The specified resource was not found
    500ServerError:
      description: Server error
  schemas:
    ManuBatchRunCannabisOutput:
      title: Cannabis Output
      type: object
      required:
      - quantity
      - weight_unit
      properties:
        package_id:
          type: integer
        package_tag:
          type: string
        quantity:
          type: number
        weight_unit:
          type: string
      example:
        package_id: 5200
        package_tag: 1A4FF0000000022000001419
        quantity: 500
        weight_unit: Grams
    ManuBatchRun:
      title: Manufacturing Run
      required:
      - id
      - facility_id
      - name
      - status
      - order
      - manufacturing_batch_id
      type: object
      properties:
        id:
          type: integer
        facility_id:
          type: integer
          description: Facility ID (fk)
        name:
          type: string
        status:
          type: string
          description: status, can be one of 'OPEN', 'SUBMITTED', 'SUBMITTED_FOR_APPROVAL', 'ERRORED'
        start_date:
          type: string
        end_date:
          type: string
        created_at:
          type: string
          description: Timestamp that the record was created in Canix
        updated_at:
          type: string
          description: Timestamp that the record was last updated in Canix
        location_id:
          type: integer
        bill_of_materials_id:
          type: integer
        manufacturing_batch_id:
          type: integer
        order:
          type: integer
        notes:
          type: string
        total_cannabis_costs:
          type: number
        total_labor_costs:
          type: number
        total_nci_costs:
          type: number
        machine_info:
          $ref: '#/components/schemas/Machine'
        cannabis_inputs:
          type: array
          items:
            $ref: '#/components/schemas/ManuBatchRunCannabisInput'
        non_cannabis_inputs:
          type: array
          items:
            $ref: '#/components/schemas/ManuBatchRunNonCannabisInput'
        cannabis_outputs:
          type: array
          items:
            $ref: '#/components/schemas/ManuBatchRunCannabisOutput'
        labors:
          type: array
          items:
            $ref: '#/components/schemas/Labor'
        wastes:
          type: array
          items:
            $ref: '#/components/schemas/Waste'
      example:
        id: 10
        facility_id: 14
        name: 1074
        status: OPEN
        start_date: '2022-05-24'
        end_date: '2022-05-30'
        created_at: '2022-05-22T19:58:00.000Z'
        updated_at: '2021-05-23T05:12:01.000Z'
        location_id: 2
        bill_of_materials_id: 12
        manufacturing_batch_id: 9
        order: 2
        notes: ''
        total_cannabis_costs: 14.3
        total_nci_costs: 2.5
        total_labor_costs: 9.05
        yield: 75.0
        machine_info:
          temperature: 20.1
          temperature_unit: Celcius
          solvent_id: 150
          solvent_quantity: 10.5
          solvent_weight_unit: Grams
          time_in_solvent_ms: 2400
          time_in_solvent_display_units: Second
        cannabis_inputs:
        - package_id: 3501
          package_tag: 1A4FF0000000022000000719
          quantity: 2.54
          weight_unit: Grams
          psi: 600.0
          cost: 14.3
        non_cannabis_inputs:
        - non_cannabis_product_name: Fertilizer
          non_cannabis_product_id: 145
          lot: DL21309
          lot_id: 253
          quantity: 100.5
          weight_unit: Grams
          cost: 2.5
        cannabis_outputs:
        - package_id: 5200
          package_tag: 1A4FF0000000022000001419
          quantity: 500
          weight_unit: Grams
        labors:
        - employee_name: Jane Doe
          hours_worked: 0.5
          cost: 10
        - employee_name: John Doe
          hours_worked: 1
          cost: 20
        wastes:
        - package_id: 4601
          package_tag: 1A4FF0000000022000004423
          quantity: 50
          weight_unit: Grams
          reason: Waste Destruction
          date: '2022-05-24'
          notes: waste from production
    ManuBatchRunNonCannabisInput:
      title: Non Cannabis Input
      type: object
      required:
      - non_cannabis_product_name
      - non_cannabis_product_id
      - quantity
      - weight_unit
      properties:
        non_cannabis_product_name:
          type: string
        non_cannabis_product_id:
          type: integer
        lot:
          type: string
        lot_id:
          type: integer
        quantity:
          type: number
        weight_unit:
          type: string
        cost:
          type: number
      example:
        non_cannabis_product_name: Fertilizer
        non_cannabis_product_id: 145
        lot: DL21309
        lot_id: 253
        quantity: 100.5
        weight_unit: Grams
        cost: 2.5
    Labor:
      title: Labor Info
      type: object
      required:
      - hours_worked
      properties:
        employee_name:
          type: string
        hours_worked:
          type: number
        cost:
          type: number
      example:
        employee_name: Jane Doe
        hours_worked: 0.5
        cost: 10
    Waste:
      title: Waste Info
      type: object
      required:
      - package_id
      - package_tag
      - quantity
      - weight_unit
      properties:
        package_id:
          type: integer
        package_tag:
          type: string
        quantity:
          type: number
        weight_unit:
          type: string
        reason:
          type: string
        date:
          type: string
        notes:
          type: string
      example:
        package_id: 4601
        package_tag: 1A4FF0000000022000004423
        quantity: 50
        weight_unit: Grams
        reason: Waste Destruction
        date: '2022-05-24'
        notes: waste from production
    Machine:
      title: Machine Info
      type: object
      properties:
        temperature:
          type: number
        temperature_unit:
          type: string
          description: Options are 'Celcius' and 'Fahrenheit'
        solvent_id:
          type: integer
        solvent_quantity:
          type: number
        solvent_weight_unit:
          type: string
        time_in_solvent_ms:
          type: integer
        time_in_solvent_display_units:
          type: string
          description: Options are 'Week', 'Day', 'Hour', 'Minute' and 'Second'
      example:
        temperature: 20.1
        temperature_unit: Celcius
        solvent_id: 150
        solvent_quantity: 10.5
        solvent_weight_unit: Grams
        time_in_solvent_ms: 2400
        time_in_solvent_display_units: Second
    ManuBatchRunCannabisInput:
      title: Cannabis Input
      type: object
      required:
      - quantity
      - weight_unit
      properties:
        package_id:
          type: integer
        package_tag:
          type: string
        quantity:
          type: number
        weight_unit:
          type: string
        psi:
          type: number
        cost:
          type: number
      example:
        package_id: 3501
        package_tag: 1A4FF0000000022000000719
        quantity: 2.54
        weight_unit: Grams
        psi: 600.0
        cost: 14.3
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY