### Making Calls with Timestamps (URL Encoding) Source: https://api-ca.metrc.com/Documentation Guidance on properly encoding timestamps when used in query strings for GET requests. ```APIDOC ## Making Calls with Timestamps ### Description When including date/time values in query strings (e.g., for GET requests), it is crucial to URL-encode them correctly. Specifically, plus signs (+) in time zone offsets must be encoded as `%2B` to ensure accurate interpretation. ### Example **Incorrect:** `GET /packages/v2/active?licenseNumber=123-ABC&lastModifiedStart=2023-11-01T08:00:00+02:00` **Correct:** `GET /packages/v2/active?licenseNumber=123-ABC&lastModifiedStart=2023-11-01T08:00:00%2B02:00` ``` -------------------------------- ### GET /sales/v2/counties Source: https://api-ca.metrc.com/Documentation Retrieves a list of counties. This endpoint allows you to fetch information about different counties. ```APIDOC ## GET /sales/v2/counties ### Description Retrieves a list of counties. ### Method GET ### Endpoint /sales/v2/counties ### Parameters #### Path Parameters - **None** #### Query Parameters - **None** #### Request Body - **None** ### Request Example ```json {} ``` ### Response #### Success Response (200) - **counties** (array) - An array of county objects. #### Response Example ```json [ { "id": 1, "name": "Alameda" } ] ``` ``` -------------------------------- ### GET /sales/v2/deliveries/returnreasons Source: https://api-ca.metrc.com/Documentation Retrieves a list of delivery return reasons. This endpoint provides information about the reasons for delivery returns. ```APIDOC ## GET /sales/v2/deliveries/returnreasons ### Description Retrieves a list of delivery return reasons. ### Method GET ### Endpoint /sales/v2/deliveries/returnreasons ### Parameters #### Path Parameters - **None** #### Query Parameters - **None** #### Request Body - **None** ### Request Example ```json {} ``` ### Response #### Success Response (200) - **reasons** (array) - An array of return reason objects. #### Response Example ```json [ { "id": 1, "reason": "Damaged" } ] ``` ``` -------------------------------- ### GET /sales/v2/customertypes Source: https://api-ca.metrc.com/Documentation Retrieves a list of customer types. This endpoint allows you to fetch information about different customer categories. ```APIDOC ## GET /sales/v2/customertypes ### Description Retrieves a list of customer types. ### Method GET ### Endpoint /sales/v2/customertypes ### Parameters #### Path Parameters - **None** #### Query Parameters - **None** #### Request Body - **None** ### Request Example ```json {} ``` ### Response #### Success Response (200) - **customerTypes** (array) - An array of customer type objects. #### Response Example ```json [ { "id": 1, "name": "Retail" } ] ``` ``` -------------------------------- ### GET /sales/v2/receipts/active Source: https://api-ca.metrc.com/Documentation Retrieves a list of active receipts. This endpoint allows you to fetch receipts that are currently active. ```APIDOC ## GET /sales/v2/receipts/active ### Description Retrieves a list of active receipts. ### Method GET ### Endpoint /sales/v2/receipts/active ### Parameters #### Path Parameters - **None** #### Query Parameters - **None** #### Request Body - **None** ### Request Example ```json {} ``` ### Response #### Success Response (200) - **receipts** (array) - An array of active receipt objects. #### Response Example ```json [ { "id": 1, "status": "Open" } ] ``` ``` -------------------------------- ### GET /sales/v2/paymenttypes Source: https://api-ca.metrc.com/Documentation Retrieves a list of payment types. This endpoint allows you to fetch information about different payment methods. ```APIDOC ## GET /sales/v2/paymenttypes ### Description Retrieves a list of payment types. ### Method GET ### Endpoint /sales/v2/paymenttypes ### Parameters #### Path Parameters - **None** #### Query Parameters - **None** #### Request Body - **None** ### Request Example ```json {} ``` ### Response #### Success Response (200) - **paymentTypes** (array) - An array of payment type objects. #### Response Example ```json [ { "id": 1, "name": "Cash" } ] ``` ``` -------------------------------- ### GET /sales/v2/receipts/{id} Source: https://api-ca.metrc.com/Documentation Retrieves details of a specific receipt by its ID. This endpoint provides information about a particular receipt. ```APIDOC ## GET /sales/v2/receipts/{id} ### Description Retrieves details of a specific receipt by its ID. ### Method GET ### Endpoint /sales/v2/receipts/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the receipt. #### Query Parameters - **None** #### Request Body - **None** ### Request Example ```json {} ``` ### Response #### Success Response (200) - **receipt** (object) - The receipt object. #### Response Example ```json { "id": 1, "total": 100.00 } ``` ``` -------------------------------- ### GET /sales/v2/patientregistration/locations Source: https://api-ca.metrc.com/Documentation Retrieves a list of patient registration locations. This endpoint is used to get information about locations related to patient registration. ```APIDOC ## GET /sales/v2/patientregistration/locations ### Description Retrieves a list of patient registration locations. ### Method GET ### Endpoint /sales/v2/patientregistration/locations ### Parameters #### Path Parameters - **None** #### Query Parameters - **None** #### Request Body - **None** ### Request Example ```json {} ``` ### Response #### Success Response (200) - **locations** (array) - An array of location objects. #### Response Example ```json [ { "id": 1, "name": "Location A" } ] ``` ``` -------------------------------- ### GET /sales/v2/deliveries/active Source: https://api-ca.metrc.com/Documentation Retrieves a list of active deliveries. This endpoint allows you to fetch deliveries that are currently active. ```APIDOC ## GET /sales/v2/deliveries/active ### Description Retrieves a list of active deliveries. ### Method GET ### Endpoint /sales/v2/deliveries/active ### Parameters #### Path Parameters - **None** #### Query Parameters - **None** #### Request Body - **None** ### Request Example ```json {} ``` ### Response #### Success Response (200) - **deliveries** (array) - An array of active delivery objects. #### Response Example ```json [ { "id": 1, "status": "Shipped" } ] ``` ``` -------------------------------- ### GET /sales/v2/receipts/inactive Source: https://api-ca.metrc.com/Documentation Retrieves a list of inactive receipts. This endpoint allows you to fetch receipts that are currently inactive. ```APIDOC ## GET /sales/v2/receipts/inactive ### Description Retrieves a list of inactive receipts. ### Method GET ### Endpoint /sales/v2/receipts/inactive ### Parameters #### Path Parameters - **None** #### Query Parameters - **None** #### Request Body - **None** ### Request Example ```json {} ``` ### Response #### Success Response (200) - **receipts** (array) - An array of inactive receipt objects. #### Response Example ```json [ { "id": 1, "status": "Closed" } ] ``` ``` -------------------------------- ### Processing Jobs API (v2) Source: https://api-ca.metrc.com/Documentation Endpoints for managing processing jobs, including retrieval of specific jobs, active/inactive jobs, job types, attributes, categories, and operations like creation, starting, adjusting, finishing, unfinishing, and deletion. ```APIDOC ## Processing Jobs API (v2) ### Description Endpoints for managing processing jobs, including retrieval of specific jobs, active/inactive jobs, job types, attributes, categories, and operations like creation, starting, adjusting, finishing, unfinishing, and deletion. ### Endpoints - `GET /processing/v2/{id}` - `GET /processing/v2/active` - `GET /processing/v2/inactive` - `GET /processing/v2/jobtypes/active` - `GET /processing/v2/jobtypes/inactive` - `GET /processing/v2/jobtypes/attributes` - `GET /processing/v2/jobtypes/categories` - `POST /processing/v2/createpackages` - `POST /processing/v2/start` - `POST /processing/v2/adjust` - `POST /processing/v2/jobtypes` - `PUT /processing/v2/finish` - `PUT /processing/v2/unfinish` - `PUT /processing/v2/jobtypes` - `DELETE /processing/v2/jobtypes/{id}` - `DELETE /processing/v2/{id}` ``` -------------------------------- ### GET /sales/v2/deliveries/retailer/active Source: https://api-ca.metrc.com/Documentation Retrieves a list of active deliveries for a retailer. This endpoint allows you to fetch deliveries that are currently active for a specific retailer. ```APIDOC ## GET /sales/v2/deliveries/retailer/active ### Description Retrieves a list of active deliveries for a retailer. ### Method GET ### Endpoint /sales/v2/deliveries/retailer/active ### Parameters #### Path Parameters - **None** #### Query Parameters - **None** #### Request Body - **None** ### Request Example ```json {} ``` ### Response #### Success Response (200) - **deliveries** (array) - An array of active delivery objects for the retailer. #### Response Example ```json [ { "id": 1, "status": "Shipped" } ] ``` ``` -------------------------------- ### GET /sales/v2/deliveries/{id} Source: https://api-ca.metrc.com/Documentation Retrieves details of a specific delivery by its ID. This endpoint provides information about a particular delivery. ```APIDOC ## GET /sales/v2/deliveries/{id} ### Description Retrieves details of a specific delivery by its ID. ### Method GET ### Endpoint /sales/v2/deliveries/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the delivery. #### Query Parameters - **None** #### Request Body - **None** ### Request Example ```json {} ``` ### Response #### Success Response (200) - **delivery** (object) - The delivery object. #### Response Example ```json { "id": 1, "status": "Shipped" } ``` ``` -------------------------------- ### GET /sales/v2/deliveries/retailer/{id} Source: https://api-ca.metrc.com/Documentation Retrieves details of a specific delivery for a retailer by its ID. This endpoint provides information about a particular delivery for a retailer. -------------------------------- ### Example API Error Response JSON Source: https://api-ca.metrc.com/Documentation This JSON structure represents a typical error response from the API, indicating the row number and a description of the error encountered. It is useful for understanding how errors are reported in batch operations. ```json [ { "row": 0, "message": "-- error description --" }, { "row": 1, "message": "-- error description --" } ] ``` -------------------------------- ### GET /sales/v2/receipts/external/{externalNumber} Source: https://api-ca.metrc.com/Documentation Retrieves details of a specific receipt by its external number. This endpoint provides information about a particular receipt using an external identifier. ```APIDOC ## GET /sales/v2/receipts/external/{externalNumber} ### Description Retrieves details of a specific receipt by its external number. ### Method GET ### Endpoint /sales/v2/receipts/external/{externalNumber} ### Parameters #### Path Parameters - **externalNumber** (string) - Required - The external number of the receipt. #### Query Parameters - **None** #### Request Body - **None** ### Request Example ```json {} ``` ### Response #### Success Response (200) - **receipt** (object) - The receipt object. #### Response Example ```json { "id": 1, "total": 100.00 } ``` ``` -------------------------------- ### GET /sales/v2/deliveries/retailer/inactive Source: https://api-ca.metrc.com/Documentation Retrieves a list of inactive deliveries for a retailer. This endpoint allows you to fetch deliveries that are currently inactive for a specific retailer. ```APIDOC ## GET /sales/v2/deliveries/retailer/inactive ### Description Retrieves a list of inactive deliveries for a retailer. ### Method GET ### Endpoint /sales/v2/deliveries/retailer/inactive ### Parameters #### Path Parameters - **None** #### Query Parameters - **None** #### Request Body - **None** ### Request Example ```json {} ``` ### Response #### Success Response (200) - **deliveries** (array) - An array of inactive delivery objects for the retailer. #### Response Example ```json [ { "id": 1, "status": "Completed" } ] ``` ``` -------------------------------- ### Record Matching Source: https://api-ca.metrc.com/Documentation Explanation of how to reference resources using either their unique ID or their name. ```APIDOC ## Record Matching ### Description For certain API resources like Harvests and Plant Batches, you can reference them using either their unique ID or their name. When using the name, the comparison is case-insensitive. ``` -------------------------------- ### Authentication Source: https://api-ca.metrc.com/Documentation Information on how to authenticate API requests using Integrator and User API Keys. ```APIDOC ### Integrator API Key Your Integrator API Key is specific to your company and the software you develop. It should be used by every instance of your software at all times. Keep this API key safe and protected. ### User API Key API calls require a user API key, which your industry customer creates and provides to you. The user API key is tied directly to the user's account. Your software will be limited by the permissions granted to the user within Metrc. ### Authentication Header Both API keys must be sent through the `Authorization` HTTP header using basic access authentication. 1. Combine the keys: `software_api_key:user_api_key` 2. Encode the combined string using RFC2045-MIME Base64. 3. Prepend `Basic ` to the encoded string. Example Header: `Authorization: Basic ` ``` -------------------------------- ### Facilities API (v2) Source: https://api-ca.metrc.com/Documentation Retrieve facility information. ```APIDOC ## Facilities API (v2) ### Description Retrieve facility information. ### Endpoint `GET /facilities/v2/` ``` -------------------------------- ### Plants API (v2) Source: https://api-ca.metrc.com/Documentation Endpoints for managing plants, including retrieval by ID or label, different growth stages (vegetative, flowering), statuses (on-hold, inactive), mother plant information, additives, growth phases, waste management, and various operations like creation, updates, and deletion. ```APIDOC ## Plants API (v2) ### Description Endpoints for managing plants, including retrieval by ID or label, different growth stages (vegetative, flowering), statuses (on-hold, inactive), mother plant information, additives, growth phases, waste management, and various operations like creation, updates, and deletion. ### Endpoints - `GET /plants/v2/additives/types` - `GET /plants/v2/{id}` - `GET /plants/v2/{label}` - `GET /plants/v2/vegetative` - `GET /plants/v2/flowering` - `GET /plants/v2/onhold` - `GET /plants/v2/inactive` - `GET /plants/v2/mother` - `GET /plants/v2/mother/inactive` - `GET /plants/v2/mother/onhold` - `GET /plants/v2/additives` - `GET /plants/v2/growthphases` - `GET /plants/v2/waste/reasons` - `POST /plants/v2/additives` - `POST /plants/v2/additives/usingtemplate` - `POST /plants/v2/additives/bylocation` - `POST /plants/v2/additives/bylocation/usingtemplate` - `POST /plants/v2/plantings` - `POST /plants/v2/plantbatch/packages` - `POST /plants/v2/manicure` - `PUT /plants/v2/location` - `PUT /plants/v2/growthphase` - `PUT /plants/v2/tag` - `PUT /plants/v2/strain` - `PUT /plants/v2/harvest` - `PUT /plants/v2/merge` - `DELETE /plants/v2/` - `POST /plants/v2/waste` - `GET /plants/v2/waste/methods/all` - `PUT /plants/v2/split` - `GET /plants/v2/waste` - `GET /plants/v2/waste/{id}/plant` - `GET /plants/v2/waste/{id}/package` ``` -------------------------------- ### Packages API (v2) Source: https://api-ca.metrc.com/Documentation Comprehensive endpoints for managing packages, including retrieval of specific packages, adjustments, sources, labels, statuses (active, inactive, on-hold, in-transit), types, and various operations like creation, updates, and deletion. ```APIDOC ## Packages API (v2) ### Description Comprehensive endpoints for managing packages, including retrieval of specific packages, adjustments, sources, labels, statuses (active, inactive, on-hold, in-transit), types, and various operations like creation, updates, and deletion. ### Endpoints - `GET /packages/v2/{id}` - `GET /packages/v2/adjustments` - `GET /packages/v2/{id}/source/harvests` - `GET /packages/v2/{label}` - `GET /packages/v2/active` - `GET /packages/v2/onhold` - `GET /packages/v2/inactive` - `GET /packages/v2/intransit` - `GET /packages/v2/labsamples` - `GET /packages/v2/types` - `GET /packages/v2/adjust/reasons` - `POST /packages/v2/` - `POST /packages/v2/testing` - `POST /packages/v2/plantings` - `PUT /packages/v2/donation/flag` - `PUT /packages/v2/donation/unflag` - `PUT /packages/v2/usebydate` - `PUT /packages/v2/item` - `PUT /packages/v2/note` - `PUT /packages/v2/location` - `PUT /packages/v2/labtests/required` - `PUT /packages/v2/externalid` - `PUT /packages/v2/tradesample/flag` - `PUT /packages/v2/tradesample/unflag` - `PUT /packages/v2/adjust` - `POST /packages/v2/adjust` - `PUT /packages/v2/remediate` - `PUT /packages/v2/pretreat` - `PUT /packages/v2/finish` - `PUT /packages/v2/unfinish` - `DELETE /packages/v2/{id}` - `PUT /packages/v2/decontaminate` - `PUT /packages/v2/finishedgood/flag` - `PUT /packages/v2/finishedgood/unflag` - `GET /packages/v2/transferred` ``` -------------------------------- ### GET /sales/v2/deliveries/inactive Source: https://api-ca.metrc.com/Documentation Retrieves a list of inactive deliveries. This endpoint allows you to fetch deliveries that are currently inactive. ```APIDOC ## GET /sales/v2/deliveries/inactive ### Description Retrieves a list of inactive deliveries. ### Method GET ### Endpoint /sales/v2/deliveries/inactive ### Parameters #### Path Parameters - **None** #### Query Parameters - **None** #### Request Body - **None** ### Request Example ```json {} ``` ### Response #### Success Response (200) - **deliveries** (array) - An array of inactive delivery objects. #### Response Example ```json [ { "id": 1, "status": "Completed" } ] ``` ``` -------------------------------- ### Packages API Source: https://api-ca.metrc.com/Documentation Comprehensive endpoints for managing package data, including creation, status updates, adjustments, and transfers. ```APIDOC ## Packages Management API ### Description Provides a comprehensive set of endpoints for managing package data. This includes retrieving packages by ID or label, filtering by status (active, on hold, inactive), accessing package types and adjustment reasons, and performing actions such as creating, updating, adjusting, finishing, and remediating packages. ### Method GET, POST, PUT ### Endpoints - GET /packages/v1/{id} - GET /packages/v1/{label} - GET /packages/v1/active - GET /packages/v1/onhold - GET /packages/v1/inactive - GET /packages/v1/types - GET /packages/v1/adjust/reasons - POST /packages/v1/create - POST /packages/v1/create/testing - POST /packages/v1/create/plantings - POST /packages/v1/change/item - PUT /packages/v1/change/note - POST /packages/v1/change/locations - POST /packages/v1/adjust - POST /packages/v1/finish - POST /packages/v1/unfinish - POST /packages/v1/remediate ``` -------------------------------- ### Retail Id API (v2) Source: https://api-ca.metrc.com/Documentation Endpoints for managing retail IDs, including allotment, association, generation, merging, package information retrieval, and receiving by label or QR code. ```APIDOC ## Retail Id API (v2) ### Description Endpoints for managing retail IDs, including allotment, association, generation, merging, package information retrieval, and receiving by label or QR code. ### Endpoints - `GET /retailid/v2/allotment` - `POST /retailid/v2/associate` - `POST /retailid/v2/generate` - `POST /retailid/v2/merge` - `POST /retailid/v2/packages/info` - `GET /retailid/v2/receive/{label}` - `GET /retailid/v2/receive/qr/{shortCode}` ``` -------------------------------- ### Additives Templates API (v2) Source: https://api-ca.metrc.com/Documentation Endpoints for managing additive templates, including retrieval of specific, active, and inactive templates, as well as creation and updates. ```APIDOC ## Additives Templates API (v2) ### Description Endpoints for managing additive templates, including retrieval of specific, active, and inactive templates, as well as creation and updates. ### Endpoints - `GET /additivestemplates/v2/{id}` - `GET /additivestemplates/v2/active` - `GET /additivestemplates/v2/inactive` - `POST /additivestemplates/v2/` - `PUT /additivestemplates/v2/` ``` -------------------------------- ### Facilities API Source: https://api-ca.metrc.com/Documentation Endpoints for managing facility data. ```APIDOC ## GET /facilities/v1/ ### Description Retrieves a list of facilities. ### Method GET ### Endpoint /facilities/v1/ ``` -------------------------------- ### URL Encoding for Timestamps in API Calls Source: https://api-ca.metrc.com/Documentation Demonstrates the correct URL encoding for timestamps when used in API query strings. Specifically, it shows how to encode the '+' character in time zone offsets as '%2B' to ensure accurate date interpretation by the API. ```HTTP GET /packages/v2/active?licenseNumber=123-ABC&lastModifiedStart=2023-11-01T08:00:00%2B02:00 ``` -------------------------------- ### Plant Batches API (v2) Source: https://api-ca.metrc.com/Documentation Endpoints for managing plant batches, including retrieval of specific, active, inactive batches, types, waste reasons, and operations like creation, updates, and deletion. ```APIDOC ## Plant Batches API (v2) ### Description Endpoints for managing plant batches, including retrieval of specific, active, inactive batches, types, waste reasons, and operations like creation, updates, and deletion. ### Endpoints - `GET /plantbatches/v2/{id}` - `GET /plantbatches/v2/active` - `GET /plantbatches/v2/inactive` - `GET /plantbatches/v2/types` - `DELETE /plantbatches/v2/` - `GET /plantbatches/v2/waste/reasons` - `POST /plantbatches/v2/waste` - `POST /plantbatches/v2/adjust` - `POST /plantbatches/v2/additives` - `POST /plantbatches/v2/additives/usingtemplate` - `POST /plantbatches/v2/plantings` - `POST /plantbatches/v2/packages` - `POST /plantbatches/v2/packages/frommotherplant` - `POST /plantbatches/v2/split` - `POST /plantbatches/v2/growthphase` - `PUT /plantbatches/v2/name` - `PUT /plantbatches/v2/tag` - `PUT /plantbatches/v2/strain` - `PUT /plantbatches/v2/location` - `GET /plantbatches/v2/waste` ``` -------------------------------- ### Dates and Times Source: https://api-ca.metrc.com/Documentation Information on the expected ISO 8601 date and date/time formats for API requests and responses. ```APIDOC ## Dates and Times ### Description All date and date/time fields submitted to and returned by the server must be in ISO 8601 format. The supported date format is `YYYY-MM-DD`. Date/time formats can include hours, minutes, seconds, milliseconds, and time zone offsets. ### Supported Date Format `YYYY-MM-DD` ### Supported Date/Time Formats Examples - `2015-08-04T22:04:50Z` (UTC) - `2015-08-04T22:04:50+00:00` (UTC with offset) - `2015-10-03T16:30:40.345+00:00` (UTC with milliseconds and offset) - `2016-02-04T22:20:30.456-06:00` (MDT with milliseconds and offset) ### Time Zone Handling The API accepts any specified time zone offset and converts it to UTC for storage. ``` -------------------------------- ### Employees API (v2) Source: https://api-ca.metrc.com/Documentation Endpoints for retrieving employee information and their permissions. ```APIDOC ## Employees API (v2) ### Description Endpoints for retrieving employee information and their permissions. ### Endpoints - `GET /employees/v2/` - `GET /employees/v2/permissions` ``` -------------------------------- ### POST /sales/v2/receipts Source: https://api-ca.metrc.com/Documentation Creates a new receipt. This endpoint is used to generate a new receipt. ```APIDOC ## POST /sales/v2/receipts ### Description Creates a new receipt. ### Method POST ### Endpoint /sales/v2/receipts ### Parameters #### Path Parameters - **None** #### Query Parameters - **None** #### Request Body - **receiptData** (object) - Required - The receipt data. ### Request Example ```json { "receiptData": { "customer": "Customer X", "items": [{"item_id": 456, "quantity": 5}] } } ``` ### Response #### Success Response (200) - **receiptId** (integer) - The ID of the created receipt. #### Response Example ```json { "receiptId": 789 } ``` ``` -------------------------------- ### POST /sales/v2/deliveries Source: https://api-ca.metrc.com/Documentation Creates a new delivery. This endpoint is used to initiate a new delivery process. ```APIDOC ## POST /sales/v2/deliveries ### Description Creates a new delivery. ### Method POST ### Endpoint /sales/v2/deliveries ### Parameters #### Path Parameters - **None** #### Query Parameters - **None** #### Request Body - **deliveryData** (object) - Required - The delivery data. ### Request Example ```json { "deliveryData": { "recipient": "Retailer A", "items": [{"item_id": 123, "quantity": 10}] } } ``` ### Response #### Success Response (200) - **deliveryId** (integer) - The ID of the created delivery. #### Response Example ```json { "deliveryId": 42 } ``` ``` -------------------------------- ### Items API (v2) Source: https://api-ca.metrc.com/Documentation Endpoints for managing items, including retrieval of specific, active, inactive items, categories, brands, photos, files, and associated operations like creation, updates, and deletion. ```APIDOC ## Items API (v2) ### Description Endpoints for managing items, including retrieval of specific, active, inactive items, categories, brands, photos, files, and associated operations like creation, updates, and deletion. ### Endpoints - `GET /items/v2/{id}` - `GET /items/v2/active` - `GET /items/v2/inactive` - `GET /items/v2/categories` - `GET /items/v2/brands` - `GET /items/v2/photo/{id}` - `GET /items/v2/file/{id}` - `POST /items/v2/` - `PUT /items/v2/` - `POST /items/v2/photo` - `POST /items/v2/file` - `DELETE /items/v2/{id}` - `DELETE /items/v2/brand/{id}` - `POST /items/v2/brand` - `PUT /items/v2/brand` ``` -------------------------------- ### PUT /sales/v2/deliveries/hub/accept Source: https://api-ca.metrc.com/Documentation Accepts a delivery at the hub. This endpoint is used to confirm the acceptance of a delivery at the hub. ```APIDOC ## PUT /sales/v2/deliveries/hub/accept ### Description Accepts a delivery at the hub. ### Method PUT ### Endpoint /sales/v2/deliveries/hub/accept ### Parameters #### Path Parameters - **None** #### Query Parameters - **None** #### Request Body - **deliveryId** (integer) - Required - The ID of the delivery to accept. ### Request Example ```json { "deliveryId": 123 } ``` ### Response #### Success Response (200) - **message** (string) - A success message. #### Response Example ```json { "message": "Delivery accepted at hub" } ``` ``` -------------------------------- ### PUT /sales/v2/deliveries/complete Source: https://api-ca.metrc.com/Documentation Marks a delivery as complete. This endpoint is used to finalize a delivery. ```APIDOC ## PUT /sales/v2/deliveries/complete ### Description Marks a delivery as complete. ### Method PUT ### Endpoint /sales/v2/deliveries/complete ### Parameters #### Path Parameters - **None** #### Query Parameters - **None** #### Request Body - **deliveryId** (integer) - Required - The ID of the delivery to complete. ### Request Example ```json { "deliveryId": 456 } ``` ### Response #### Success Response (200) - **message** (string) - A success message. #### Response Example ```json { "message": "Delivery completed" } ``` ``` -------------------------------- ### Plant Batches API Source: https://api-ca.metrc.com/Documentation Endpoints for managing plant batch data, including retrieval, status filtering, and various creation and modification operations. ```APIDOC ## Plant Batches Management API ### Description Provides endpoints for managing plant batch data. Includes retrieving batches by ID, filtering by status (active, inactive), accessing types, and performing operations like adjusting, creating plantings and packages, splitting, moving, adding additives, and managing waste. Also allows retrieving waste reasons. ### Method GET, POST, PUT, DELETE ### Endpoints - GET /plantbatches/v1/{id} - GET /plantbatches/v1/active - GET /plantbatches/v1/inactive - GET /plantbatches/v1/types - POST /plantbatches/v1/adjust - POST /plantbatches/v1/createplantings - POST /plantbatches/v1/createpackages - POST /plantbatches/v1/split - POST /plantbatches/v1/create/packages/frommotherplant - POST /plantbatches/v1/changegrowthphase - PUT /plantbatches/v1/moveplantbatches - POST /plantbatches/v1/additives - POST /plantbatches/v1/waste - DELETE /plantbatches/v1/ - GET /plantbatches/v1/waste/reasons ``` -------------------------------- ### Items API Source: https://api-ca.metrc.com/Documentation Endpoints for managing item data, including retrieval, creation, updates, and photo management. ```APIDOC ## Items Management API ### Description Provides endpoints for managing item data, including retrieving items by ID, filtering by status (active, inactive), and accessing categories, brands, and photos. Supports creating, updating, and deleting items and their photos. ### Method GET, POST, DELETE ### Endpoints - GET /items/v1/{id} - GET /items/v1/active - GET /items/v1/inactive - GET /items/v1/categories - GET /items/v1/brands - GET /items/v1/photo/{id} - POST /items/v1/create - POST /items/v1/update - POST /items/v1/photo - DELETE /items/v1/{id} ``` -------------------------------- ### Employees API Source: https://api-ca.metrc.com/Documentation Endpoints for managing employee data. ```APIDOC ## GET /employees/v1/ ### Description Retrieves a list of employees. ### Method GET ### Endpoint /employees/v1/ ``` -------------------------------- ### Server Responses Source: https://api-ca.metrc.com/Documentation Common HTTP status codes and their meanings for API requests. ```APIDOC ## Server Responses ### Description This section outlines the common server responses you may encounter when interacting with the API. ### Success Response - **200 OK**: The server successfully processed the request. ### Error Responses - **400 Bad Request**: The request was malformed or missing required parameters. Please review your input and try again. ``` -------------------------------- ### Patients API (v2) Source: https://api-ca.metrc.com/Documentation Endpoints for managing patients, including retrieval of specific patients, active patients, creation, updates, and deletion. ```APIDOC ## Patients API (v2) ### Description Endpoints for managing patients, including retrieval of specific patients, active patients, creation, updates, and deletion. ### Endpoints - `GET /patients/v2/{id}` - `GET /patients/v2/active` - `POST /patients/v2/` - `PUT /patients/v2/` - `DELETE /patients/v2/{id}` ``` -------------------------------- ### Harvests API (v2) Source: https://api-ca.metrc.com/Documentation Endpoints for managing harvests, including retrieval of specific, active, inactive, on-hold, and waste-related harvests, as well as creation and updates. ```APIDOC ## Harvests API (v2) ### Description Endpoints for managing harvests, including retrieval of specific, active, inactive, on-hold, and waste-related harvests, as well as creation and updates. ### Endpoints - `GET /harvests/v2/{id}` - `GET /harvests/v2/active` - `GET /harvests/v2/onhold` - `GET /harvests/v2/inactive` - `GET /harvests/v2/waste` - `GET /harvests/v2/waste/types` - `POST /harvests/v2/packages/testing` - `POST /harvests/v2/packages` - `PUT /harvests/v2/location` - `POST /harvests/v2/waste` - `PUT /harvests/v2/rename` - `PUT /harvests/v2/finish` - `PUT /harvests/v2/unfinish` - `PUT /harvests/v2/restore/harvestedplants` - `DELETE /harvests/v2/waste/{id}` ``` -------------------------------- ### Plants API Source: https://api-ca.metrc.com/Documentation Endpoints for managing individual plant data, including retrieval, status filtering, and various modification operations. ```APIDOC ## Plants Management API ### Description Provides endpoints for managing individual plant data. Includes retrieving plants by ID or label, filtering by status (vegetative, flowering, on hold, inactive), accessing additives, growth phases, and waste reasons. Supports operations like moving plants, changing growth phases, adding additives, managing waste, creating plantings and packages, and manicure/harvest operations. ### Method GET, POST, DELETE ### Endpoints - GET /plants/v1/{id} - GET /plants/v1/{label} - GET /plants/v1/vegetative - GET /plants/v1/flowering - GET /plants/v1/onhold - GET /plants/v1/inactive - GET /plants/v1/additives - GET /plants/v1/growthphases - GET /plants/v1/additives/types - GET /plants/v1/waste/methods/all - GET /plants/v1/waste/reasons - POST /plants/v1/moveplants - POST /plants/v1/changegrowthphases - DELETE /plants/v1/ - POST /plants/v1/additives - POST /plants/v1/waste - POST /plants/v1/additives/bylocation - POST /plants/v1/create/plantings - POST /plants/v1/create/plantbatch/packages - POST /plants/v1/manicureplants - POST /plants/v1/harvestplants ``` -------------------------------- ### Sales API (v2) Source: https://api-ca.metrc.com/Documentation Endpoints related to sales transactions. ```APIDOC ## Sales API (v2) ### Description Endpoints related to sales transactions. ### Endpoint (No specific endpoints listed in the provided text for Sales API v2) ``` -------------------------------- ### Patient Check Ins API (v2) Source: https://api-ca.metrc.com/Documentation Endpoints for managing patient check-ins, including retrieval by location, creation, updates, and deletion. ```APIDOC ## Patient Check Ins API (v2) ### Description Endpoints for managing patient check-ins, including retrieval by location, creation, updates, and deletion. ### Endpoints - `GET /patient-checkins/v2/locations` - `GET /patient-checkins/v2/` - `POST /patient-checkins/v2/` - `PUT /patient-checkins/v2/` - `DELETE /patient-checkins/v2/{id}` ``` -------------------------------- ### Templates API Source: https://api-ca.metrc.com/Documentation Endpoints for managing transfer templates, including deliveries and packages associated with templates. ```APIDOC ## GET /transfers/v1/templates ### Description Retrieves a list of all transfer templates. ### Method GET ### Endpoint /transfers/v1/templates ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of results to return. - **offset** (integer) - Optional - The number of results to skip. ### Response #### Success Response (200) - **templates** (array) - A list of transfer template objects. #### Response Example ```json { "templates": [ { "id": "template-1", "name": "Standard Delivery Template" } ] } ``` ``` ```APIDOC ## GET /transfers/v1/templates/{id}/deliveries ### Description Retrieves deliveries associated with a specific transfer template. ### Method GET ### Endpoint /transfers/v1/templates/{id}/deliveries ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the transfer template. ### Response #### Success Response (200) - **deliveries** (array) - A list of delivery objects associated with the template. #### Response Example ```json { "deliveries": [ { "id": "delivery-template-1", "packageIds": ["pkg-template-a", "pkg-template-b"] } ] } ``` ``` ```APIDOC ## GET /transfers/v1/templates/deliveries/{id}/transporters ### Description Retrieves transporter information for deliveries within a transfer template. ### Method GET ### Endpoint /transfers/v1/templates/deliveries/{id}/transporters ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the delivery within the template. ### Response #### Success Response (200) - **transporters** (array) - A list of transporter objects. #### Response Example ```json { "transporters": [ { "id": "transporter-template-1", "name": "Template Transport" } ] } ``` ``` ```APIDOC ## GET /transfers/v1/templates/deliveries/{id}/transporters/details ### Description Retrieves detailed transporter information for deliveries within a transfer template. ### Method GET ### Endpoint /transfers/v1/templates/deliveries/{id}/transporters/details ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the delivery within the template. ### Response #### Success Response (200) - **transporterDetails** (object) - Detailed transporter information. #### Response Example ```json { "transporterDetails": { "id": "transporter-template-1", "name": "Template Transport", "licenseNumber": "TMPLT123" } } ``` ``` ```APIDOC ## GET /transfers/v1/templates/deliveries/{id}/packages ### Description Retrieves packages associated with deliveries within a transfer template. ### Method GET ### Endpoint /transfers/v1/templates/deliveries/{id}/packages ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the delivery within the template. ### Response #### Success Response (200) - **packages** (array) - A list of package objects. #### Response Example ```json { "packages": [ { "id": "pkg-template-a", "type": "Package", "label": "TMPLTABC1234567890" } ] } ``` ``` ```APIDOC ## POST /transfers/v1/templates ### Description Creates a new transfer template. ### Method POST ### Endpoint /transfers/v1/templates ### Parameters #### Request Body - **templateData** (object) - Required - The data for the new transfer template. - **name** (string) - Required - The name of the template. - **deliveries** (array of objects) - Required - A list of deliveries to include in the template. - **packageIds** (array of strings) - Required - IDs of packages associated with the delivery. ### Request Example ```json { "templateData": { "name": "New Product Template", "deliveries": [ { "packageIds": ["pkg-template-c", "pkg-template-d"] } ] } } ``` ### Response #### Success Response (200) - **templateId** (string) - The ID of the created template. #### Response Example ```json { "templateId": "template-2" } ``` ``` ```APIDOC ## PUT /transfers/v1/templates ### Description Updates an existing transfer template. ### Method PUT ### Endpoint /transfers/v1/templates ### Parameters #### Request Body - **templateData** (object) - Required - The updated data for the transfer template. - **templateId** (string) - Required - The ID of the template to update. - **name** (string) - Optional - The new name of the template. - **deliveries** (array of objects) - Optional - A list of deliveries to include in the template. - **packageIds** (array of strings) - Required - IDs of packages associated with the delivery. ### Request Example ```json { "templateData": { "templateId": "template-2", "name": "Updated Product Template", "deliveries": [ { "packageIds": ["pkg-template-e"] } ] } } ``` ### Response #### Success Response (200) - **message** (string) - A success message indicating the template was updated. #### Response Example ```json { "message": "Template updated successfully." } ``` ``` ```APIDOC ## DELETE /transfers/v1/templates/{id} ### Description Deletes a transfer template. ### Method DELETE ### Endpoint /transfers/v1/templates/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the template to delete. ### Response #### Success Response (200) - **message** (string) - A success message indicating the template was deleted. #### Response Example ```json { "message": "Template deleted successfully." } ``` ```