Skip to content
Skip to Content
Docs
Studio

Answer Recipe Allergen Rows

Records a person's answers for one or more allergen rows of the recipe and returns the updated record. Each item names an allergen code and a state: contains (with species where the list requires one), not_present, or not_answered to clear the person's answer. Saves one new version for all of them, or nothing when every answer is already stored.

A row an ingredient declares contains cannot be answered not_present, and an allergen on the cross-contact list cannot be answered contains. The answers are saved together or not at all. Send the recipe's current version_id in the If-Match header. Changing an answer makes an earlier confirmation of the record stale.

PATCH
/studio/recipes/{recipe_id}/allergens/rows

Path Parameters

recipe_id*Recipe Id

Header Parameters

If-Match*string

The recipe's current version_id: the one the last change to this recipe returned, or the one reading the recipe returns (get_recipe). A stale value is refused with the current version_id; read the recipe again and retry.

Request Body

application/json
  1. body

Answers for one or more allergen rows.

items*array<>

One answer per allergen, each naming a different code.

Items1 <= items <= 32

Response Body

Successful Response

application/json
  1. response

The envelope for reading and changing a recipe's allergen record.

data*

The allergen record of one recipe version.

meta*

Response metadata.

version_id?|

The version the record was read at; pass it as If-Match on the next change. Null only for a recipe that was never versioned.

Example Request
curl -X PATCH 'https://api.bettermenu.live/studio/recipes/string/allergens/rows' \  -H 'If-Match: string' \  -H 'Content-Type: application/json' \  -d '{  "items": [    {      "code": "string",      "state": "contains"    }  ]}'
Example Response
{  "data": {    "country": "US",    "list_version": "string",    "rows": [      {        "code": "string",        "state": "contains",        "species": [          "string"        ],        "other_species": [          "string"        ],        "sources": [          {            "kind": "custom_ingredient",            "ingredient_row_id": "string",            "custom_ingredient_id": "string",            "custom_ingredient_version_id": "string",            "name": "string",            "via": [              "string"            ],            "actor": {              "type": "member",              "id": "string"            },            "channel": "studio",            "at": "2019-08-24T14:15:22Z"          }        ],        "carried_state": "contains",        "carried_species": [          "string"        ],        "carried_other_species": [          "string"        ],        "person": {          "state": "contains",          "species": [            "string"          ],          "other_species": [            "string"          ],          "actor": {            "type": "member",            "id": "string"          },          "channel": "studio",          "at": "2019-08-24T14:15:22Z"        },        "person_answer_superseded": false,        "name": "string"      }    ],    "cross_contact": [      {        "code": "string",        "sources": [          {            "kind": "custom_ingredient",            "ingredient_row_id": "string",            "custom_ingredient_id": "string",            "custom_ingredient_version_id": "string",            "name": "string",            "via": [              "string"            ],            "actor": {              "type": "member",              "id": "string"            },            "channel": "studio",            "at": "2019-08-24T14:15:22Z"          }        ]      }    ],    "unanswered": [      "string"    ],    "unreadable_ingredient_rows": [      "string"    ],    "complete": true,    "record_hash": "string",    "confirmation": {      "state": "confirmed",      "current": {        "confirmation_id": "string",        "version_id": "string",        "record_hash": "string",        "actor": {          "type": "member",          "id": "string"        },        "channel": "studio",        "confirmed_at": "2019-08-24T14:15:22Z"      }    }  },  "meta": {    "version": "string",    "request_id": "string",    "timestamp": "string"  },  "version_id": "string"}

Recipe in, FDA-format Nutrition Facts out, with every version kept.

Start freeNo card needed.