Cart Compliance Equivalency Limits
The cannabis industry is heavily regulated. This includes the amount of cannabis someone can purchase in a given transaction or a period of time. While the latter is up to the point-of-sale, Weedmaps can help ensure the checkout process is within the allowed compliance amounts for a given region.
Weedmaps does this by managing two attributes on a menu item and any of its variants: compliance_net_mg
and compliance_net_precalc
.
Compliance Milligrams
The compliance_net_mg
field is used to tell Weedmaps the weight--in milligrams--a given product is for compliance purposes. For example, a one gram pre-roll would most likely be 1000mg.
curl \
--request PATCH \
--url 'https://api-g.weedmaps.com/wm/v1/menu_items/1234' \
--header 'accept: application/json' \
--header 'authorization: Bearer [ACCESS TOKEN HERE]' \
--header 'content-type: application/json' \
--data '{
"data": {
"type": "menu_item",
"id": "1234",
"attributes": {
"compliance_net_mg": 1000
}
}
}'
Variants Generate Compliance Weights Automatically
Since variants in Weedmaps only allow weight-based values, we'll use those weights by default for the compliance milligram amount. Sending a one gram variant will then automatically return 1000mg of compliance weight.
This can be overridden by providing a
compliance_net_mg
amount to any variant you want to not be automatically calculated.
Compliance Pre-Post Calculation
Sometimes the compliance value provided to Weedmaps is a raw weight, other times it's the weight equivalency allowed in checkout. In order to distinguish between the two, Weedmaps has added a compliance_net_precalc
identifier for if the compliance_net_mg
amount has already been converted for local limits.
Here is an example of how that may be done with variants, though a similar flow can be achieved on the menu item directly.
curl \
--request PATCH \
--url 'https://api-g.weedmaps.com/wm/v1/menu_items/1234' \
--header 'accept: application/json' \
--header 'authorization: Bearer [ACCESS TOKEN HERE]' \
--header 'content-type: application/json' \
--data '{
"data": {
"type": "menu_item",
"id": "1234",
"attributes": {
"variants": [
{
"compliance_net_mg": 5000,
"compliance_net_precalc": true,
"external_id": "abc123",
"price": {
"amount": "17.06",
"currency": "USD"
},
"weight": {
"value": "1.0",
"unit": "g"
}
}
]
}
}
}'
Updated over 1 year ago