---
title: "List Products"
method: GET
path: "/products"
tags: ["Products"]
---

# List Products

`GET /products`

## Request

- Base URL: `https://api.purplegrain.com/api/v1`
- URL: `https://api.purplegrain.com/api/v1/products`
- Auth: HTTP bearer

The product reference list the composer's parse matches a sentence against ("Drenched the
ewes with First Mectin…"): name, label active constituent and the withholding period (WHP) and
export slaughter interval (ESI) on its label. `kind` narrows the list: `drench`, `herbicide` (the
sprays a spray record is parsed against), `fertiliser`, `seed`, `seed_treatment` or `inoculant`;
an unknown kind is an empty list.

**Read the intervals by their own names, never by `whp_days` and `esi_days`**, which are stored
columns whose meaning depends on `kind` (for a herbicide `whp_days` is the GRAZING period and
`esi_days` the HARVEST period). Every product carries `meat_whp_days`, `export_esi_days`,
`grazing_whp_days`, `harvest_whp_days` and `egi_days`, each null where its kind does not have
one. A **fertiliser** has no interval at all: it carries `analysis` (nutrient percentages) and an
`advisory_note`, which is advice to pass on and never a status.
 This is a short catalogue, not the APVMA ESI list — ESIs change, so
confirm the label with the farmer and do not override their figure silently. Signed-in callers only.

## Query parameters

- `kind` string
- `page` integer
- `per_page` integer

## Response `200`

Success.

- ProductsIndexResponseAttributes
  - `data` ProductModelAttributes[]
    - `id` string
    - `type` string
    - `name` string
    - `active` string, nullable
    - `kind` 'drench' | 'herbicide' | 'fertiliser' | 'seed' | 'seed_treatment' | 'inoculant'
    - `whp_days` integer: The stored withholding period; what it means depends on `kind`. Prefer the explicit names.
    - `esi_days` integer: The stored second interval; what it means depends on `kind`. Prefer the explicit names.
    - `analysis` object: Fertiliser nutrient percentages by weight, lower-case keys, e.g. `{ "n": 46 }`. Copied onto a record line at save.
    - `advisory_note` string, nullable: Grey advice for a fertiliser (urea: wait three to four weeks before grazing, nitrate risk). Advice to pass on, never a status or a withholding period.
    - `meat_whp_days` integer, nullable: Meat withholding period, days. Drenches only; null for any other kind.
    - `export_esi_days` integer, nullable: Export slaughter interval, days. Drenches and seed treatments; null otherwise.
    - `grazing_whp_days` integer, nullable: Grazing withholding period, days. Herbicides and seed treatments; null otherwise.
    - `harvest_whp_days` integer, nullable: Harvest withholding period, days. Herbicides only; null otherwise.
    - `egi_days` integer, nullable: Export grazing interval, days. Herbicides only; null otherwise.
  - `meta` PaginationMeta
    - `current_page` number
    - `next_page` number, nullable
    - `prev_page` number, nullable

## Other responses

- `401`: Unauthenticated

---

[API](https://skmtc.dev/purplegrain/apis/purple-grain-api.md) · [All operations](https://skmtc.dev/purplegrain/apis/purple-grain-api/llms.txt) · [OpenAPI document](https://skmtc.dev/purplegrain/apis/purple-grain-api/revisions/4bedbc1c784c?raw)
