Canix Bill of Materials API

The Bill of Materials API from Canix — 2 operation(s) for bill of materials.

OpenAPI Specification

canix-bill-of-materials-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Canix Bill of Materials 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: Bill of Materials
paths:
  /bills_of_materials:
    get:
      tags:
      - Bill of Materials
      summary: GetBillsOfMaterials
      description: Get all Bills of Materials
      operationId: GetBillOfMaterialsById
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BillOfMaterials'
        '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'
  /bills_of_materials/{bill_of_materials_id}:
    get:
      tags:
      - Bill of Materials
      summary: GetBillOfMaterials
      description: Get Bill of Materials by ID
      operationId: GetBillOfMaterialsById
      parameters:
      - name: bill_of_materials_id
        in: path
        description: ID of Bill of Materials to return
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillOfMaterials'
              example:
                id: 12
                name: Bulk - Dark Chocolate Peaks - 5mg
                active_date: '2023-01-01'
                expiration_date: '2023-12-31'
                proportion_type: single_instance
                source_non_cannabis_products:
                - name: 1/8th Jar
                  non_cannabis_product_id: 24
                  quantity: 1
                  weight_unit: Each
                  application_setting: proportional
                - name: Gloves - Large
                  non_cannabis_product_id: 56
                  quantity: 2
                  weight_unit: Each
                  application_setting: fixed
                source_cannabis_items:
                - name: Hammer Bud
                  item_id: 242
                  item_category_id: null
                  item_sub_category_id: null
                  quantity: 20
                  weight_unit: Grams
                - name: B Buds
                  item_id: null
                  item_category_id: 98
                  item_sub_category_id: null
                  quantity: 25
                  weight_unit: Grams
                output_items:
                - name: Jarred Flower
                  item_id: 370
                  quantity: 50
                  weight_unit: Grams
                  item_category: null
                  item_sub_category: null
                - name: null
                  item_id: 371
                  quantity: 25
                  weight_unit: Grams
                  item_category:
                    id: 98
                    name: B Buds
                  item_sub_category: null
        '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
    403AccessDenied:
      description: Access denied
    401NotAuthenticated:
      description: Not authenticated
    404NotFound:
      description: The specified resource was not found
    500ServerError:
      description: Server error
  schemas:
    BillOfMaterialsOutputItem:
      title: Output Item Info
      type: object
      required:
      - name
      - item_id
      - quantity
      - weight_unit
      properties:
        name:
          type:
          - string
          - 'null'
          description: Name of the output item. Null when the output targets an item category or sub-category instead of a concrete item; item_category / item_sub_category identify the output in that case.
        item_id:
          type: integer
        quantity:
          type: number
        weight_unit:
          type: string
        item_category:
          type:
          - object
          - 'null'
          properties:
            id:
              type: integer
            name:
              type: string
        item_sub_category:
          type:
          - object
          - 'null'
          properties:
            id:
              type: integer
            name:
              type: string
      example:
        name: Jarred Flower
        item_id: 370
        quantity: 50
        weight_unit: Grams
        item_category: null
        item_sub_category: null
    BillOfMaterials:
      title: Bill of Materials Info
      type: object
      required:
      - id
      - name
      - proportion_type
      properties:
        id:
          type: integer
        name:
          type: string
        active_date:
          type: string
          format: date
        expiration_date:
          type: string
          format: date
        proportion_type:
          type: string
          description: single_instance means materials are applied to each output independently; all_instances means materials are applied across all output item quantities
        last_updated_at:
          type: string
          format: date-time
          description: Last updated timestamp
        source_non_cannabis_products:
          type: array
          items:
            $ref: '#/components/schemas/BillOfMaterialsSourceNonCannabisProduct'
        source_cannabis_items:
          type: array
          items:
            $ref: '#/components/schemas/BillOfMaterialsSourceCannabisItem'
        output_items:
          type: array
          items:
            $ref: '#/components/schemas/BillOfMaterialsOutputItem'
      example:
        id: 12
        name: Bulk - Dark Chocolate Peaks - 10mg
        active_date: '2023-01-01'
        expiration_date: '2023-12-31'
        proportion_type: single_instance
        source_non_cannabis_products:
        - name: 1/8th Jar
          non_cannabis_product_id: 24
          quantity: 1
          weight_unit: Each
          application_setting: proportional
        - name: Gloves - Large
          non_cannabis_product_id: 56
          quantity: 2
          weight_unit: Each
          application_setting: fixed
        source_cannabis_items:
        - quantity: 20
          weight_unit: Grams
          item:
            id: 242
            name: Hammer Bud
          item_category: null
          item_sub_category: null
        - quantity: 25
          weight_unit: Grams
          item: null
          item_category:
            id: 98
            name: B Buds
          item_sub_category: null
        output_items:
        - name: Jarred Flower
          item_id: 370
          quantity: 50
          weight_unit: Grams
          item_category: null
          item_sub_category: null
        - name: null
          item_id: 371
          quantity: 25
          weight_unit: Grams
          item_category:
            id: 98
            name: B Buds
          item_sub_category: null
    BillOfMaterialsSourceCannabisItem:
      title: Source Cannabis Item Info
      type: object
      required:
      - quantity
      - weight_unit
      properties:
        quantity:
          type: number
        weight_unit:
          type: string
        item:
          type:
          - object
          - 'null'
          properties:
            id:
              type: integer
            name:
              type: string
        item_category:
          type:
          - object
          - 'null'
          properties:
            id:
              type: integer
            name:
              type: string
        item_sub_category:
          type:
          - object
          - 'null'
          properties:
            id:
              type: integer
            name:
              type: string
      example:
        quantity: 100
        weight_unit: Grams
        item:
          id: 242
          name: Hammer Bud
        item_category: null
        item_sub_category: null
    BillOfMaterialsSourceNonCannabisProduct:
      title: Source Non Cannabis Product Info
      type: object
      required:
      - non_cannabis_product_id
      - name
      - quantity
      - weight_unit
      - application_setting
      properties:
        non_cannabis_product_id:
          type: integer
        name:
          type: string
        quantity:
          type: number
        weight_unit:
          type: string
        application_setting:
          type: string
      example:
        name: 1/8th Jar
        non_cannabis_product_id: 24
        quantity: 1
        weight_unit: Each
        application_setting: proportional
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY