---
title: "Delete a batch"
method: DELETE
path: "/public/v1/batches/{id}"
tags: ["Batch"]
---

# Delete a batch

`DELETE /public/v1/batches/{id}`

Deletes a batch. This is a soft delete: the batch stops appearing in `GET /public/v1/batches` by default (pass the `deleted` filter as `include` or `only` to still see it) and this endpoint returns 404 for it, but the record is retained — `GET /public/v1/batches/{id}` keeps resolving it with a non-null `deleted_at`. The delete cannot be undone through the API; recreating the batch via upsert produces a new batch with a new `id`. Responds 204 with no body on success, or 404 if no non-deleted batch with that `id` exists in your company (including one that was already deleted or belongs to another company).

A batch can only be deleted while nothing depends on it. The delete is refused with a 400 when the batch: appears on any sales order or purchase line item, has any returns, appears on any inventory transfer, or is used as an input or output of any assembly. The batch only becomes deletable once no such record references it. Only batches of batch-tracked products can be deleted here — a batch of a product on any other inventory-tracking method is refused with a 400.

A batch may still hold on-hand quantity when it is deleted; that remaining quantity is not adjusted away, but it immediately stops counting as active inventory (it drops out of the batch's and its product's `quantity_active` and `quantity_active_by_location` fields, and of the [inventory](#model-inventory) endpoint). No inventory is created, consumed, or released, and nothing is synced to Metrc or BioTrack. A successful delete records a `delete` entry in the batch's activity log and notifies the relevant users.

Required permission: `products_permissions_delete`.

## Path parameters

- `id` string, required

## Response `204`

No Content

## Other responses

- `400` — Invalid parameters
- `401` — Missing or invalid API token
- `403` — The API token lacks the required permission
- `404` — Not Found

---

[API](https://skmtc.dev/distru/apis/distru-api.md) · [All operations](https://skmtc.dev/distru/apis/distru-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/distru/distru-api/revisions/eb775b7b6ee0/schema)
