Canix Non-Cannabis Products API

The Non-Cannabis Products API from Canix — 3 operation(s) for non-cannabis products.

OpenAPI Specification

canix-non-cannabis-products-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Canix Non-Cannabis Products 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: Non-Cannabis Products
paths:
  /non_cannabis_products:
    get:
      tags:
      - Non-Cannabis Products
      summary: GetNonCannabisProducts
      description: Return all Non-Cannabis Products for the user's company
      operationId: GetNonCannabisProducts
      parameters:
      - name: facility_ids
        in: query
        description: Facility IDs (optional)
        example:
        - 123
        required: false
        schema:
          type: array
          items:
            type: integer
      - $ref: '#/components/parameters/limitParam'
      - $ref: '#/components/parameters/offsetParam'
      - $ref: '#/components/parameters/orderByParam'
      - $ref: '#/components/parameters/whereParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/NonCannabisProduct'
        '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'
    post:
      tags:
      - Non-Cannabis Products
      summary: PostNonCannabisProduct
      description: __CALLING THIS ENDPOINT WILL MODIFY YOUR DATA IRREVERSIBLY. ONLY CALL THIS ON SANDBOX DATA DURING DEVELOPMENT/CODING/TESTING.__ Each request creates the product in a single facility (facility_id). To share a product across additional facilities, contact support or use the app.
      operationId: PostNonCannabisProduct
      requestBody:
        required: true
        description: Create a new Non-Cannabis Product
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateNonCannabisProductRequestBody'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NonCannabisProduct'
        '400':
          $ref: '#/components/responses/400BadRequest'
        '401':
          $ref: '#/components/responses/401NotAuthenticated'
        '403':
          $ref: '#/components/responses/403AccessDenied'
        '404':
          $ref: '#/components/responses/404NotFound'
        '422':
          description: Metrc submission failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: 'Metrc submission failed: ...'
        '500':
          $ref: '#/components/responses/500ServerError'
  /non_cannabis_products/{non_cannabis_product_id}:
    get:
      tags:
      - Non-Cannabis Products
      summary: GetNonCannabisProduct
      description: Get Non-Cannabis Product by ID
      operationId: GetNonCannabisProductById
      parameters:
      - name: non_cannabis_product_id
        in: path
        description: Non-Cannabis Product ID
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NonCannabisProduct'
        '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'
  /non_cannabis_products/{non_cannabis_product_id}/boms:
    get:
      tags:
      - Non-Cannabis Products
      summary: GetNonCannabisProductBOMs
      description: Get Bills of Materials associated with a Non-Cannabis Product
      operationId: GetNonCannabisProductBOMs
      parameters:
      - name: non_cannabis_product_id
        in: path
        description: Non-Cannabis Product ID
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BillOfMaterials'
              example:
              - id: 12
                name: Bulk - Dark Chocolate Peaks - 10mg
                active_date: '2023-01-01'
                expiration_date: '2023-12-31'
                proportion_type: single_instance
                last_updated_at: '2023-01-15T10:30:00.000Z'
                source_non_cannabis_products:
                - name: 1/8th Jar
                  non_cannabis_product_id: 24
                  quantity: 1
                  weight_unit: Each
                  application_setting: proportional
                source_cannabis_items:
                - quantity: 100
                  weight_unit: Grams
                  item:
                    id: 242
                    name: Hammer Bud
                  item_category: null
                  item_sub_category: null
                output_items:
                - item_id: 370
                  name: Jarred Flower
                  quantity: 50
                  weight_unit: Grams
                  item_category: null
                  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:
  schemas:
    NonCannabisProductStandardCosting:
      title: NonCannabisProductStandardCosting
      required:
      - id
      - standard_cost_amount
      - standard_cost_currency
      - start_date
      properties:
        id:
          type: integer
          example: 123
        standard_cost_amount:
          type: number
          example: 12.1111
        standard_cost_currency:
          type: string
          example: USD
        start_date:
          type: string
          example: '2023-04-19'
        end_date:
          type: string
          example: '2023-05-19'
    CreateNonCannabisProductRequestBody:
      title: Create Non Cannabis Product Request Body
      type: object
      required:
      - name
      - weight_unit_id
      - facility_id
      properties:
        name:
          type: string
          example: Pro System
          description: The name of the non-cannabis product
        weight_unit_id:
          type: integer
          example: 15
          description: Weight Unit ID (fk)
        facility_id:
          type: integer
          example: 1
          description: Facility ID (fk)
        sku:
          type: string
          example: 0.5EC
        notes:
          type: string
          example: This product requires special handling
          description: Optional notes for the product
        par:
          type: number
          example: 100
        allow_partial_unit_deduction:
          type: boolean
          example: false
          description: Whether partial units of this product can be deducted from inventory
        non_cannabis_product_category_id:
          type: integer
          example: 12
          description: Non-Cannabis Product Category ID (fk)
        location_id:
          type: integer
          example: 42
          description: Location ID (fk)
        brand_id:
          type: integer
          example: 5
          description: Brand ID (fk)
        standard_cost:
          type: number
          example: 4.5
          description: Standard cost for the product; requires standard_cost_start_date
        standard_cost_start_date:
          type: string
          format: date
          example: '2024-01-01'
          description: Required when standard_cost is provided
        standard_cost_end_date:
          type: string
          format: date
          example: '2024-12-31'
          description: Optional end date for the standard cost
        submits_to_metrc:
          type: boolean
          description: This field is only applicable to products that are submitted to METRC
        additive_type:
          type: string
          enum:
          - fertilizer
          - herbicide
          - pesticide
          - grow_materials
          - other
          - ro_water
          example: fertilizer
          description: This field is only applicable to products that are submitted to METRC
        product_trade_name:
          type: string
          description: This field is only applicable to products that are submitted to METRC
        epa_registration_name:
          type: string
          description: This field is only applicable to products that are submitted to METRC
        product_supplier:
          type: string
          description: This field is only applicable to products that are submitted to METRC
        application_device:
          type: string
          description: This field is only applicable to products that are submitted to METRC
        active_ingredients:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              percentage:
                type: number
      example:
        name: Fertilizer
        weight_unit_id: 15
        facility_id: 1
        sku: FERT-01
        notes: Store away from direct sunlight
        par: 100
        allow_partial_unit_deduction: true
        non_cannabis_product_category_id: 12
        location_id: 42
        brand_id: 5
        standard_cost: 4.5
        standard_cost_start_date: '2024-01-01'
        submits_to_metrc: true
        additive_type: fertilizer
        product_trade_name: Pro Grow Fertilizer
        epa_registration_name: EPA-12345-1
        product_supplier: AgroSupply Co
        application_device: Foliar sprayer
        active_ingredients:
        - name: Nitrogen
          percentage: 10.0
        - name: Phosphorus
          percentage: 5.0
    Address:
      title: Address
      type: object
      properties:
        street:
          type: string
          example: 123 Cumberland St
        street2:
          type: string
          example: West
        city:
          type: string
          example: Somerset
        county:
          type: string
          example: KY
        state:
          type: string
          example: CO
        country:
          type: string
          example: USA
        postal_code:
          type: string
          example: 42504
    Location:
      title: Location
      required:
      - id
      - name
      properties:
        id:
          type: integer
          example: 123
        name:
          type: string
          example: Pro System
        sqft:
          type: number
          example: 14.4
        num_lights:
          type: integer
          example: 42
        parent_location:
          $ref: '#/components/schemas/ParentLocation'
        updated_at:
          type: string
          example: 2018-11-06 08:00:00+00:00
        is_active:
          type: boolean
          example: true
    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
    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
    NonCannabisProduct:
      title: Non Cannabis Product
      required:
      - id
      - name
      properties:
        id:
          type: integer
          example: 123
        name:
          type: string
          example: Pro System
        is_active:
          type: boolean
        facilities:
          $ref: '#/components/schemas/Facility'
          description: All facilities that the product is available in
        category:
          $ref: '#/components/schemas/NonCannabisProductCategory'
        location:
          $ref: '#/components/schemas/Location'
        sku:
          type: string
          example: 0.5EC
        notes:
          type: string
          description: Optional notes for the product
          example: This product requires special handling
        available_quantity:
          type: number
          example: 196
        weight_unit:
          type: string
          example: Each
        par:
          type: number
          example: 100
        updated_at:
          type: string
          example: 2018-11-06 08:00:00+00:00
        current_standard_costing:
          $ref: '#/components/schemas/NonCannabisProductStandardCosting'
        submits_to_metrc:
          type: boolean
          description: This field is only applicable to products that are submitted to METRC
        additive_type:
          type: string
          example: fertilizer
          description: This field is only applicable to products that are submitted to METRC
        product_trade_name:
          type: string
          description: This field is only applicable to products that are submitted to METRC
        epa_registration_name:
          type: string
          description: This field is only applicable to products that are submitted to METRC
        product_supplier:
          type: string
          description: This field is only applicable to products that are submitted to METRC
        application_device:
          type: string
          description: This field is only applicable to products that are submitted to METRC
        active_ingredients:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              percentage:
                type: number
    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
    NonCannabisProductCategory:
      title: Non Cannabis Product Category
      required:
      - id
      - name
      properties:
        id:
          type: integer
          example: 123
        name:
          type: string
          example: Preroll Materials
        updated_at:
          type: string
          example: 2018-11-06 08:00:00+00:00
    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
    ParentLocation:
      title: Parent Location
      required:
      - id
      - name
      properties:
        id:
          type: integer
          example: 123
        name:
          type: string
          example: Pro System
        sqft:
          type: number
          example: 14.4
        num_lights:
          type: integer
          example: 42
        updated_at:
          type: string
          example: 2018-11-06 08:00:00+00:00
        is_active:
          type: boolean
          example: true
    Facility:
      title: Facility
      required:
      - id
      properties:
        id:
          type: integer
          example: 123
        name:
          type: string
          example: Test Facility
        license_number:
          type: string
          example: 4a-x123
        is_active:
          type: boolean
          example: true
        address:
          $ref: '#/components/schemas/Address'
  parameters:
    offsetParam:
      name: offset
      in: query
      description: Offset for the returned records (optional)
      schema:
        type: integer
        default: 0
        example: 20
    whereParam:
      name: where
      in: query
      description: 'Filter results using SQL-like WHERE clause syntax (optional).


        **Supported operators**: =, >, <, >=, <=, BETWEEN, IN, LIKE, AND, OR


        **Supported patterns**:

        - Equality: `status=''Active''`

        - Comparison: `updated_at >= ''2024-01-01''`

        - Range: `id BETWEEN 1 AND 10000`

        - List: `status IN (''Active'', ''Pending'')`

        - Pattern: `sku LIKE ''ABC%''`

        - Compound: `facility_id=123 AND is_active=true`

        '
      schema:
        type: string
        example: status='Active' AND updated_at >= '2024-01-01'
    orderByParam:
      name: order_by
      in: query
      description: Order-by clause, in SQL format (optional)
      schema:
        type: string
        example: id desc
    limitParam:
      name: limit
      in: query
      description: Max number of records to return (optional). Cannot exceed 2000
      required: false
      style: form
      schema:
        type: integer
        default: 2000
        example: 100
  responses:
    403AccessDenied:
      description: Access denied
    404NotFound:
      description: The specified resource was not found
    400BadRequest:
      description: Bad request
    401NotAuthenticated:
      description: Not authenticated
    500ServerError:
      description: Server error
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY