Skip to main content
POST
Customization
Many restaurants offer customizable dishes—build-your-own bowls, salads, pizzas, and more. When guests toggle ingredients on and off, they expect the nutrition panel and allergen warnings to update in real-time.
Dish customization interface showing ingredient toggles on the left and a nutrition panel on the right that updates as selections change

Dish customization with real-time nutrition calculator

EveryBite provides two approaches for handling this:
Send the user’s selections to our API and receive calculated nutrition and allergens. This is the recommended approach because:
  • No math required — We handle the calculations
  • Always accurate — Allergen and nutrition logic updates automatically
  • Consistent — Same results across all platforms using your integration

Get Customization Options

First, fetch the available ingredients for a customizable dish:

Calculate Nutrition for Selections

As the user toggles ingredients on and off, call the calculate query:

Input

Parameters

Example

Performance Tips

The calculate endpoint is optimized for real-time use, but if you’re calling it on every toggle:
Debounce your requests. Wait 200-300ms after the user stops making changes before calling the API. This prevents unnecessary calls while they’re rapidly selecting options.
Example debounce pattern (JavaScript):

Approach 2: Client-Side Calculation (Advanced)

For applications that need offline support or want full control over the calculation, you can request complete nutrition data for each customization option and calculate totals yourself.
With this approach, you’re responsible for:
  • Implementing nutrition summation logic
  • Handling allergen aggregation (including cross-contamination rules)
  • Determining dietary flag qualification
  • Updating your logic when our data model changes

Request Full Option Data

Calculation Rules

If you implement client-side calculation, follow these rules:

Nutrition

Sum the values from all selected options plus the base nutrition (if any):

Allergens

Combine allergens from all selected options, deduplicating by type:

Dietary Flags

A dish qualifies for a dietary flag only if all selected options qualify:
Dietary flag logic can be more complex than simple intersection. For example, a dish might be “vegan” only if it contains no animal products AND meets certain preparation requirements. The calculate endpoint handles these nuances automatically.

Which Approach Should I Use?

Use Calculate Endpoint

  • Building a web or mobile app with connectivity
  • Want simplest integration path
  • Need guaranteed accuracy for allergen/dietary info
  • Don’t want to maintain calculation logic

Use Client-Side Calculation

  • Building an offline-first application
  • Need instant updates without any network latency
  • Have specific UX requirements that need full control
  • Willing to maintain calculation logic
Most developers choose the calculate endpoint. It’s simpler to implement and ensures your users always see accurate information, even as our nutrition data and dietary classification rules evolve.

Response Types

CustomizationGroup

A modifier group associated with a customizable dish (e.g. “Choose your sauce”).

CustomizationOption

A single selectable option within a customization group.

Ingredient

CalculatedNutrition

CalculateResult