Adjust weight on hand
Record a change to the sample's weight on hand.
The first adjustment is taken as the sample's initial weight on hand; every
later adjustment appends to a log of alterations over time. An
amount_changed of 0 records nothing and simply returns the current weight.
unit must be g or ml or units, and change_reason must be an integer from the
enum below.
Change reasons
Unless the lab reports to a regulator, change_reason uses this default enum:
0other1initial2destroyed3used4returned5lost6stolen7addition
Labs in a METRC state should use a reason from their own state's list instead.
Reasons outside a state's list are accepted without error, but the weight change
may reach METRC incorrectly. 0 is an allowable value everywhere; in most
states it is not forwarded to METRC at all.
- METRC CA
0other (Allowable value, not sent to METRC)2Scale Variance3Sample Tested106Sample Tested101Waste (Unusable Product)108Damage215Enforcement Testing107Incorrect Quantity214Male Plants213Mandated Destruction212Onsite Testing211Over Pulled210Research & Development105Scale Variance209Spoilage104State-Authorized Adjustment103Theft208Trade Sample207Under Pulled102Voluntary Surrender206Weight Change Due to Moisture- METRC IL
0other (Allowable value, not sent to METRC)288Consumed During Testing287Entry Error290Inventory Audit286Package Material285Scale Variance284Spoilage283Theft282Waste- METRC LA
0other (Allowable value, not sent to METRC)111Test Sample Waste (Lab only)116Potency Testing122Contaminant Testing121Drying120During Transfer119Entry Error118Package Material117Plants Unpacked115R&D Testing114Scale Variance113Spoilage112State-Ordered Destruction/State Mandated Destruction110Theft109Waste- METRC MA
0other (Allowable value, not sent to METRC)2Test Sample Destruction3Sample Used During Testing5Waste128Sample Used During Testing125Test Sample Destruction135API Related Error134Drying133Entry Error132Over/Under Pulled131Package Material130Plants Unpacked129Processing Loss127Scale Variance126Spoilage124Theft123Waste- METRC MD
0other (Allowable value, not sent to METRC)2Drying3Waste5Spoilage136Waste139Scale Variance144API Adjustment Error143Drying142Entry Error141MCA Inspector Obtained Product140Plants Unpacked138Spoilage137Theft263Unaccounted Product- METRC ME
0other (Allowable value, not sent to METRC)151Sample Used During Testing147Test Sample Destruction156API Related Error155Drying154Entry Error153Over/Under Pulled152R&D Sample150Scale Variance149Spoilage148State Mandated Destruction146Theft145Waste- METRC MI
0other (Allowable value, not sent to METRC)3Waste6Scale Variance157Waste159Spoilage162Drying161Entry Error160Scale Variance158Theft- METRC MN
0other (Allowable value, not sent to METRC)170Consumed During Testing164Test Sample Destruction169Drying168Entry Error295Hazardous Waste294Non-Hazardous Waste167Package Material307Quantity Discrepancy165Spoilage306State Investigation163Theft- METRC MO
0other (Allowable value, not sent to METRC)182Consumed During Testing171Waste183API Error181Damaged180Drying179Mandatory State Destruction178Moisture Weight Change177Over/Under Pulled176Package Material175Recall174Spoilage173Theft172Typing Error- METRC MS
0other (Allowable value, not sent to METRC)281Drying280During Transfer279Entry Error278Package Material277Scale Variance276Spoilage275Theft274Waste- METRC MT
0other (Allowable value, not sent to METRC)247Contaminant Testing240Waste246Drying245Entry Error244Scale Variance243Spoilage242State Mandated Destruction241Theft- METRC NJ
0other (Allowable value, not sent to METRC)190Consumed During Testing184Waste189Drying308Enforcement Investigation188Entry Error187Scale Variance186Spoilage185Theft- METRC NV
0other (Allowable value, not sent to METRC)2Package Destruction/Waste3Test Sample Consumed in Testing4Entry Error5Nevada Dept.of Agriculture6Scale Variance251Test Sample Consumed in Testing255Package Destruction/Waste292API Adjustment Error259Drying258Entry Error257Nevada Dept.of Agriculture256Over Pulled254Plants Unpacked253Scale Variance252Spoilage250Theft249Transfer Error291Unaccounted Product Variance248Under Pulled- METRC NY
0other (Allowable value, not sent to METRC)305Consumed During Testing298Waste304Damage During Transfer303Drying302Entry Error301Scale Variance300Spoilage299Theft- METRC OH
0other (Allowable value, not sent to METRC)2Laboratory Testing3Destruction - Waste/Other5Laboratory Testing6Plant Material - Moisture Gain/Loss194Laboratory Testing195Destruction - Waste/Other199Data Entry Error198Destruction - Expired197Destruction - Failed Testing196Destruction - Recall297Inventory Reconciliation296Loss, Theft, or Diversion192Plant Material - Moisture Gain/Loss191Scale Variance- METRC OK
0other (Allowable value, not sent to METRC)220Sample Used During Testing224Contaminant Testing225API Related Error223Damage/Spoilage222Drying221Mandatory State Destruction219Scale Variance218Test Sample Destruction217Theft216Typing/Entry Error- METRC OR
0Moisture Loss/Gain2Sample Destroyed (Lab Use Only)3Waste231Sample Destroyed (Lab Use Only)226Waste239API Adjustment Error238API Conversion Error237During License-to-License Transfer236Entry Error234Moisture Loss/Gain233Package Material232Plant Death230Scale Variance229Spoilage228Theft227Trade Sample- METRC RI
0other (Allowable value, not sent to METRC)205Consumed during Testing200Waste204Entry Error317QA Sample to RIDOH203Scale Variance202Spoilage201Theft- METRC SD
0other (Allowable value, not sent to METRC)260Waste262Drying261Entry Error- METRC Tribal Nations
0other (Allowable value, not sent to METRC)312Test Sample Consumed in Testing309Waste316Entry Error315Plants Unpacked314Scale Variance313Spoilage311Theft310Transfer Error- METRC 29 Palms
0other (Allowable value, not sent to METRC)265Waste (Unusable Product)273Damage272Enforcement Testing271Incorrect Quantity270Mandated Destruction269Over Pulled268TCC-Authorized Adjustment267Theft266Under Pulled264Weight Change Due to Moisture
Path parameters
Body parameters (application/x-www-form-urlencoded)
Unit for amount_changed: g or ml or units.
Signed amount to add to the weight on hand; negative values reduce it. 0 records nothing and returns the current weight.
Integer reason ID for the change; see the description above.
Try it
Log in to send test requests to this endpoint straight from the docs.
Responses
200 Success
Show 2 child attributes Hide 2 child attributes
The current weight on hand
Units the weight on hand is measured in(One of "g" or "units")
400 Bad request
The request was malformed or failed validation. Validation failures include per-field messages in error_details.
Possible error_code values: invalid_request, request_too_old.
401 Unauthorized
Authentication failed.
Possible error_code values: missing_api_key, invalid_api_key, invalid_credentials_type, api_access_restricted, api_access_denied, missing_signature, missing_timestamp, invalid_timestamp, invalid_signature.
403 Permission denied
The API key is valid but does not have permission for this endpoint (for example, a client key calling a labs endpoint).
Possible error_code values: permission_denied.
404 Not found
The requested record does not exist or is not visible to this organization.
Possible error_code values: not_found.
# X-ConfidentLims-Signature: see the Request Signing guide - https://api.confidentcannabis.com/v0/docs/request-signing.md
curl -X POST 'https://api.confidentcannabis.com/v0/labs/sample/{sample_id}/weight_on_hand' \
-H 'X-ConfidentLims-APIKey: YOUR_API_KEY' \
-H 'X-ConfidentLims-Timestamp: UNIX_TIMESTAMP' \
-H 'X-ConfidentLims-Signature: REQUEST_SIGNATURE' \
--data-urlencode 'unit=g' \
--data-urlencode 'amount_changed=-2.5' \
--data-urlencode 'change_reason=3'
import time import requests # sign_request() is defined in the Request Signing guide: # https://api.confidentcannabis.com/v0/docs/request-signing.md from sign_request import sign_request API_KEY = 'YOUR_API_KEY' API_SECRET = 'YOUR_API_SECRET' path = '/v0/labs/sample/{sample_id}/weight_on_hand' data = { "unit": "g", "amount_changed": "-2.5", "change_reason": "3", } headers = {'X-ConfidentLims-Timestamp': str(int(time.time()))} headers['X-ConfidentLims-Signature'] = sign_request( 'POST', path, headers, data, API_KEY, API_SECRET) headers['X-ConfidentLims-APIKey'] = API_KEY response = requests.post( 'https://api.confidentcannabis.com' + path, headers=headers, data=data, ) print(response.json())
// signRequest() is defined in the Request Signing guide: // https://api.confidentcannabis.com/v0/docs/request-signing.md import { signRequest } from './sign_request.js'; const API_KEY = 'YOUR_API_KEY'; const API_SECRET = 'YOUR_API_SECRET'; const path = "/v0/labs/sample/{sample_id}/weight_on_hand"; const data = { "unit": "g", "amount_changed": "-2.5", "change_reason": "3", }; const headers = { 'X-ConfidentLims-Timestamp': String(Math.floor(Date.now() / 1000)) }; headers['X-ConfidentLims-Signature'] = signRequest( "POST", path, headers, data, API_KEY, API_SECRET); headers['X-ConfidentLims-APIKey'] = API_KEY; const response = await fetch("https://api.confidentcannabis.com" + path, { method: "POST", headers, body: new URLSearchParams(data), }); console.log(await response.json());
{
"success": true,
"weight_on_hand": {
"weight": 9.5,
"unit": "g"
}
}