# Identifiers

A product has two identifiers. Use whichever you have.

| Identifier | Looks like | Use it when |
|---|---|---|
| `product_uid` | `sha:1cff37…` | Stable forever. Derived from the brand and product handle. Use it to reference a product across time and recaptures. |
| `id` | a UUID | The internal primary key. Also stable. Returned on every card and detail response. |

Both are accepted anywhere the API takes a product identifier, for example `/v1/products/{id}` accepts either form.

```bash
# by product_uid
curl "https://dev.ziffi.xyz/v1/products/sha:1cff37753e7ac53eb0b1ccbc4b7f02dc77acfa2e"
# by id
curl "https://dev.ziffi.xyz/v1/products/ba52542f-d40c-48e0-a579-5e0bfc80b3dd"
```

## Why not use the store handle or a barcode

Handles change when a brand renames a product, and barcodes (GTIN) are populated on well under one percent of products and are not unique. So identity is anchored to the stable `product_uid`, not to the store handle or barcode.

## Brands and categories

- A brand is referenced by its `slug`, for example `/v1/brands/the-natural-wash`.
- A category is referenced by its `id` (a UUID) from `/v1/categories`.

## Next steps

- [Get a product](#/product): fetch full detail by identifier.
- [Search products](#/search): every card returns both identifiers.
