Rename a product, recategorize it, or change how it's kept
inventory.product.update
POST/api/v1/households/{household_id}/commands/inventory.product.update
- Command
- Rigel runs it
- Applies offline
Sets only the fields given; send a nullable field as null to clear it. To combine two products that are the same thing, use inventory.product.merge instead of renaming one to the other's name.
Parameters#
| Field | Description |
|---|---|
household_idpathstringrequired | The household's ID. |
Idempotency-Keyheaderstringoptional | The command's ID. Reuse it when retrying the same command. |
Request body#
JSON, as application/json.
| Field | Description |
|---|---|
product_idstringrequired | A product ID, such as prd_01JC0000000000000000000000. |
namestringoptional | What the thing is, in the household's words, generic rather than a brand: "milk", "black beans", "paper towels". 1–120 characters. Unique ignoring case. |
shopping_notestring or nulloptional | A note for whoever shops, kept across trips, as written: "the green bag, not the blue". |
categorystring or nulloptional | Its grouping, by name, such as "Produce", "Dairy" or "Canned". A new name adds the category; keep to the ones already in use ( |
is_staplebooleanoptional | Something we normally have, like salt, oil or rice. |
is_trackedbooleanoptional | Whether the household keeps inventory of it. Untracked products can still be in recipes and on lists. Defaults to true. |
default_location_idstring or nulloptional | Where it usually goes, for putting away purchases. |
Response#
200 The command was applied.
| Field | Description |
|---|---|
resultobjectrequired | What the command returned, such as the IDs it created. |
versionintegerrequired | The household version after the command. |
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 | location_not_found | A usual place that isn't there. |
404 | product_not_found | A product that isn't there. |
404 | not_found | The household doesn't exist, or you aren't a member of it. |
409 | name_taken | Rename to another product's name ignoring case. |
409 | idempotency_key_reused | The Idempotency-Key was already used for a different command. |
Examples#
These are real. Each scenario is one of the command's test cases, run on a household when this site was built, and the response is what the API returned.
Rename
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"product_id": "prd_01JC000000000000000000000A",
"name": "Whole milk"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
product_id: "prd_01JC000000000000000000000A",
name: "Whole milk",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"product_id": "prd_01JC000000000000000000000A",
"name": "Whole milk"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0A69MTMJ1A1FA1GPQ
{
"result": {},
"version": 1
}Rename to its own name in a different case
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"product_id": "prd_01JC000000000000000000000A",
"name": "Milk"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
product_id: "prd_01JC000000000000000000000A",
name: "Milk",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"product_id": "prd_01JC000000000000000000000A",
"name": "Milk"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0T2N0A2473PQP37M9
{
"result": {},
"version": 1
}Set a new category and the note
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"product_id": "prd_01JC000000000000000000000A",
"category": "Dairy",
"shopping_note": "the green bag"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
product_id: "prd_01JC000000000000000000000A",
category: "Dairy",
shopping_note: "the green bag",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"product_id": "prd_01JC000000000000000000000A",
"category": "Dairy",
"shopping_note": "the green bag"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0SVWPTT05Z1Z6E30H
{
"result": {},
"version": 1
}Set a category that exists, ignoring case
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"product_id": "prd_01JC000000000000000000000A",
"category": "dairy"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
product_id: "prd_01JC000000000000000000000A",
category: "dairy",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"product_id": "prd_01JC000000000000000000000A",
"category": "dairy"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R09Y5RRQGYE4P0MSPX
{
"result": {},
"version": 1
}Clear the category and note with null
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"product_id": "prd_01JC000000000000000000000A",
"category": null,
"shopping_note": null
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
product_id: "prd_01JC000000000000000000000A",
category: null,
shopping_note: null,
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"product_id": "prd_01JC000000000000000000000A",
"category": null,
"shopping_note": null
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0MCQR4V7Z0N06H6PY
{
"result": {},
"version": 1
}Booleans are stored as 1
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"product_id": "prd_01JC000000000000000000000A",
"is_staple": true,
"is_tracked": true
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
product_id: "prd_01JC000000000000000000000A",
is_staple: true,
is_tracked: true,
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"product_id": "prd_01JC000000000000000000000A",
"is_staple": true,
"is_tracked": true
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0PK428RBP358HGC39
{
"result": {},
"version": 1
}Booleans are stored as 0
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"product_id": "prd_01JC000000000000000000000A",
"is_staple": false,
"is_tracked": false
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
product_id: "prd_01JC000000000000000000000A",
is_staple: false,
is_tracked: false,
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"product_id": "prd_01JC000000000000000000000A",
"is_staple": false,
"is_tracked": false
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0N8BY73BMP582HEYG
{
"result": {},
"version": 1
}Fields left out are kept
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"product_id": "prd_01JC000000000000000000000A",
"is_tracked": false
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
product_id: "prd_01JC000000000000000000000A",
is_tracked: false,
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"product_id": "prd_01JC000000000000000000000A",
"is_tracked": false
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R031YWM9SS7P6KFWKF
{
"result": {},
"version": 1
}Set and clear the usual place
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"product_id": "prd_01JC000000000000000000000A",
"default_location_id": "loc_01JC000000000000000000000A"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
product_id: "prd_01JC000000000000000000000A",
default_location_id: "loc_01JC000000000000000000000A",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"product_id": "prd_01JC000000000000000000000A",
"default_location_id": "loc_01JC000000000000000000000A"
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0YFSS6ZR6RGCXPXEN
{
"result": {},
"version": 1
}Clear the usual place with null
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"product_id": "prd_01JC000000000000000000000A",
"default_location_id": null
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
product_id: "prd_01JC000000000000000000000A",
default_location_id: null,
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"product_id": "prd_01JC000000000000000000000A",
"default_location_id": null
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0F8HFE0PFY03AHRZ4
{
"result": {},
"version": 1
}Rename to another product's name ignoring case
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"product_id": "prd_01JC000000000000000000000A",
"name": "oat milk"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
product_id: "prd_01JC000000000000000000000A",
name: "oat milk",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"product_id": "prd_01JC000000000000000000000A",
"name": "oat milk"
}HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0M22XNW0VWSN4NF8Z
{
"error": {
"code": "name_taken",
"message": "There's already a product called Oat Milk. No changes were applied.",
"details": {
"product_id": "prd_01JC000000000000000000000B"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0M22XNW0VWSN4NF8Z"
}
}A usual place that isn't there
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"product_id": "prd_01JC000000000000000000000A",
"default_location_id": "loc_01JC000000000000000000000A"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
product_id: "prd_01JC000000000000000000000A",
default_location_id: "loc_01JC000000000000000000000A",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"product_id": "prd_01JC000000000000000000000A",
"default_location_id": "loc_01JC000000000000000000000A"
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R07S52Y8QP1H5CWWJ2
{
"error": {
"code": "location_not_found",
"message": "That place isn't in the inventory any more. No changes were applied.",
"details": {
"location_id": "loc_01JC000000000000000000000A"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R07S52Y8QP1H5CWWJ2"
}
}A product that isn't there
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"product_id": "prd_01JC000000000000000000000A",
"name": "Milk"
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
product_id: "prd_01JC000000000000000000000A",
name: "Milk",
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/inventory.product.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"product_id": "prd_01JC000000000000000000000A",
"name": "Milk"
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0Z470GENEBYHPSX1T
{
"error": {
"code": "product_not_found",
"message": "That product isn't there any more. No changes were applied.",
"details": {
"product_id": "prd_01JC000000000000000000000A"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0Z470GENEBYHPSX1T"
}
}File a product and mark it a staple
Staples are suggested, not added, when a recipe or the week needs them.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/inventory.product.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CSAYF7DJHHB8MGPDMAH6' \
-d '{
"product_id": "prd_01M6V9CSAWSAMCWTBQ2M7F80H9",
"category": "Dairy",
"is_staple": true
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/inventory.product.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CSAYF7DJHHB8MGPDMAH6",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
product_id: "prd_01M6V9CSAWSAMCWTBQ2M7F80H9",
category: "Dairy",
is_staple: true,
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/inventory.product.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSAYF7DJHHB8MGPDMAH6
{
"product_id": "prd_01M6V9CSAWSAMCWTBQ2M7F80H9",
"category": "Dairy",
"is_staple": true
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSAYWQYS5THKDNKCGH0J
{
"result": {},
"version": 33
}Leave a note for whoever shops
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/inventory.product.update' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CSCT9MDVD0QB74CF8ESX' \
-d '{
"product_id": "prd_01M6V9CSAG72MC7ERJ4GCZ0X7A",
"shopping_note": "The green bag, not the blue."
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/inventory.product.update", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CSCT9MDVD0QB74CF8ESX",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
product_id: "prd_01M6V9CSAG72MC7ERJ4GCZ0X7A",
shopping_note: "The green bag, not the blue.",
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/inventory.product.update HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSCT9MDVD0QB74CF8ESX
{
"product_id": "prd_01M6V9CSAG72MC7ERJ4GCZ0X7A",
"shopping_note": "The green bag, not the blue."
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSCTW5NMCE8Q3Z8Q30TR
{
"result": {},
"version": 47
}For Rigel#
Rigel's tool for this command is inventory_product_update. Rigel runs this on its own, then says what it did. The agent guide has the rest.