Set what to buy for a dish
meals.dish.set_ingredients
POST/api/v1/households/{household_id}/commands/meals.dish.set_ingredients
- Command
- Rigel runs it
- Applies offline
Replaces what to buy for the dish with items, in order, so the week's groceries can be worked out. Fails with dish_has_recipe if the dish has a recipe, which supplies the ingredients: change the recipe instead (meals.dish.update with recipe_id, or the recipe's own commands). Each item is a product from the shared product list, named by ID or by name (a new name adds the product). Naming a product twice keeps it once. An empty list clears it. Amounts are free text and never added up.
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 |
|---|---|
dish_idstringrequired | A dish ID, such as dsh_01JC0000000000000000000000. |
itemsarray of one of 2 shapesrequired | What to buy, in order, up to 100 items. |
| Shape 1, with product_id | |
items[].product_idstringrequired | A product ID, such as prd_01JC0000000000000000000000. |
items[].amount_notestring or nulloptional | Free text about how much, such as "1 pack". Never added up. Null or left out for none. |
| Shape 2, with product_name | |
items[].product_namestringrequired | A product by name, such as "flour tortillas". The product with that name (ignoring case) is used, or a new one is added to the shared product list. |
items[].amount_notestring or nulloptional | Free text about how much, such as "1 pack". Never added up. Null or left out for none. |
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 | dish_not_found | A missing dish. |
404 | product_not_found | A product that isn't on the list. |
404 | not_found | The household doesn't exist, or you aren't a member of it. |
409 | dish_has_recipe | A dish with a recipe gets its ingredients from the recipe: dish_has_recipe. |
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.
A dish with none gets rows in order, by product ID and by name, adding a new product
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"dish_id": "dsh_01JC000000000000000000000A",
"items": [
{
"product_id": "prd_01JC0000000000000000000P00",
"amount_note": "1 pack"
},
{
"product_name": "salsa verde"
}
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
dish_id: "dsh_01JC000000000000000000000A",
items: [
{
product_id: "prd_01JC0000000000000000000P00",
amount_note: "1 pack",
},
{
product_name: "salsa verde",
},
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"dish_id": "dsh_01JC000000000000000000000A",
"items": [
{
"product_id": "prd_01JC0000000000000000000P00",
"amount_note": "1 pack"
},
{
"product_name": "salsa verde"
}
]
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0YN28BS26YH106RV1
{
"result": {},
"version": 1
}A product name matching one on the list, ignoring case, uses it
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"dish_id": "dsh_01JC000000000000000000000A",
"items": [
{
"product_name": "Cheese",
"amount_note": "8 oz"
}
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
dish_id: "dsh_01JC000000000000000000000A",
items: [
{
product_name: "Cheese",
amount_note: "8 oz",
},
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"dish_id": "dsh_01JC000000000000000000000A",
"items": [
{
"product_name": "Cheese",
"amount_note": "8 oz"
}
]
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0766G2HH4AC3FPX1Z
{
"result": {},
"version": 1
}Rows are kept by product: a changed note or place updates them, and products left out are deleted
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"dish_id": "dsh_01JC000000000000000000000A",
"items": [
{
"product_id": "prd_01JC0000000000000000000P02"
},
{
"product_id": "prd_01JC0000000000000000000P00",
"amount_note": "2 packs"
}
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
dish_id: "dsh_01JC000000000000000000000A",
items: [
{
product_id: "prd_01JC0000000000000000000P02",
},
{
product_id: "prd_01JC0000000000000000000P00",
amount_note: "2 packs",
},
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"dish_id": "dsh_01JC000000000000000000000A",
"items": [
{
"product_id": "prd_01JC0000000000000000000P02"
},
{
"product_id": "prd_01JC0000000000000000000P00",
"amount_note": "2 packs"
}
]
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0QM5HVMDNBZVQP0J7
{
"result": {},
"version": 1
}The same list changes nothing
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"dish_id": "dsh_01JC000000000000000000000A",
"items": [
{
"product_id": "prd_01JC0000000000000000000P00",
"amount_note": "1 pack"
},
{
"product_name": "chicken"
}
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
dish_id: "dsh_01JC000000000000000000000A",
items: [
{
product_id: "prd_01JC0000000000000000000P00",
amount_note: "1 pack",
},
{
product_name: "chicken",
},
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"dish_id": "dsh_01JC000000000000000000000A",
"items": [
{
"product_id": "prd_01JC0000000000000000000P00",
"amount_note": "1 pack"
},
{
"product_name": "chicken"
}
]
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0CQ96PBS3TT3YYWQT
{
"result": {},
"version": 1
}A product named twice is kept once, in its first place, with both notes
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"dish_id": "dsh_01JC000000000000000000000A",
"items": [
{
"product_id": "prd_01JC0000000000000000000P01",
"amount_note": "1 lb"
},
{
"product_id": "prd_01JC0000000000000000000P00"
},
{
"product_name": "CHICKEN",
"amount_note": "for the kids"
}
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
dish_id: "dsh_01JC000000000000000000000A",
items: [
{
product_id: "prd_01JC0000000000000000000P01",
amount_note: "1 lb",
},
{
product_id: "prd_01JC0000000000000000000P00",
},
{
product_name: "CHICKEN",
amount_note: "for the kids",
},
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"dish_id": "dsh_01JC000000000000000000000A",
"items": [
{
"product_id": "prd_01JC0000000000000000000P01",
"amount_note": "1 lb"
},
{
"product_id": "prd_01JC0000000000000000000P00"
},
{
"product_name": "CHICKEN",
"amount_note": "for the kids"
}
]
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R03RGXRC76GMXGGZ3N
{
"result": {},
"version": 1
}An empty list clears what to buy
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"dish_id": "dsh_01JC000000000000000000000A",
"items": []
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
dish_id: "dsh_01JC000000000000000000000A",
items: [],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"dish_id": "dsh_01JC000000000000000000000A",
"items": []
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01K9D9S2R085774NQQ2HHD4EXN
{
"result": {},
"version": 1
}A missing dish
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"dish_id": "dsh_01JC000000000000000000000A",
"items": [
{
"product_id": "prd_01JC0000000000000000000P00"
}
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
dish_id: "dsh_01JC000000000000000000000A",
items: [
{
product_id: "prd_01JC0000000000000000000P00",
},
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"dish_id": "dsh_01JC000000000000000000000A",
"items": [
{
"product_id": "prd_01JC0000000000000000000P00"
}
]
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R011NE1W4EJBVBHT7G
{
"error": {
"code": "dish_not_found",
"message": "That dish isn't there any more. No changes were applied.",
"details": {
"dish_id": "dsh_01JC000000000000000000000A"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R011NE1W4EJBVBHT7G"
}
}A product that isn't on the list
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"dish_id": "dsh_01JC000000000000000000000A",
"items": [
{
"product_id": "prd_01JC0000000000000000000P09"
}
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
dish_id: "dsh_01JC000000000000000000000A",
items: [
{
product_id: "prd_01JC0000000000000000000P09",
},
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"dish_id": "dsh_01JC000000000000000000000A",
"items": [
{
"product_id": "prd_01JC0000000000000000000P09"
}
]
}HTTP/1.1 404 Not Found
Content-Type: application/json
X-Request-Id: req_01K9D9S2R0VVMTMPX4G5FBERDQ
{
"error": {
"code": "product_not_found",
"message": "That product isn't there any more. No changes were applied.",
"details": {
"product_id": "prd_01JC0000000000000000000P09"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R0VVMTMPX4G5FBERDQ"
}
}A dish with a recipe gets its ingredients from the recipe: dish_has_recipe
curl -X POST 'https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA' \
-d '{
"dish_id": "dsh_01JC000000000000000000000A",
"items": [
{
"product_id": "prd_01JC0000000000000000000P00"
}
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01JC4N0000AAAAAAAAAAAAAAAA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
dish_id: "dsh_01JC000000000000000000000A",
items: [
{
product_id: "prd_01JC0000000000000000000P00",
},
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01K9BKKP003AHRZ6DMV29GQY5C/commands/meals.dish.set_ingredients HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01JC4N0000AAAAAAAAAAAAAAAA
{
"dish_id": "dsh_01JC000000000000000000000A",
"items": [
{
"product_id": "prd_01JC0000000000000000000P00"
}
]
}HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01K9D9S2R04B01BG643FC1FVJD
{
"error": {
"code": "dish_has_recipe",
"message": "That dish is made from a recipe, so it buys the recipe's ingredients. Change the recipe instead, or unlink it first. No changes were applied.",
"details": {
"dish_id": "dsh_01JC000000000000000000000A",
"recipe_id": "rcp_01JC000000000000000000000A"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01K9D9S2R04B01BG643FC1FVJD"
}
}Say what a dish needs from the store
Items are products, by ID or by name. A name that isn't a product yet adds one.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/meals.dish.set_ingredients' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CSFAXQAD516S3137V0Z9' \
-d '{
"dish_id": "dsh_01M6V9CSF42115AECDV14HYQ9G",
"items": [
{
"product_name": "Chicken thighs",
"amount_note": "about 2 lb"
},
{
"product_name": "Tortillas",
"amount_note": "8 small"
},
{
"product_id": "prd_01M6V9CSAMSN9ZJ52PTTKT8G6M",
"amount_note": "1 can"
}
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/meals.dish.set_ingredients", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CSFAXQAD516S3137V0Z9",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
dish_id: "dsh_01M6V9CSF42115AECDV14HYQ9G",
items: [
{
product_name: "Chicken thighs",
amount_note: "about 2 lb",
},
{
product_name: "Tortillas",
amount_note: "8 small",
},
{
product_id: "prd_01M6V9CSAMSN9ZJ52PTTKT8G6M",
amount_note: "1 can",
},
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/meals.dish.set_ingredients HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSFAXQAD516S3137V0Z9
{
"dish_id": "dsh_01M6V9CSF42115AECDV14HYQ9G",
"items": [
{
"product_name": "Chicken thighs",
"amount_note": "about 2 lb"
},
{
"product_name": "Tortillas",
"amount_note": "8 small"
},
{
"product_id": "prd_01M6V9CSAMSN9ZJ52PTTKT8G6M",
"amount_note": "1 can"
}
]
}HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: req_01M6V9CSFA6TN0FAVQZKEYZDES
{
"result": {},
"version": 73
}Give ingredients to a dish that has a recipe
A dish made from a recipe buys the recipe's ingredients, so change the recipe instead.
curl -X POST 'https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/meals.dish.set_ingredients' \
-H "Cookie: rigel_session=$RIGEL_SESSION" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: cmd_01M6V9CSFW1EGKN3AXM5V5EPGA' \
-d '{
"dish_id": "dsh_01M6V9CSFS845RH6KG1MJJPG63",
"items": [
{
"product_name": "Orzo"
}
]
}'const response = await fetch("https://rigel.house/api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/meals.dish.set_ingredients", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "cmd_01M6V9CSFW1EGKN3AXM5V5EPGA",
Cookie: `rigel_session=${process.env.RIGEL_SESSION}`,
},
body: JSON.stringify({
dish_id: "dsh_01M6V9CSFS845RH6KG1MJJPG63",
items: [
{
product_name: "Orzo",
},
],
}),
});
const data = await response.json();POST /api/v1/households/hh_01M6V9CS6GGVFCY7NAS8ZTQV95/commands/meals.dish.set_ingredients HTTP/1.1
Host: rigel.house
Cookie: rigel_session=<your session>
Content-Type: application/json
Idempotency-Key: cmd_01M6V9CSFW1EGKN3AXM5V5EPGA
{
"dish_id": "dsh_01M6V9CSFS845RH6KG1MJJPG63",
"items": [
{
"product_name": "Orzo"
}
]
}HTTP/1.1 409 Conflict
Content-Type: application/json
X-Request-Id: req_01M6V9CSFWBMRMM04CGSWEZKKA
{
"error": {
"code": "dish_has_recipe",
"message": "That dish is made from a recipe, so it buys the recipe's ingredients. Change the recipe instead, or unlink it first. No changes were applied.",
"details": {
"dish_id": "dsh_01M6V9CSFS845RH6KG1MJJPG63",
"recipe_id": "rcp_01M6V9CSD8VZYF11AC568Y7QPZ"
},
"recovery": "Read the current state, then send a command that fits it.",
"request_id": "req_01M6V9CSFWBMRMM04CGSWEZKKA"
}
}For Rigel#
Rigel's tool for this command is meals_dish_set_ingredients. Rigel runs this on its own, then says what it did. The agent guide has the rest.