Categories and brands
Categories and brands work the same way, each with its own routes.
| Route | Scope | What it does |
|---|---|---|
GET /v1/categories · GET /v1/brands | read | lists |
GET /v1/categories/{id} · GET /v1/brands/{id} | read | shows one |
POST /v1/categories · POST /v1/brands | write | creates |
PATCH /v1/categories/{id} · PATCH /v1/brands/{id} | write | updates |
DELETE /v1/categories/{id} · DELETE /v1/brands/{id} | delete | deletes |
Fields
| Field | Type | Description |
|---|---|---|
id | UUID | identifier |
name | text | name |
created_at, updated_at | date-time | creation and last change |
List
| Parameter | Description |
|---|---|
q | search in the name (contains the text, case-insensitive) |
updated_since | only those created or changed since that instant |
limit, cursor | pagination |
Create and update
| Field | Required | Rules |
|---|---|---|
name | yes | 1 to 100 characters |
id | no (POST only) | UUID you generate |
curl -X POST https://api.validades.com/v1/categories \
-H "Authorization: Bearer vld_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Dairy"}'
Delete
Deleting a category or brand does not delete the products: they are left without a category or brand (the field becomes null, and the product shows up in updated_since).
{
"data": {
"id": "…",
"deleted": { "category": 1 },
"products_unlinked": 12
}
}
For brands, the field is "deleted": { "brand": 1 }. Accepts If-Match.