# Create a package from a harvest

Turning cured flower into sellable inventory means creating a package that references the harvest it came from, so the chain of custody stays intact.

## Look up the harvest

```bash
curl https://api.seedlink.dev/v1/connections/8f9ab02c-78c2-4292-a43d-79a327a4efd5/facilities/fac_C11-0000123-LIC/harvests/hrv_291847 \
  -H "Authorization: Bearer sl_at_..."
```

Check `current_weight` so the package you create doesn't exceed what's actually available.

## Create the package

```bash
curl -X POST https://api.seedlink.dev/v1/connections/8f9ab02c-78c2-4292-a43d-79a327a4efd5/facilities/fac_C11-0000123-LIC/packages \
  -H "Authorization: Bearer sl_at_..." \
  -H "Content-Type: application/json" \
  -d '{
    "item_name": "Blue Dream Flower",
    "item_category": "Flower",
    "item_strain": "Blue Dream",
    "quantity": 453.6,
    "unit_of_measure": "Grams",
    "source_harvest_ids": ["hrv_291847"]
  }'
```

The response includes the new package's `id`. Repeat for as many packages as the harvest is split into.

## Confirm the lineage

```bash
curl https://api.seedlink.dev/v1/connections/8f9ab02c-78c2-4292-a43d-79a327a4efd5/facilities/fac_C11-0000123-LIC/packages/{new_package_id} \
  -H "Authorization: Bearer sl_at_..."
```

`source_harvest_ids` on the response confirms the link back to the harvest.

## Gotchas

Package writes only work against sandbox connections. Production is read-only.

