APIPackage

Finish packages

POST
/public/v1/packages/finish

Finish a list of packages. Sets each package's status to FINISHED and records the finish time. Finishing marks a fully depleted package as closed out for compliance; it removes the package from active inventory listings but does not itself deduct any quantity.

package_ids is a non-empty list of at most 300 package IDs. Optionally pass finished_datetime (ISO 8601) to set the finish time; it defaults to the current time. An ID that doesn't match a package of your company rejects the whole request, with an error pointing at that ID's position in package_ids (e.g. ["package_ids", 0]).

Every package must be finishable, or the whole request fails. A package is rejected when it: • still has active quantity — a package must already be at zero quantity before it can be finished • is already finished • is discontinued, on hold, inactive, or has been transferred out of its license • is still syncing with Metrc from an earlier operation • has an unresolved Metrc compliance discrepancy

This operation is atomic: if any package cannot be finished the entire request is rejected and no packages are changed. In that case the error message lists the offending packages by their compliance label; it is a single human-readable string, not a per-package structured error.

Metrc only — not supported for BioTrack packages, and a working Metrc connection is required. Metrc is updated asynchronously: a successful response means the packages were finished in Distru and a pending Metrc activity was created for each one. Distru syncs those activities to Metrc sequentially in the background, so the 200 response is not confirmation that the packages are finished in Metrc. Poll GET /public/v1/packages with a recent updated_datetime lower bound to observe the synced result. Requires a Metrc key configured with permission to finish packages in Metrc.

Required permission: products_permissions_adjust_inventory.

Authorization

Bearer
headerAuthorizationBearer <token>

API token generated in Distru (Settings → Distru API). Send it on every request as Authorization: Bearer YOUR_API_TOKEN.

Request Body

The packages to finish

application/json
  1. body
finished_datetime?string

Finish timestamp recorded on every package in the request, ISO 8601 (e.g. 2026-08-20T15:04:05Z). Defaults to the current time when omitted.

package_ids*array<string>

Non-empty list of 1 to 300 package IDs to finish, each the id string returned by GET /public/v1/packages. All must belong to your company. Every package must be finishable: already-finished packages, packages still syncing with Metrc, and packages with a Metrc compliance discrepancy are rejected, and because the operation is all-or-nothing a single bad id fails the whole request.

Response Body

The finished packages

*/*
  1. response

A collection of Packages

data?array<>

Packages

next_page?string

URL for the next page of results; null when there is no next page

Example Request
curl -X POST 'https://app.distru.com/public/v1/packages/finish' \  -H 'Content-Type: application/json' \  -d '{  "finished_datetime": "2026-08-01T00:00:00Z",  "package_ids": [    "00000000-0000-0000-0000-0000000000a4",    "00000000-0000-0000-0000-0000000000a5"  ]}'
Example Response
{  "data": [    {      "batch_number": null,      "biotrack_id": null,      "biotrack_inventory_type_id": null,      "biotrack_net_quantity_per_unit": null,      "biotrack_room_id": null,      "biotrack_status": null,      "biotrack_usable_weight": null,      "compliance_label": "ABCDEF012345670000000478",      "compliance_product_name": "Buds",      "compliance_strain_name": "Cotton Candy",      "compliance_transferred_datetime": null,      "compliance_type": "METRC",      "creator": {        "banned": false,        "deleted_at": null,        "email": "[email protected]",        "full_name": "FirstName11156 LastName11157",        "id": "00000000-0000-0000-0000-0000000015a6",        "inserted_datetime": "2026-10-13T15:03:44.711649Z",        "role": {          "id": "00000000-0000-0000-0000-00000000163f",          "name": "Admin 5694"        },        "updated_datetime": "2026-10-13T15:03:44.711649Z"      },      "custom_data": [],      "description": null,      "distru_status": "FINISHED",      "expiration_date": null,      "expiration_datetime": null,      "finished_datetime": "2026-08-01T00:00:00.000000Z",      "harvest_date": null,      "id": "00000000-0000-0000-0000-0000000000de",      "inactivated_datetime": null,      "inserted_datetime": "2026-10-13T15:03:44.736966Z",      "is_production_batch": false,      "is_test_sample": false,      "is_trade_sample": false,      "lab_testing_state": "NotSubmitted",      "license": {        "active": true,        "expiry_datetime": "2026-11-13T15:03:44.658047Z",        "id": "00000000-0000-0000-0000-00000000017c",        "inserted_datetime": "2026-10-13T15:03:44.658111Z",        "issue_datetime": "2026-10-13T15:03:44.658045Z",        "license_number": "CDPH-00000403",        "license_type": "Type 12 Microbusiness"      },      "license_id": "00000000-0000-0000-0000-00000000017c",      "location": {        "address": "123 Fake Street, Beverly Hills, CA 90210, US",        "company_id": "00000000-0000-0000-0000-000000000e71",        "id": "00000000-0000-0000-0000-000000000454",        "license_id": "00000000-0000-0000-0000-00000000017c",        "name": "Place 1102"      },      "location_id": "00000000-0000-0000-0000-000000000454",      "metrc_archived_date": null,      "metrc_finished_date": null,      "metrc_id": 478,      "metrc_label": "ABCDEF012345670000000478",      "metrc_production_batch_number": null,      "metrc_received_datetime": null,      "metrc_received_from_manifest_number": null,      "metrc_source_harvest_names": null,      "metrc_status": "ACTIVE",      "metrc_transfer_id": null,      "metrc_unit_name": "Ounces",      "owner": {        "banned": false,        "deleted_at": null,        "email": "[email protected]",        "full_name": "FirstName11146 LastName11147",        "id": "00000000-0000-0000-0000-0000000015a1",        "inserted_datetime": "2026-10-13T15:03:44.676022Z",        "role": {          "id": "00000000-0000-0000-0000-00000000163a",          "name": "Admin 5689"        },        "updated_datetime": "2026-10-13T15:03:44.676022Z"      },      "packaged_date": "2014-11-29",      "primary_test_result": null,      "product": {        "id": "c8dc2c8d-e0b4-4d32-9401-854556c8ac92",        "name": "Product 3691",        "sku": "sku 3692",        "updated_datetime": "2026-10-13T15:03:44.690949Z"      },      "product_id": "c8dc2c8d-e0b4-4d32-9401-854556c8ac92",      "product_unit_quantity": "0.000000000",      "product_unit_type": {        "id": "00000000-0000-0000-0000-00000000b885",        "name": "Ounce"      },      "quantity": "0.000000000",      "quantity_active": "0.000000000",      "quantity_assembling": "0.000000000",      "quantity_available": "0.000000000",      "status": "finished",      "unit_type": {        "id": "00000000-0000-0000-0000-00000000b885",        "name": "Ounce"      }    },    {      "batch_number": null,      "biotrack_id": null,      "biotrack_inventory_type_id": null,      "biotrack_net_quantity_per_unit": null,      "biotrack_room_id": null,      "biotrack_status": null,      "biotrack_usable_weight": null,      "compliance_label": "ABCDEF012345670000000480",      "compliance_product_name": "Buds",      "compliance_strain_name": "Cotton Candy",      "compliance_transferred_datetime": null,      "compliance_type": "METRC",      "creator": {        "banned": false,        "deleted_at": null,        "email": "[email protected]",        "full_name": "FirstName11174 LastName11175",        "id": "00000000-0000-0000-0000-0000000015b0",        "inserted_datetime": "2026-10-13T15:03:44.803704Z",        "role": {          "id": "00000000-0000-0000-0000-000000001648",          "name": "Admin 5703"        },        "updated_datetime": "2026-10-13T15:03:44.803704Z"      },      "custom_data": [],      "description": null,      "distru_status": "FINISHED",      "expiration_date": null,      "expiration_datetime": null,      "finished_datetime": "2026-08-01T00:00:00.000000Z",      "harvest_date": null,      "id": "00000000-0000-0000-0000-0000000000df",      "inactivated_datetime": null,      "inserted_datetime": "2026-10-13T15:03:44.815237Z",      "is_production_batch": false,      "is_test_sample": false,      "is_trade_sample": false,      "lab_testing_state": "NotSubmitted",      "license": {        "active": true,        "expiry_datetime": "2026-11-13T15:03:44.658047Z",        "id": "00000000-0000-0000-0000-00000000017c",        "inserted_datetime": "2026-10-13T15:03:44.658111Z",        "issue_datetime": "2026-10-13T15:03:44.658045Z",        "license_number": "CDPH-00000403",        "license_type": "Type 12 Microbusiness"      },      "license_id": "00000000-0000-0000-0000-00000000017c",      "location": {        "address": "123 Fake Street, Beverly Hills, CA 90210, US",        "company_id": "00000000-0000-0000-0000-000000000e71",        "id": "00000000-0000-0000-0000-000000000457",        "license_id": "00000000-0000-0000-0000-00000000017c",        "name": "Place 1105"      },      "location_id": "00000000-0000-0000-0000-000000000457",      "metrc_archived_date": null,      "metrc_finished_date": null,      "metrc_id": 480,      "metrc_label": "ABCDEF012345670000000480",      "metrc_production_batch_number": null,      "metrc_received_datetime": null,      "metrc_received_from_manifest_number": null,      "metrc_source_harvest_names": null,      "metrc_status": "ACTIVE",      "metrc_transfer_id": null,      "metrc_unit_name": "Ounces",      "owner": {        "banned": false,        "deleted_at": null,        "email": "[email protected]",        "full_name": "FirstName11162 LastName11163",        "id": "00000000-0000-0000-0000-0000000015a9",        "inserted_datetime": "2026-10-13T15:03:44.769644Z",        "role": {          "id": "00000000-0000-0000-0000-000000001642",          "name": "Admin 5697"        },        "updated_datetime": "2026-10-13T15:03:44.769644Z"      },      "packaged_date": "2014-11-29",      "primary_test_result": null,      "product": {        "id": "8e520526-4470-44b8-91ca-b14197bbd1da",        "name": "Product 3703",        "sku": "sku 3704",        "updated_datetime": "2026-10-13T15:03:44.786837Z"      },      "product_id": "8e520526-4470-44b8-91ca-b14197bbd1da",      "product_unit_quantity": "0.000000000",      "product_unit_type": {        "id": "00000000-0000-0000-0000-00000000b885",        "name": "Ounce"      },      "quantity": "0.000000000",      "quantity_active": "0.000000000",      "quantity_assembling": "0.000000000",      "quantity_available": "0.000000000",      "status": "finished",      "unit_type": {        "id": "00000000-0000-0000-0000-00000000b885",        "name": "Ounce"      }    }  ],  "next_page": null}