Batches
batches_list
Retrieves a list of all accessible Batches.
Endpoint
GET /api/v1.5/batches/
Response
{
"count": 7,
"next": null,
"previous": null,
"results": [
{
"brand_uuid": "<uuid>",
"name": "Batch 1",
"produced_on": null,
"regulatory_id":"WAJ416334, INSZ7OL",
"updated_on": "2022-02-02T08:33:00.732327Z",
"digital_coa_uuids": [
"<uuid>",
"<uuid>"
],
"uuid": "<uuid>"
},
{
"brand_uuid": "<uuid>",
"name": "Batch 2",
"produced_on": "2019-07-10T14:53:37-07:00",
"regulatory_id": "",
"updated_on": "2019-09-24T23:07:32-07:00",
"digital_coa_uuids": [
"<uuid>",
"<uuid>"
],
"uuid": "<uuid>"
}
]
}
Response Fields (List)
Field |
Type |
Description |
|---|---|---|
|
uuid |
Unique identifier for the batch |
|
uuid |
UUID of the brand this batch belongs to |
|
string |
Batch name |
|
datetime or null |
When the batch was produced |
|
string |
Regulatory tracking identifier(s), comma-separated |
|
datetime |
When the batch was last updated |
|
array |
UUIDs of associated Digital COAs |
batches_get
Retrieves the details of a Batch.
Endpoint
GET /api/v1.5/batches/<uuid>/
Response
{
"uuid": "<uuid>",
"name": "",
"regulatory_id": "",
"produced_on": "",
"brand_uuid": "<uuid>",
"updated_on": "",
"digital_coa_uuids": [],
"testing_laboratories": [],
"packaged_products": [
{
"uuid": "<uuid>",
"product": {
"uuid": "<uuid>",
"sku": "",
"description": "",
"name": "",
"published_on": "",
"available_on": "",
"discontinued_on": null,
"product_type": "",
"usage": "",
"variety": "",
"strain": "",
"product_line": "",
"package_size": {},
"upc": "",
"servings": "",
"serving_size": {},
"total_thc": {},
"total_cbd": {},
"thc_cbd_ratio": "",
"tests_description": "",
"updated_on": "",
"about_ingredients": "",
"special_diet": [],
"allergen": [],
"testing_methodology": "",
"usage_recommendation": "",
"ingredients": [],
"images": {
"thumbnail": {},
"primary": {},
"banner": {}
},
"barcode": ""
},
"regulatory_id": "",
"packaged_on": null,
"digital_coa_uuids": [],
"batch_name": "",
"harvested_on": "",
"extraction_method": ""
}
]
}
Response Fields (Detail)
Field |
Type |
Description |
|---|---|---|
|
uuid |
Unique identifier for the batch |
|
string |
Batch name |
|
string |
Regulatory tracking identifier(s) |
|
datetime or null |
When the batch was produced |
|
uuid |
UUID of the brand this batch belongs to |
|
datetime |
When the batch was last updated |
|
array |
UUIDs of associated Digital COAs |
|
array |
Labs that tested this batch |
|
array |
Products packaged from this batch (see below) |
Packaged Product Fields
Field |
Type |
Description |
|---|---|---|
|
uuid |
Unique identifier for the packaged product |
|
object |
Full product details |
|
string or null |
Package-level regulatory identifier |
|
date or null |
When the product was packaged |
|
array |
COAs specific to this packaged product |
|
string |
Name of the parent batch |
|
date |
When the source material was harvested |
|
string |
Extraction method used |
batches_create
Create a new Batch for the specified brand with the provided brand_uuid. If brand_uuid is not provided,
the batch will be created for the default brand associated with your account.
Fields
brand_uuidname(required)regulatory_idproduced_on
Endpoint
POST /api/v1.5/batches/create/
Example Payload
{
"name": "Batch Name",
"regulatory_id": "WAJ416334, INSZ7OL",
"produced_on": "2021-01-14T12:27:47-08:00",
"brand_uuid": "<uuid>"
}
Response
{
"uuid": "<uuid>",
"name": "Batch Name",
"regulatory_id": "WAJ416334, INSZ7OL",
"produced_on": "2021-01-14T12:27:47-08:00",
"brand_uuid": "<uuid>",
"updated_on": "2021-01-20T08:17:00.597205-08:00",
"digital_coa_uuids": []
}
batches_update
Updated fields on an existing Batch. Fields may be omitted if they should not be updated (i.e. if name shouldn’t be updated, omit it as a field on the request).
Fields
nameregulatory_idproduced_on
Endpoint
PUT /api/v1.5/batches/<uuid>/update/
Example Payload
{
"name": "Batch Name",
"regulatory_id": "ABCDEF012345670000020203",
"produced_on": "2021-01-14T12:27:47-08:00"
}
Response
{
"uuid": "<uuid>",
"name": "Batch Name",
"regulatory_id": "ABCDEF012345670000020203",
"produced_on": "2021-01-14T12:27:47-08:00",
"brand_uuid": "<uuid>",
"digital_coa_uuids": [
"<uuid>",
"<uuid>"
],
"updated_on": "2021-01-20T08:17:00.597205-08:00"
}
batch_packaged_product_create
Creates a new packaged product for a batch.
Fields
product_uuid(required)regulatory_idpackaged_ondigital_coa_uuids
Endpoint
POST /api/v1.5/batches/<uuid>/packaged-products/
Example Payload
{
"product_uuid": "<uuid>",
"regulatory_id": "",
"packaged_on": "YYYY-MM-DD",
"digital_coa_uuids": [
"<uuid>",
"<uuid>"
]
}
Response
{
"uuid": "<uuid>",
"product": {
"uuid": "<uuid>",
"sku": "",
"description": "",
"name": "",
"published_on": "",
"available_on": "",
"discontinued_on": null,
"product_type": "",
"usage": "",
"variety": "",
"strain": "",
"product_line": "",
"package_size": {},
"upc": "",
"servings": "",
"serving_size":{},
"total_thc": {},
"total_cbd": {},
"thc_cbd_ratio": "",
"tests_description": "",
"updated_on": "",
"about_ingredients": "",
"special_diet": [],
"allergen": [],
"testing_methodology": "",
"usage_recommendation": "<p>Start low and go slow.</p>",
"ingredients": [],
"images": {},
"barcode": ""
},
"regulatory_id": null,
"packaged_on": null,
"digital_coa_uuids": []
}
batch_packaged_product_update
Updates a packaged product for a batch.
Fields
product_uuidregulatory_idpackaged_ondigital_coa_uuids
Endpoint
PUT /api/v1.5/batches/<batch_uuid>/packaged-products/<packaged_product_uuid>/update/
PATCH /api/v1.5/batches/<batch_uuid>/packaged-products/<packaged_product_uuid>/update/
Example Payload
{
"product_uuid": "<uuid>",
"regulatory_id": "",
"packaged_on": "YYYY-MM-DD",
"digital_coa_uuids": [
"<uuid>",
"<uuid>"
]
}
Response
{
"uuid": "",
"product": {
"uuid": "",
"sku": "",
"description": "",
"name": "",
"published_on": "",
"available_on": "",
"discontinued_on": null,
"product_type": "",
"usage": "",
"variety": "",
"strain": "",
"product_line": "",
"package_size": {},
"upc": "",
"servings": "",
"serving_size": {},
"total_thc": {},
"total_cbd": {},
"thc_cbd_ratio": "",
"tests_description": "",
"updated_on": "",
"about_ingredients": "",
"special_diet": [],
"allergen": [],
"testing_methodology": "",
"usage_recommendation": "",
"ingredients": [],
"images": {},
"barcode": ""
},
"regulatory_id": "",
"packaged_on": "",
"digital_coa_uuids": [
""
]
}
batch_packaged_product_delete
Deletes a packaged product for a batch.
Endpoint
DELETE /api/v1.5/batches/<batch_uuid>/packaged-products/<packaged_product_uuid>/delete/
Response
204