The product categories in use
inventory.category.list
GET/api/v1/households/{household_id}/queries/inventory.category.list
- Query
- Rigel runs it
Every product category in list order, with how many products are in each. Give products one of these names rather than inventing a near-duplicate.
Parameters#
| Field | Description |
|---|---|
household_idpathstringrequired | The household's ID. |
Response#
200 The answer.
| Field | Description |
|---|---|
itemsarray of objectsrequired | |
items[].idstringrequired | A product category ID, such as pcg_01JC0000000000000000000000. |
items[].namestringrequired | The category: "Produce", "Dairy". |
items[].product_countintegerrequired | How many products are in it. |
Errors#
Every error has the same envelope: error.code, error.message, error.details, error.recovery and error.request_id.
| Status | Code | When |
|---|---|---|
400 | validation_failed | A field is missing, misspelled or out of range. details.fields lists each problem. |
401 | unauthenticated | The request has no valid session. |
404 | not_found | The household doesn't exist, or you aren't a member of it. |
Examples#
These are real. Each was recorded from a sample household, the Okafors, running through the whole API when this site was built.
List product categories
curl 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/inventory.category.list' \
-H "Cookie: rigel_session=$RIGEL_SESSION"const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/inventory.category.list", {
headers: {
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
});
const data = await response.json();GET /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/queries/inventory.category.list HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSBA6FPJAQVRN5K6GW2K
{
"items": [
{
"id": "pcg_01M6V9CSAG0KYYACRJ15QGGWXF",
"name": "Baking",
"product_count": 1
},
{
"id": "pcg_01M6V9CSAMTT3T032P7BR8RKP1",
"name": "Canned goods",
"product_count": 1
},
{
"id": "pcg_01M6V9CSAY46AA0R1RMXHDQEQ5",
"name": "Dairy",
"product_count": 1
}
]
}For Rigel#
Rigel's tool for this query is inventory_category_list. Rigel runs this on its own, then says what it did. The agent guide has the rest.