---
title: "Get batches"
method: GET
path: "/public/v1/batches"
tags: ["Batch"]
---

# Get batches

`GET /public/v1/batches`

List batches, sorted oldest-first by creation date and filtered by the query parameters below. Only batches of batch-tracked products are returned; batches belonging to products on any other inventory-tracking method are never listed here.

Results are paginated. The response wraps the batches in `data` and returns a `next_page` URL; follow it to page through results, and stop when `next_page` is null.

By default each batch is returned without cost data. Pass `include_costs=true` to enrich every batch that currently holds positive on-hand quantity with its cost and quantity totals (`total_cost_actual`, `total_cost_default`, `cost_per_unit_actual`, `cost_per_unit_default`); batches with no on-hand stock omit those fields even when the flag is set. The single-batch `GET /public/v1/batches/{id}` endpoint always includes these totals, so use it when you need cost for one batch.

This endpoint returns eventually consistent data, with changes taking up to 1 second to propagate in responses.

Required permission: `products_permissions_view`. Results are additionally scoped to only the batches the authenticated user can access under their team restrictions, so two API keys at the same company may see different subsets.

## Query parameters

- `ids` string[]
- `product_ids` string[]
- `batch_number` string
- `batch_numbers` string[]
- `product_category_ids` string[]
- `product_subcategory_ids` string[]
- `product_group_ids` string[]
- `product_brand_ids` string[]
- `product_vendor_ids` string[]
- `product_strain_ids` string[]
- `product_tag_ids` string[]
- `product_skus` string[]
- `has_quantity_active` boolean
- `inserted_datetime` string
- `owner_ids` string[]
- `deleted` 'no' | 'include' | 'only'
- `include_costs` boolean
- `page` string
- `updated_datetime` string
- `custom_data` object

## Response `200`

A list of batches

## Other responses

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

---

[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/f8930b2c2924/schema)
