{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "info": {
    "title": "AllergenQR API",
    "version": "1.0.0",
    "description": "UK statutory allergen registers, QR menus and PPDS (Natasha's Law) validation. The AllergenQR API is a HTTP/JSON API with predictable resource URLs, Bearer or API-key authentication and published rate limits on every response. All monetary values are in pence; all times are UTC. ",
    "termsOfService": "https://allergenqr.co.uk/api-terms",
    "contact": {
      "name": "AllergenQR API Support",
      "url": "https://allergenqr.co.uk/docs/"
    }
  },
  "servers": [
    {
      "url": "https://allergenqr.co.uk",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Allergenqr",
      "description": "AllergenQR API endpoints."
    }
  ],
  "paths": {
    "/api/v1/allergens/uk-statutory": {
      "get": {
        "operationId": "listUkStatutoryAllergens",
        "summary": "List UK statutory allergens",
        "description": "Returns all 14 UK statutory allergens plus cereal sub-types, tree-nut sub-types and icon slugs for label rendering.",
        "tags": [
          "Allergenqr"
        ],
        "x-tier": "FREE",
        "responses": {
          "200": {
            "description": "Successful response. Rate-limit and monthly-quota headers are returned on every 200.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Requests allowed in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 59
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 1764931200
                }
              },
              "X-Quota-Monthly-Limit": {
                "description": "Total requests included in the plan for this calendar month.",
                "schema": {
                  "type": "integer",
                  "example": 10000
                }
              },
              "X-Quota-Monthly-Remaining": {
                "description": "Monthly quota remaining after this request.",
                "schema": {
                  "type": "integer",
                  "example": 9940
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer",
                      "example": 14
                    },
                    "allergens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slug": {
                            "type": "string",
                            "example": "gluten"
                          },
                          "name": {
                            "type": "string",
                            "example": "Gluten"
                          },
                          "statutory": {
                            "type": "boolean",
                            "example": true
                          },
                          "icon_slug": {
                            "type": "string",
                            "example": "gluten-wheat"
                          },
                          "sub_types": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "example": [
                              "wheat",
                              "barley",
                              "rye",
                              "oats",
                              "spelt"
                            ]
                          },
                          "bold_markup_required": {
                            "type": "boolean",
                            "example": true
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "default": {
                    "value": {
                      "count": 14,
                      "allergens": [
                        {
                          "slug": "gluten",
                          "name": "Gluten",
                          "statutory": true,
                          "icon_slug": "gluten-wheat",
                          "sub_types": [
                            "wheat",
                            "barley",
                            "rye",
                            "oats",
                            "spelt"
                          ],
                          "bold_markup_required": true
                        },
                        {
                          "slug": "milk",
                          "name": "Milk",
                          "statutory": true,
                          "icon_slug": "milk",
                          "sub_types": [],
                          "bold_markup_required": true
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or invalid credentials.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "type": "https://httpstatuses.com/401",
                      "title": "Unauthorized",
                      "status": 401,
                      "detail": "Provide a valid Bearer token or X-API-Key header.",
                      "instance": "/api/v1/"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Plan Upgrade Required — the endpoint or requested option is not on the current plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanUpgradeRequired"
                },
                "examples": {
                  "upgrade_required": {
                    "value": {
                      "type": "https://httpstatuses.com/403",
                      "title": "Plan Upgrade Required",
                      "status": 403,
                      "detail": "This operation requires a higher plan tier.",
                      "instance": "/api/v1/",
                      "upgrade_url": "https://allergenqr.co.uk/pricing",
                      "required_plan": "PRO"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests — RFC 9457 problem+json with a Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying (RFC 9110 §10.2.3).",
                "schema": {
                  "type": "integer",
                  "example": 30
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests allowed in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Zero while throttled.",
                "schema": {
                  "type": "integer",
                  "example": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 1764931200
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "throttled": {
                    "value": {
                      "type": "https://httpstatuses.com/429",
                      "title": "Too Many Requests",
                      "status": 429,
                      "detail": "Rate limit exceeded for the current window.",
                      "instance": "/api/v1/",
                      "retry_after_seconds": 30
                    }
                  }
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/api/v1/menus/public/{slug}": {
      "get": {
        "operationId": "getPublicMenu",
        "summary": "Get a public menu",
        "description": "Returns a published allergen menu by its public slug. No authentication is required.",
        "tags": [
          "Allergenqr"
        ],
        "x-tier": "FREE",
        "responses": {
          "200": {
            "description": "Successful response. Rate-limit and monthly-quota headers are returned on every 200.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Requests allowed in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 59
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 1764931200
                }
              },
              "X-Quota-Monthly-Limit": {
                "description": "Total requests included in the plan for this calendar month.",
                "schema": {
                  "type": "integer",
                  "example": 10000
                }
              },
              "X-Quota-Monthly-Remaining": {
                "description": "Monthly quota remaining after this request.",
                "schema": {
                  "type": "integer",
                  "example": 9940
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "menu": {
                      "type": "object",
                      "properties": {
                        "slug": {
                          "type": "string",
                          "example": "summer-menu"
                        },
                        "venueId": {
                          "type": "string",
                          "example": "venue_9Kp2"
                        },
                        "name": {
                          "type": "string",
                          "example": "Summer Menu"
                        },
                        "updated_at": {
                          "type": "string",
                          "format": "date-time",
                          "example": "2026-06-01T10:00:00Z"
                        }
                      }
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "item_3Fq"
                          },
                          "name": {
                            "type": "string",
                            "example": "Ploughman's Sandwich"
                          },
                          "allergens": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "example": [
                              "gluten",
                              "milk"
                            ]
                          },
                          "ppds": {
                            "type": "boolean",
                            "example": true,
                            "description": "Prepacked for direct sale."
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "default": {
                    "value": {
                      "menu": {
                        "slug": "summer-menu",
                        "venueId": "venue_9Kp2",
                        "name": "Summer Menu",
                        "updated_at": "2026-06-01T10:00:00Z"
                      },
                      "items": [
                        {
                          "id": "item_3Fq",
                          "name": "Ploughman's Sandwich",
                          "allergens": [
                            "gluten",
                            "milk"
                          ],
                          "ppds": true
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or invalid credentials.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "type": "https://httpstatuses.com/401",
                      "title": "Unauthorized",
                      "status": 401,
                      "detail": "Provide a valid Bearer token or X-API-Key header.",
                      "instance": "/api/v1/"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Plan Upgrade Required — the endpoint or requested option is not on the current plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanUpgradeRequired"
                },
                "examples": {
                  "upgrade_required": {
                    "value": {
                      "type": "https://httpstatuses.com/403",
                      "title": "Plan Upgrade Required",
                      "status": 403,
                      "detail": "This operation requires a higher plan tier.",
                      "instance": "/api/v1/",
                      "upgrade_url": "https://allergenqr.co.uk/pricing",
                      "required_plan": "PRO"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests — RFC 9457 problem+json with a Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying (RFC 9110 §10.2.3).",
                "schema": {
                  "type": "integer",
                  "example": 30
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests allowed in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Zero while throttled.",
                "schema": {
                  "type": "integer",
                  "example": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 1764931200
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "throttled": {
                    "value": {
                      "type": "https://httpstatuses.com/429",
                      "title": "Too Many Requests",
                      "status": 429,
                      "detail": "Rate limit exceeded for the current window.",
                      "instance": "/api/v1/",
                      "retry_after_seconds": 30
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "description": "Public menu slug.",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "example": "summer-menu"
            },
            "example": "summer-menu"
          }
        ],
        "security": []
      }
    },
    "/api/v1/menus/{menuId}/items": {
      "get": {
        "operationId": "listMenuItems",
        "summary": "List menu items",
        "description": "Lists all items on a menu, including their allergen tags and PPDS flags. Requires the PRO plan.",
        "tags": [
          "Allergenqr"
        ],
        "x-tier": "PRO",
        "responses": {
          "200": {
            "description": "Successful response. Rate-limit and monthly-quota headers are returned on every 200.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Requests allowed in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 59
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 1764931200
                }
              },
              "X-Quota-Monthly-Limit": {
                "description": "Total requests included in the plan for this calendar month.",
                "schema": {
                  "type": "integer",
                  "example": 10000
                }
              },
              "X-Quota-Monthly-Remaining": {
                "description": "Monthly quota remaining after this request.",
                "schema": {
                  "type": "integer",
                  "example": 9940
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "item_3Fq"
                          },
                          "name": {
                            "type": "string",
                            "example": "Ploughman's Sandwich"
                          },
                          "allergens": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "example": [
                              "gluten",
                              "milk"
                            ]
                          },
                          "ppds": {
                            "type": "boolean",
                            "example": true,
                            "description": "Prepacked for direct sale."
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "default": {
                    "value": {
                      "items": [
                        {
                          "id": "item_3Fq",
                          "name": "Ploughman's Sandwich",
                          "allergens": [
                            "gluten",
                            "milk"
                          ],
                          "ppds": true
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or invalid credentials.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "type": "https://httpstatuses.com/401",
                      "title": "Unauthorized",
                      "status": 401,
                      "detail": "Provide a valid Bearer token or X-API-Key header.",
                      "instance": "/api/v1/"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Plan Upgrade Required — the endpoint or requested option is not on the current plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanUpgradeRequired"
                },
                "examples": {
                  "upgrade_required": {
                    "value": {
                      "type": "https://httpstatuses.com/403",
                      "title": "Plan Upgrade Required",
                      "status": 403,
                      "detail": "This operation requires a higher plan tier.",
                      "instance": "/api/v1/",
                      "upgrade_url": "https://allergenqr.co.uk/pricing",
                      "required_plan": "PRO"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests — RFC 9457 problem+json with a Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying (RFC 9110 §10.2.3).",
                "schema": {
                  "type": "integer",
                  "example": 30
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests allowed in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Zero while throttled.",
                "schema": {
                  "type": "integer",
                  "example": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 1764931200
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "throttled": {
                    "value": {
                      "type": "https://httpstatuses.com/429",
                      "title": "Too Many Requests",
                      "status": 429,
                      "detail": "Rate limit exceeded for the current window.",
                      "instance": "/api/v1/",
                      "retry_after_seconds": 30
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "menuId",
            "in": "path",
            "description": "Menu identifier.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "menu_2Ld8"
            },
            "example": "menu_2Ld8"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "post": {
        "operationId": "createMenuItem",
        "summary": "Create a menu item",
        "description": "Adds an item to a menu with its allergen tags. Requires the PRO plan.",
        "tags": [
          "Allergenqr"
        ],
        "x-tier": "PRO",
        "responses": {
          "200": {
            "description": "Successful response. Rate-limit and monthly-quota headers are returned on every 200.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Requests allowed in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 59
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 1764931200
                }
              },
              "X-Quota-Monthly-Limit": {
                "description": "Total requests included in the plan for this calendar month.",
                "schema": {
                  "type": "integer",
                  "example": 10000
                }
              },
              "X-Quota-Monthly-Remaining": {
                "description": "Monthly quota remaining after this request.",
                "schema": {
                  "type": "integer",
                  "example": 9940
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "item_3Fq"
                    },
                    "name": {
                      "type": "string",
                      "example": "Ploughman's Sandwich"
                    },
                    "allergens": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "gluten",
                        "milk"
                      ]
                    },
                    "ppds": {
                      "type": "boolean",
                      "example": true,
                      "description": "Prepacked for direct sale."
                    }
                  }
                },
                "examples": {
                  "default": {
                    "value": {
                      "id": "item_3Fq",
                      "name": "Ploughman's Sandwich",
                      "allergens": [
                        "gluten",
                        "milk"
                      ],
                      "ppds": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or invalid credentials.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "type": "https://httpstatuses.com/401",
                      "title": "Unauthorized",
                      "status": 401,
                      "detail": "Provide a valid Bearer token or X-API-Key header.",
                      "instance": "/api/v1/"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Plan Upgrade Required — the endpoint or requested option is not on the current plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanUpgradeRequired"
                },
                "examples": {
                  "upgrade_required": {
                    "value": {
                      "type": "https://httpstatuses.com/403",
                      "title": "Plan Upgrade Required",
                      "status": 403,
                      "detail": "This operation requires a higher plan tier.",
                      "instance": "/api/v1/",
                      "upgrade_url": "https://allergenqr.co.uk/pricing",
                      "required_plan": "PRO"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests — RFC 9457 problem+json with a Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying (RFC 9110 §10.2.3).",
                "schema": {
                  "type": "integer",
                  "example": 30
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests allowed in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Zero while throttled.",
                "schema": {
                  "type": "integer",
                  "example": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 1764931200
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "throttled": {
                    "value": {
                      "type": "https://httpstatuses.com/429",
                      "title": "Too Many Requests",
                      "status": 429,
                      "detail": "Rate limit exceeded for the current window.",
                      "instance": "/api/v1/",
                      "retry_after_seconds": 30
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters or body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "invalid": {
                    "value": {
                      "type": "https://httpstatuses.com/400",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "name must be between 1 and 120 characters.",
                      "instance": "/api/v1/"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "menuId",
            "in": "path",
            "description": "Menu identifier.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "menu_2Ld8"
            },
            "example": "menu_2Ld8"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120,
                    "example": "Ploughman's Sandwich"
                  },
                  "allergens": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "default": [],
                    "example": [
                      "gluten",
                      "milk"
                    ]
                  },
                  "ppds": {
                    "type": "boolean",
                    "default": false,
                    "example": true
                  }
                },
                "required": [
                  "name"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "name": "Ploughman's Sandwich",
                    "allergens": [
                      "gluten",
                      "milk"
                    ],
                    "ppds": true
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "patch": {
        "operationId": "updateMenuItem",
        "summary": "Update a menu item",
        "description": "Partially updates an item's name, allergen tags or PPDS flag. Requires the PRO plan.",
        "tags": [
          "Allergenqr"
        ],
        "x-tier": "PRO",
        "responses": {
          "200": {
            "description": "Successful response. Rate-limit and monthly-quota headers are returned on every 200.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Requests allowed in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 59
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 1764931200
                }
              },
              "X-Quota-Monthly-Limit": {
                "description": "Total requests included in the plan for this calendar month.",
                "schema": {
                  "type": "integer",
                  "example": 10000
                }
              },
              "X-Quota-Monthly-Remaining": {
                "description": "Monthly quota remaining after this request.",
                "schema": {
                  "type": "integer",
                  "example": 9940
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "item_3Fq"
                    },
                    "name": {
                      "type": "string",
                      "example": "Ploughman's Sandwich"
                    },
                    "allergens": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "gluten",
                        "milk"
                      ]
                    },
                    "ppds": {
                      "type": "boolean",
                      "example": true,
                      "description": "Prepacked for direct sale."
                    }
                  }
                },
                "examples": {
                  "default": {
                    "value": {
                      "id": "item_3Fq",
                      "name": "Ploughman's Sandwich",
                      "allergens": [
                        "gluten",
                        "milk",
                        "nuts"
                      ],
                      "ppds": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or invalid credentials.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "type": "https://httpstatuses.com/401",
                      "title": "Unauthorized",
                      "status": 401,
                      "detail": "Provide a valid Bearer token or X-API-Key header.",
                      "instance": "/api/v1/"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Plan Upgrade Required — the endpoint or requested option is not on the current plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanUpgradeRequired"
                },
                "examples": {
                  "upgrade_required": {
                    "value": {
                      "type": "https://httpstatuses.com/403",
                      "title": "Plan Upgrade Required",
                      "status": 403,
                      "detail": "This operation requires a higher plan tier.",
                      "instance": "/api/v1/",
                      "upgrade_url": "https://allergenqr.co.uk/pricing",
                      "required_plan": "PRO"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests — RFC 9457 problem+json with a Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying (RFC 9110 §10.2.3).",
                "schema": {
                  "type": "integer",
                  "example": 30
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests allowed in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Zero while throttled.",
                "schema": {
                  "type": "integer",
                  "example": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 1764931200
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "throttled": {
                    "value": {
                      "type": "https://httpstatuses.com/429",
                      "title": "Too Many Requests",
                      "status": 429,
                      "detail": "Rate limit exceeded for the current window.",
                      "instance": "/api/v1/",
                      "retry_after_seconds": 30
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters or body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "invalid": {
                    "value": {
                      "type": "https://httpstatuses.com/400",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "At least one of name, allergens or ppds must be supplied.",
                      "instance": "/api/v1/"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "menuId",
            "in": "path",
            "description": "Menu identifier.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "menu_2Ld8"
            },
            "example": "menu_2Ld8"
          },
          {
            "name": "itemId",
            "in": "query",
            "description": "Item identifier.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "item_3Fq"
            },
            "example": "item_3Fq"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120,
                    "example": "Ploughman's Sandwich"
                  },
                  "allergens": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "example": [
                      "gluten",
                      "milk",
                      "nuts"
                    ]
                  },
                  "ppds": {
                    "type": "boolean",
                    "example": true
                  }
                }
              },
              "examples": {
                "default": {
                  "value": {
                    "allergens": [
                      "gluten",
                      "milk",
                      "nuts"
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      },
      "delete": {
        "operationId": "deleteMenuItem",
        "summary": "Delete a menu item",
        "description": "Permanently removes an item from a menu. Requires the PRO plan.",
        "tags": [
          "Allergenqr"
        ],
        "x-tier": "PRO",
        "responses": {
          "200": {
            "description": "Successful response. Rate-limit and monthly-quota headers are returned on every 200.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Requests allowed in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 59
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 1764931200
                }
              },
              "X-Quota-Monthly-Limit": {
                "description": "Total requests included in the plan for this calendar month.",
                "schema": {
                  "type": "integer",
                  "example": 10000
                }
              },
              "X-Quota-Monthly-Remaining": {
                "description": "Monthly quota remaining after this request.",
                "schema": {
                  "type": "integer",
                  "example": 9940
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                },
                "examples": {
                  "default": {
                    "value": {
                      "deleted": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or invalid credentials.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "type": "https://httpstatuses.com/401",
                      "title": "Unauthorized",
                      "status": 401,
                      "detail": "Provide a valid Bearer token or X-API-Key header.",
                      "instance": "/api/v1/"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Plan Upgrade Required — the endpoint or requested option is not on the current plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanUpgradeRequired"
                },
                "examples": {
                  "upgrade_required": {
                    "value": {
                      "type": "https://httpstatuses.com/403",
                      "title": "Plan Upgrade Required",
                      "status": 403,
                      "detail": "This operation requires a higher plan tier.",
                      "instance": "/api/v1/",
                      "upgrade_url": "https://allergenqr.co.uk/pricing",
                      "required_plan": "PRO"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests — RFC 9457 problem+json with a Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying (RFC 9110 §10.2.3).",
                "schema": {
                  "type": "integer",
                  "example": 30
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests allowed in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Zero while throttled.",
                "schema": {
                  "type": "integer",
                  "example": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 1764931200
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "throttled": {
                    "value": {
                      "type": "https://httpstatuses.com/429",
                      "title": "Too Many Requests",
                      "status": 429,
                      "detail": "Rate limit exceeded for the current window.",
                      "instance": "/api/v1/",
                      "retry_after_seconds": 30
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters or body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "invalid": {
                    "value": {
                      "type": "https://httpstatuses.com/400",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "itemId is required.",
                      "instance": "/api/v1/"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "menuId",
            "in": "path",
            "description": "Menu identifier.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "menu_2Ld8"
            },
            "example": "menu_2Ld8"
          },
          {
            "name": "itemId",
            "in": "query",
            "description": "Item identifier.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "item_3Fq"
            },
            "example": "item_3Fq"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/validate/ppds": {
      "post": {
        "operationId": "validatePpds",
        "summary": "Validate PPDS allergen markup",
        "description": "Checks Natasha's Law PPDS labelling: statutory allergens must appear in bold on the label. Requires the PRO plan (GROUP for multi-venue).",
        "tags": [
          "Allergenqr"
        ],
        "x-tier": "PRO",
        "responses": {
          "200": {
            "description": "Successful response. Rate-limit and monthly-quota headers are returned on every 200.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Requests allowed in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 59
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 1764931200
                }
              },
              "X-Quota-Monthly-Limit": {
                "description": "Total requests included in the plan for this calendar month.",
                "schema": {
                  "type": "integer",
                  "example": 10000
                }
              },
              "X-Quota-Monthly-Remaining": {
                "description": "Monthly quota remaining after this request.",
                "schema": {
                  "type": "integer",
                  "example": 9940
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "valid": {
                      "type": "boolean",
                      "example": true
                    },
                    "missing_bold": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": []
                    },
                    "group_id": {
                      "type": "string",
                      "example": "group_4Tp"
                    }
                  }
                },
                "examples": {
                  "default": {
                    "value": {
                      "valid": true,
                      "missing_bold": [],
                      "group_id": "group_4Tp"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or invalid credentials.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "type": "https://httpstatuses.com/401",
                      "title": "Unauthorized",
                      "status": 401,
                      "detail": "Provide a valid Bearer token or X-API-Key header.",
                      "instance": "/api/v1/"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Plan Upgrade Required — the endpoint or requested option is not on the current plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanUpgradeRequired"
                },
                "examples": {
                  "upgrade_required": {
                    "value": {
                      "type": "https://httpstatuses.com/403",
                      "title": "Plan Upgrade Required",
                      "status": 403,
                      "detail": "This operation requires a higher plan tier.",
                      "instance": "/api/v1/",
                      "upgrade_url": "https://allergenqr.co.uk/pricing",
                      "required_plan": "PRO"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests — RFC 9457 problem+json with a Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying (RFC 9110 §10.2.3).",
                "schema": {
                  "type": "integer",
                  "example": 30
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests allowed in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Zero while throttled.",
                "schema": {
                  "type": "integer",
                  "example": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 1764931200
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "throttled": {
                    "value": {
                      "type": "https://httpstatuses.com/429",
                      "title": "Too Many Requests",
                      "status": 429,
                      "detail": "Rate limit exceeded for the current window.",
                      "instance": "/api/v1/",
                      "retry_after_seconds": 30
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters or body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "invalid": {
                    "value": {
                      "type": "https://httpstatuses.com/400",
                      "title": "Bad Request",
                      "status": 400,
                      "detail": "label_markup and allergens are required.",
                      "instance": "/api/v1/"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label_markup": {
                    "type": "string",
                    "minLength": 1,
                    "example": "Contains <strong>milk</strong> and <strong>gluten</strong>."
                  },
                  "allergens": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "example": [
                      "milk",
                      "gluten"
                    ]
                  }
                },
                "required": [
                  "label_markup",
                  "allergens"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "label_markup": "Contains <strong>milk</strong> and <strong>gluten</strong>.",
                    "allergens": [
                      "milk",
                      "gluten"
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    },
    "/api/v1/venues/{venueId}/audit-log": {
      "get": {
        "operationId": "getVenueAuditLog",
        "summary": "Get a venue audit log",
        "description": "Returns the allergen-change audit trail for a venue across a group. Requires the GROUP plan.",
        "tags": [
          "Allergenqr"
        ],
        "x-tier": "SCALE",
        "responses": {
          "200": {
            "description": "Successful response. Rate-limit and monthly-quota headers are returned on every 200.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Requests allowed in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 59
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 1764931200
                }
              },
              "X-Quota-Monthly-Limit": {
                "description": "Total requests included in the plan for this calendar month.",
                "schema": {
                  "type": "integer",
                  "example": 10000
                }
              },
              "X-Quota-Monthly-Remaining": {
                "description": "Monthly quota remaining after this request.",
                "schema": {
                  "type": "integer",
                  "example": 9940
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "at": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2026-06-01T10:00:00Z"
                          },
                          "actor": {
                            "type": "string",
                            "example": "user_1Qw"
                          },
                          "change": {
                            "type": "string",
                            "example": "allergen_added:nuts"
                          }
                        }
                      }
                    },
                    "page": {
                      "type": "integer",
                      "example": 1
                    }
                  }
                },
                "examples": {
                  "default": {
                    "value": {
                      "events": [
                        {
                          "at": "2026-06-01T10:00:00Z",
                          "actor": "user_1Qw",
                          "change": "allergen_added:nuts"
                        }
                      ],
                      "page": 1
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or invalid credentials.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "unauthorized": {
                    "value": {
                      "type": "https://httpstatuses.com/401",
                      "title": "Unauthorized",
                      "status": 401,
                      "detail": "Provide a valid Bearer token or X-API-Key header.",
                      "instance": "/api/v1/"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Plan Upgrade Required — the endpoint or requested option is not on the current plan.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanUpgradeRequired"
                },
                "examples": {
                  "upgrade_required": {
                    "value": {
                      "type": "https://httpstatuses.com/403",
                      "title": "Plan Upgrade Required",
                      "status": 403,
                      "detail": "This operation requires a higher plan tier.",
                      "instance": "/api/v1/",
                      "upgrade_url": "https://allergenqr.co.uk/pricing",
                      "required_plan": "PRO"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests — RFC 9457 problem+json with a Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying (RFC 9110 §10.2.3).",
                "schema": {
                  "type": "integer",
                  "example": 30
                }
              },
              "X-RateLimit-Limit": {
                "description": "Requests allowed in the current window.",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Zero while throttled.",
                "schema": {
                  "type": "integer",
                  "example": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix seconds when the current window resets.",
                "schema": {
                  "type": "integer",
                  "example": 1764931200
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "examples": {
                  "throttled": {
                    "value": {
                      "type": "https://httpstatuses.com/429",
                      "title": "Too Many Requests",
                      "status": 429,
                      "detail": "Rate limit exceeded for the current window.",
                      "instance": "/api/v1/",
                      "retry_after_seconds": 30
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "venueId",
            "in": "path",
            "description": "Venue identifier.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "venue_9Kp2"
            },
            "example": "venue_9Kp2"
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            },
            "example": 1
          }
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "apiKeyHeader": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API token",
        "description": "Send `Authorization: Bearer <token>`."
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Send `X-API-Key: <key>` as an alternative to Bearer auth."
      }
    },
    "schemas": {
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "example": "https://httpstatuses.com/429"
          },
          "title": {
            "type": "string",
            "example": "Too Many Requests"
          },
          "status": {
            "type": "integer",
            "example": 429
          },
          "detail": {
            "type": "string",
            "example": "Rate limit exceeded for the current window."
          },
          "instance": {
            "type": "string",
            "example": "/api/v1/"
          },
          "retry_after_seconds": {
            "type": "integer",
            "example": 30
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ]
      },
      "PlanUpgradeRequired": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "example": "https://httpstatuses.com/403"
          },
          "title": {
            "type": "string",
            "example": "Plan Upgrade Required"
          },
          "status": {
            "type": "integer",
            "example": 403
          },
          "detail": {
            "type": "string",
            "example": "This operation requires a higher plan tier."
          },
          "upgrade_url": {
            "type": "string",
            "format": "uri",
            "example": "https://example.co.uk/pricing"
          },
          "required_plan": {
            "type": "string",
            "enum": [
              "PRO",
              "AGENCY",
              "FRANCHISE",
              "GROUP",
              "SCALE"
            ],
            "example": "PRO"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "upgrade_url"
        ]
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    },
    {
      "apiKeyHeader": []
    }
  ]
}
