Errors
The API answers with standard HTTP status codes and a few Eaternity-specific codes. In a batch, each item has its own statuscode.
Success Codes
| Code | Description |
|---|---|
| 200 | Request succeeded |
| 201 | Resource created successfully |
| 202 | Request accepted for async processing (Products) |
| 204 | Resource deleted successfully (no content) |
Client Error Codes
| Code | Description |
|---|---|
| 400 | Bad request - malformed JSON or invalid content |
| 401 | No authorization - valid API key not provided |
| 403 | Forbidden - kitchen not authorized for calculations |
| 404 | Not found - requested resource does not exist |
| 405 | Method not allowed |
| 413 | Payload Too Large |
Server Error Codes
| Code | Description | Action |
|---|---|---|
| 500 | Server Error | Retry the request, or contact support |
Validation Error Codes
| Code | Description | Action |
|---|---|---|
| 422 | Request Validation Error — request does not match the expected schema (e.g., integer where string was expected) | Fix the request format |
Processing Error Codes (Eaternity-specific)
These custom status codes indicate specific processing issues:
| Code | Name | Description | Action |
|---|---|---|---|
| 601 | Manual Matching Missing | No longer returned. An unmatched ingredient returns 602. | — |
| 602 | No Automatic Match | At least one ingredient name could not be automatically matched in the Eaternity Database | Retry once daily or try a different ingredient name |
| 610 | Missing Required Property | A required resource property was not given in the request | Provide the required field |
| 611 | Wrong Property Value | A resource property was not provided according to the documentation — wrong format or invalid value | Fix the property value |
| 612 | Reference Not Found | An ingredient references a recipe (type: recipes) or a product (type: products) that is not stored | Create it first, or include the sub-recipe in the same batch |
| 613 | Write To A Product Denied | Either a recipe/supply tried to define an ingredient under an id that belongs to a product, or a product write would convert an existing ingredient into one | Reference the product with type: "products" instead of defining it. To convert an ingredient on purpose, add convert-ingredient-to-product=true. |
| 670 | Recipe Has No Ingredients | A sub-recipe was referenced with a positive quantity but has no ingredients itself | Add ingredients to the sub-recipe |
Additional implementation-specific codes
The following codes are returned by the calculation engine for specific processing failures. They are not documented in the canonical API specification but may appear in practice.
| Code | Name | Description | Action |
|---|---|---|---|
| 671 | Missing LCA Inventory | No life cycle inventory found for ingredient | Contact support with term details |
| 672 | Missing Nutrients | No nutrient data found for ingredient | Contact support with term details |
| 673 | Failed Amount Estimation | Could not estimate ingredient amount | Check declaration format |
| 674 | Failed Ingredient Splitter | Could not parse ingredient declaration | Simplify ingredient declaration |
| 675 | Unknown Unit | Ingredient unit not recognized | Use standard units (gram, liter) |
| 678 | CO2 Calculation Failed | Cannot calculate CO2 value | Check ingredient data completeness |
| 679 | VitaScore Calculation Failed | Cannot calculate VitaScore | Check nutrient data availability |
| 680 | Environment Score Failed | Cannot calculate environment score | Check environmental data availability |
Handling 6xx Errors
The 6xx error codes are specific to Eaternity's calculation system:
-
602: Occurs when an ingredient cannot be matched to the Eaternity database. The matching process runs daily, so retry after 24 hours or try a more common ingredient name.
-
610/611: These relate to missing or invalid request properties. Check the request against the API documentation.
-
612: Verify that sub-recipes and products are created before referencing them, or include sub-recipes in the same batch request.
-
613: Products are write-protected — only the product endpoints may change them. Reference a product from a recipe with
type: "products"rather than redefining it under the same id. -
670: Ensure sub-recipes contain at least one ingredient before referencing them.
-
671-680: These indicate calculation engine issues. Check that ingredient declarations are properly formatted and use standard units.