{"components":{"parameters":{"ApplyDynamicValidation":{"description":"Controls whether T3 should apply dynamic validation before forwarded to Metrc.\n  - **If present and set to 'true'**: The request will be dynamically validated. An error will be returned if dynamic validation fails.\n  - **If omitted or set to any value other than 'true'**: This parameter has no effect.\nExamples:\n  - \"true\": Apply dynamic validation\n  - \"false\": No-op\n\n**Dynamic validation** refers to validation that:\n  - Requires making API calls to Metrc to validate data dependencies (e.g., verifying that referenced items exist in Metrc).\n  - Cannot be performed through static schema validation alone.\n  - Does not guarantee that the request will be accepted by Metrc, as Metrc may have additional business rules not covered by T3's validation.\n","in":"query","name":"applyDynamicValidation","required":false,"schema":{"example":"true","type":"string"}},"LicenseNumber":{"description":"The unique identifier for the license associated with this request.\n\n## Behavior\n\n- Only one license can be queried per request\n- The `licenseNumber` parameter must match an active license accessible to the authenticated user\n- Use the licenses endpoint to retrieve available license numbers\n\n## Examples\n\n<details>\n<summary>Click to expand</summary>\n\n### Example 1: View available licenses\nRetrieve all licenses available to the current user:\n```\nGET https://api.trackandtrace.tools/v2/licenses\n```\n\n### Example 2: Query with license number\nSpecify the target license with the required `licenseNumber` query parameter:\n```\nGET https://api.trackandtrace.tools/v2/items?licenseNumber=LIC-00001\n```\n\n</details>\n\n## Notes\n\n- The license number is required for all data-retrieval endpoints\n- Invalid or inaccessible license numbers will return an authorization error\n- License numbers are case-sensitive\n","in":"query","name":"licenseNumber","required":true,"schema":{"example":"LIC-00001","type":"string"}},"SkipDynamicValidationChecks":{"description":"Allows selectively skipping specific dynamic validation checks when `applyDynamicValidation=true`.\nEach value should be a valid dynamic check key. Unrecognized keys are silently ignored.\n\nUse this parameter multiple times to skip multiple checks:\n  - `?skipDynamicValidationChecks=CREATE_PACKAGES_TAG_IDS_EXIST&skipDynamicValidationChecks=CREATE_PACKAGES_LOCATION_IDS_EXIST`\n\nAvailable check keys per endpoint:\n\n**Create Packages from Packages:**\n  - `CREATE_PACKAGES_PACKAGE_IDS_EXIST` \u2014 Skip ingredient source package ID validation\n  - `CREATE_PACKAGES_UNIT_OF_MEASURE_IDS_EXIST` \u2014 Skip unit of measure ID validation\n  - `CREATE_PACKAGES_ITEM_IDS_EXIST` \u2014 Skip item ID validation\n  - `CREATE_PACKAGES_TAG_IDS_EXIST` \u2014 Skip tag ID validation\n  - `CREATE_PACKAGES_LOCATION_IDS_EXIST` \u2014 Skip location ID validation\n\n**Create Transfer Templates:**\n  - `PACKAGE_IDS_EXIST` \u2014 Skip package ID validation\n  - `TRANSFER_TYPE_IDS_EXIST` \u2014 Skip transfer type ID validation\n\n**Discontinue Item:**\n  - `DISCONTINUE_ITEM_ID_EXISTS` \u2014 Skip item ID validation against active items\n\n**Discontinue Strain:**\n  - `DISCONTINUE_STRAIN_ID_EXISTS` \u2014 Skip strain ID validation against active strains\n\n**Void Transfer:**\n  - `VOID_TRANSFER_ID_EXISTS` \u2014 Skip transfer ID validation against outgoing active transfers\n\n**Void Sales Receipt:**\n  - `VOID_SALES_RECEIPT_ID_EXISTS` \u2014 Skip sales receipt ID validation against active sales\n\n**Unfinalize Sales:**\n  - `UNFINALIZE_SALES_IDS_EXIST` \u2014 Skip sales receipt ID validation against inactive sales\n\n**Unfinish Packages:**\n  - `UNFINISH_PACKAGES_IDS_EXIST` \u2014 Skip package ID validation against inactive packages\n\n**Adjust Packages:**\n  - `ADJUST_PACKAGES_PACKAGE_IDS_EXIST` \u2014 Skip package ID validation against active packages\n  - `ADJUST_PACKAGES_UOM_IDS_EXIST` \u2014 Skip unit of measure ID validation\n  - `ADJUST_PACKAGES_REASON_IDS_EXIST` \u2014 Skip adjustment reason ID validation\n\n**Create Testing Packages:**\n  - Same checks as Create Packages from Packages (shared check functions)\n\n**Create Transfers:**\n  - `PACKAGE_IDS_EXIST` \u2014 Skip package ID validation\n  - `TRANSFER_TYPE_IDS_EXIST` \u2014 Skip transfer type ID validation\n\n**Create Items:**\n  - `CREATE_ITEMS_PRODUCT_CATEGORY_IDS_EXIST` \u2014 Skip product category ID validation\n  - `CREATE_ITEMS_STRAIN_IDS_EXIST` \u2014 Skip strain ID validation\n  - `CREATE_ITEMS_UOM_IDS_EXIST` \u2014 Skip unit of measure ID validation\n\n**Update Transfers:**\n  - `UPDATE_TRANSFER_ID_EXISTS` \u2014 Skip transfer ID validation against outgoing active transfers\n  - `PACKAGE_IDS_EXIST` \u2014 Skip package ID validation\n  - `TRANSFER_TYPE_IDS_EXIST` \u2014 Skip transfer type ID validation\n\n**Update Transfer Templates:**\n  - `UPDATE_TRANSFER_TEMPLATES_IDS_EXIST` \u2014 Skip template ID validation\n  - `PACKAGE_IDS_EXIST` \u2014 Skip package ID validation\n  - `TRANSFER_TYPE_IDS_EXIST` \u2014 Skip transfer type ID validation\n\n**Archive Transfer Template:**\n  - `ARCHIVE_TRANSFER_TEMPLATE_ID_EXISTS` \u2014 Skip template ID validation\n\n**Create Strains:**\n  - `CREATE_STRAINS_PERCENTAGES_VALID` \u2014 Skip indica/sativa percentage sum validation\n\n**Add Package Notes:**\n  - `ADD_PACKAGE_NOTES_PACKAGE_IDS_EXIST` \u2014 Skip package ID validation against active packages\n\nIf `applyDynamicValidation` is not set to `true`, this parameter has no effect.\n","explode":true,"in":"query","name":"skipDynamicValidationChecks","required":false,"schema":{"example":"CREATE_PACKAGES_TAG_IDS_EXIST","items":{"type":"string"},"type":"array"},"style":"form"},"Submit":{"description":"Controls whether this request should be forwarded to Metrc.\n- **If present and set to 'true'**: The request will be subjected to static validation and forwarded to Metrc if validation passes.\n- **If omitted or set to any value other than 'true'**: The request will only be subjected to static validation.\nExamples:\n  - \"true\": Forward the request to Metrc\n  - \"false\": Execute a dry run\n","in":"query","name":"submit","required":false,"schema":{"example":"true","type":"string"}}},"schemas":{"ItemImageFileType":{"description":"Category of the image file","enum":["ItemLabelImage","ItemPackagingImage","ItemProductImage"],"example":"ItemProductImage","type":"string"},"MetrcCreateItemsPayload":{"items":{"additionalProperties":false,"properties":{"administrationMethod":{"description":"The administration method","example":"","type":"string"},"allergens":{"description":"Allergens information","example":"","type":"string"},"description":{"description":"The item description","example":"","type":"string"},"itemBrandId":{"description":"The item brand ID","example":null,"type":"integer"},"itemIngredients":{"description":"Ingredients for the item","items":{"$ref":"#/components/schemas/MetrcItemIngredientEntry"},"type":"array"},"labelPhotoDescription":{"description":"Description for the label photo","example":"","type":"string"},"labelPhotos":{"description":"Label photos to attach to the item","items":{"$ref":"#/components/schemas/MetrcItemImageReference"},"type":"array"},"name":{"description":"The name of the item","example":"Blue Dream Flower","type":"string"},"numberOfDoses":{"description":"The number of doses","example":null,"type":"integer"},"packagingPhotoDescription":{"description":"Description for the packaging photo","example":"","type":"string"},"packagingPhotos":{"description":"Packaging photos to attach to the item","items":{"$ref":"#/components/schemas/MetrcItemImageReference"},"type":"array"},"productCategoryId":{"description":"The product category ID","example":1,"type":"integer"},"productPhotoDescription":{"description":"Description for the product photo","example":"","type":"string"},"productPhotos":{"description":"Product photos to attach to the item","items":{"$ref":"#/components/schemas/MetrcItemImageReference"},"type":"array"},"publicIngredients":{"description":"Public ingredients information","example":"","type":"string"},"servingSize":{"description":"The serving size","example":"","type":"string"},"strainId":{"description":"The strain ID","example":737,"type":"integer"},"supplyDurationDays":{"description":"The supply duration in days","example":null,"type":"integer"},"unitCbdAContentDoseUoMId":{"description":"The unit CBD-A content dose unit of measure ID","example":null,"type":"integer"},"unitCbdAContentUoMId":{"description":"The unit CBD-A content unit of measure ID","example":null,"type":"integer"},"unitCbdContentDoseUoMId":{"description":"The unit CBD content dose unit of measure ID","example":null,"type":"integer"},"unitCbdContentUoMId":{"description":"The unit CBD content unit of measure ID","example":null,"type":"integer"},"unitOfMeasureId":{"description":"The unit of measure ID","example":2,"type":"integer"},"unitThcAContentDoseUoMId":{"description":"The unit THC-A content dose unit of measure ID","example":null,"type":"integer"},"unitThcAContentUoMId":{"description":"The unit THC-A content unit of measure ID","example":null,"type":"integer"},"unitThcContent":{"description":"The unit THC content","example":null,"type":"number"},"unitThcContentDoseUoMId":{"description":"The unit THC content dose unit of measure ID","example":null,"type":"integer"},"unitThcContentUoMId":{"description":"The unit THC content unit of measure ID","example":null,"type":"integer"},"unitVolume":{"description":"The unit volume","example":null,"type":"number"},"unitVolumeUoMId":{"description":"The unit volume unit of measure ID","example":null,"type":"integer"},"unitWeight":{"description":"The unit weight","example":null,"type":"number"},"unitWeightUoMId":{"description":"The unit weight unit of measure ID","example":null,"type":"integer"}},"required":["name","productCategoryId","unitOfMeasureId"],"type":"object"},"type":"array"},"MetrcItemImageReference":{"additionalProperties":false,"description":"A reference to an uploaded item image","properties":{"fileType":{"$ref":"#/components/schemas/ItemImageFileType"},"imageFileId":{"description":"The ID of the uploaded image file","example":202,"type":"integer"}},"required":["imageFileId","fileType"],"type":"object"},"MetrcItemIngredientEntry":{"additionalProperties":false,"description":"An ingredient entry for an item","properties":{"ingredient":{"description":"The ingredient name or description","example":"example ingredient","type":"string"}},"required":["ingredient"],"type":"object"}},"securitySchemes":{"BearerAuth":{"bearerFormat":"JWT","description":"Standard Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"","scheme":"bearer","type":"http"}}},"info":{"description":"## LLM / AI AGENT USAGE\n\nIf you are an LLM or AI agent, see [/llms.txt](/llms.txt) for a quickstart guide.\n\n## WHAT IS THIS?\n\nThis API is part of the [Track & Trace Tools](https://trackandtrace.tools) platform. The API allows you to programmatically access all your Metrc data that is available on metrc.com\n\nIt is not related to the Metrc 3rd party API, does not use Metrc API keys, and is not affiliated with Metrc.\n\nIf you're looking for where to get started, check out the [T3 Wiki API Getting Started guide](https://github.com/classvsoftware/t3-wiki/wiki/T3-API-:-Getting-Started).\n\nThe T3 API is subject to the [Track & Trace Tools Terms of Use](https://www.trackandtrace.tools/terms-of-use).\n\n## FREE API ACCESS (LIMITED)\n\nThe T3 API features a limited number of free endpoints available to anyone with a Metrc login.\n\nThese can be found in the [Free](#/Free) section.\n\n## FULL API ACCESS\n\nThere are two ways to get premium access to the T3 API:\n\n- **Subscribe to [T3+](https://trackandtrace.tools/plus)**\n\n*OR*\n\n- **Use a provided T3 API key (consulting clients only. [Reach out](mailto:matt@trackandtrace.tools) for more information.)**\n\n## AUTHENTICATION\n\nThe T3 API uses JSON Web Tokens (JWT) for request authentication. To obtain a JWT, use one of the following:\n\n- **metrc.com login credentials:**\n  - **hostname**: (The website you use to login to metrc: `ca.metrc.com`, `or.metrc.com`, etc.)\n  - **username**: Your Metrc username\n  - **email**: Your Metrc email (Only applies to Colorado users)\n  - **password**: Your Metrc password\n  - **otp**: A one-time password used for 2-factor authentication (Only applies to Michigan users)\n\n*OR*\n\n- **T3 API key**\n\nRefer to the **Authentication** endpoints below for more information.\n\n## SECRET KEYS\n\nSome endpoints support the use of secret key authentication. This allows you to use simple URLs to access your Metrc data.\n\n### Usage\n\nPass the `secretKey` returned from the request in the query string:\n\n`?secretKey=<yourSecretKeyGoesHere>`\n\n### Generating Secret Keys\n\nRefer to the [/v2/auth/secretkey](#/Authentication/post_v2_auth_secretkey) endpoint for information on generating secret keys.\n\n[Secret Key Generation Tool](/v2/pages/secret-key)\n\n[Sync Link Creation Tool](/v2/pages/sync-link)\n\n## SECURITY\n\nThe T3 API interacts with Metrc in a similar manner to the [Track & Trace Tools](https://chromewebstore.google.com/detail/track-trace-tools/dfljickgkbfaoiifheibjpejloipegcb) Chrome extension. The API login process is designed with a strong emphasis on security. Your Metrc login details are never stored, and the API backend employs robust encryption methods to protect your temporary Metrc session.\n\n### Key Security Measures:\n\n- **Single-Use Login Credentials:**\n  - The T3 API uses your login credentials only once to authenticate with Metrc.\n  - After the Metrc login process is complete, your login credentials are immediately deleted from the system.\n  - You are required to enter your login credentials each time you access the T3 API, ensuring that your credentials are never stored.\n\n- **Secure Temporary Session Storage:**\n  - The T3 API securely encrypts your logged-in Metrc session data. This data is only used when you make requests through the T3 API.\n  - The encrypted session data is automatically deleted after 24 hours, ensuring that your session information is not retained longer than necessary.\n\nFor any questions or concerns, please contact [matt@trackandtrace.tools](mailto:matt@trackandtrace.tools).\n\n## PRIVACY\n\nThe T3 API privacy model follows the same principles as the [Track & Trace Tools](https://chromewebstore.google.com/detail/track-trace-tools/dfljickgkbfaoiifheibjpejloipegcb) Chrome extension. The T3 API functions solely as a connector between you and Metrc, ensuring your privacy is protected.\n\n- **No Data Collection:**\n  - The T3 API does not record, save, harvest, inspect, or analyze any of your data.\n  - All data interactions are ephemeral and occur in real-time, without permanent storage.\n\n- **Secure and Private Access:**\n  - Your data is never shared with third parties. Unauthorized access to your login information or data is strictly prohibited.\n  - T3 employs industry-standard encryption protocols to safeguard all communications between the T3 API and Metrc.\n\n- **User-Controlled Sessions:**\n  - Your Metrc login credentials and session are used exclusively by you. The T3 API will never initiate Metrc traffic without your explicit authorization.\n\n- **Compliance and Best Practices:**\n  - T3's privacy practices are aligned with applicable data protection regulations, including GDPR and CCPA, ensuring that your data rights are respected.\n\nThe T3 API is subject to the [Track & Trace Tools Privacy Policy](https://trackandtrace.tools/privacy-policy). For any privacy-related inquiries, please contact [matt@trackandtrace.tools](mailto:matt@trackandtrace.tools).\n\n## PERMISSIONS\n\nEach Metrc account has different permissions based on several factors:\n\n- Permissions granted by your Metrc admin\n- Class of license (manufacturing, cultivation, etc)\n- US state the license operates in\n\nUse the Permissions endpoints to determine which actions are available to you.\n\n## LICENSES\n\nView a list of all licenses available to the current user:\n\n`GET https://api.trackandtrace.tools/v2/licenses`\n\nOnly one license can be queried per request. Specify the target license with the required `licenseNumber` query parameter:\n\n`GET https://api.trackandtrace.tools/v2/items?licenseNumber=LIC-00001`\n\n## RATE LIMITING\n\nThe API has a global default request rate limit of 600 requests/minute/user. Some routes have lower rate limits.\n\n## COLLECTIONS\n\nMost Metrc data is queried as a \"collection\". There are no individual object endpoints.  For example, you cannot find an individual object using an endpoint like `/plants/{plantId}`, individual objects must be queried by filtering the collection endpoint `/plants`.\n\nAlthough the T3 API write endpoints use IDs to identify objects, Metrc does not allow for filtering/querying by ID. You will need to query with a different unique identifier like `label`, or load a full collection and then filter.\n\nCollections are paginated, and can be filtered and sorted by individual object fields.\n\nThe JSON response object includes the following properties:\n- `data`: An array of objects, or any empty array\n- `page`: The requested page index\n- `pageSize`: The requested page size\n- `total`: The total number of items in this collection. Use this to determine how many pages are required to return the entire collection.\n\n### LOADING FULL COLLECTIONS\n`pageSize` is limited to 500 in most cases, so you may need to load multiple pages if a license has a large number of packages.\n\nRefer to [this example](https://github.com/classvsoftware/t3-api/blob/master/load_all_active_packages.py) for how to load a full collection in a python script.\n\n## USING THE API\n\nFull documentation on using the T3 API can be found [here](https://github.com/classvsoftware/t3-wiki/wiki/T3-API).\n\n## CONTACT\n\n- **Responsible Organization:** Class V LLC\n- **Responsible Developer:** Matt Frisbie\n- **Email:** [matt@trackandtrace.tools](mailto:matt@trackandtrace.tools)\n- **URL:** [https://trackandtrace.tools](https://trackandtrace.tools)\n- **Terms of Use:** [https://www.trackandtrace.tools/terms-of-use](https://www.trackandtrace.tools/terms-of-use)\n","title":"T3 API","version":"v2"},"openapi":"3.0.2","paths":{"/v2/items/create":{"post":{"description":"**Refer to the request body schema for details on formatting your request**\n\n'\n","parameters":[{"$ref":"#/components/parameters/LicenseNumber"},{"$ref":"#/components/parameters/Submit"},{"$ref":"#/components/parameters/ApplyDynamicValidation"},{"$ref":"#/components/parameters/SkipDynamicValidationChecks"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetrcCreateItemsPayload"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"message":{"description":"Describes the nature of this successful operation\n- \"Success\" indicates the request passed validation and was successfully passed to Metrc\n- \"Dry run\" indicates the request passed validation, but the request was not sent to Metrc\n","example":"Success","type":"string"}},"type":"object"}}},"description":"The operation completed successfully.\n"},"400":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"message":{"example":"400 Bad Request: Invalid request body: 'note' is a required property","type":"string"},"status_code":{"example":400,"type":"integer"},"timestamp":{"example":"2024-08-09T12:34:56.789Z","format":"date-time","type":"string"},"type":{"example":"BadRequest","type":"string"},"url":{"example":"https://api.trackandtrace.tools/some-endpoint","type":"string"}},"type":"object"}},"type":"object"}}},"description":"An error response indicating the request was invalid. Refer to the response body for details."},"500":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"message":{"example":"500 InternalServerError","type":"string"},"status_code":{"example":500,"type":"integer"},"timestamp":{"example":"2024-08-09T12:34:56.789Z","format":"date-time","type":"string"},"type":{"example":"InternalServerError","type":"string"},"url":{"example":"https://api.trackandtrace.tools/some-endpoint","type":"string"}},"type":"object"}},"type":"object"}}},"description":"An error response indicating the server experienced an unexpected error."},"503":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"message":{"example":"503 ServiceUnavailable","type":"string"},"status_code":{"example":503,"type":"integer"},"timestamp":{"example":"2024-08-09T12:34:56.789Z","format":"date-time","type":"string"},"type":{"example":"ServiceUnavailable","type":"string"},"url":{"example":"https://api.trackandtrace.tools/some-endpoint","type":"string"}},"type":"object"}},"type":"object"}}},"description":"An error response indicating the Metrc servers are experiencing downtime."}},"summary":"Create one or more items","tags":["Items","Create Items"]}}},"security":[{"BearerAuth":[]}],"servers":[{"url":"https://api.trackandtrace.tools"}]}
