# Your product ids and nutrition figures

> Map your own SKUs to the restaurant's dishes, sizes and options so cart lines and webhooks name your products, and send nutrition figures for the dishes Tamr has none for.

Source: https://tamr.link/docs/guides/product-ids-and-nutrition

When the restaurant's dishes carry your ids, every cart line and webhook names your products directly. And when your catalog has nutrition figures the restaurant never typed into Tamr, you can send them so the waiter can answer calorie and protein questions. Both need a secret key with the `catalog:sdk` permission.

## Your ids

Set them in the dashboard (**Settings > External ids**, by hand or with the CSV it downloads), or from your backend with [Set your product ids](https://tamr.link/docs/api/set-external-ids), up to 500 at a time:

PUT /api/v1/catalog/external-ids:

```json
{
  "refs": [
    {
      "kind": "dish",
      "tamrId": "dish_kafta",
      "externalId": "SKU-1042"
    },
    {
      "kind": "variant",
      "tamrId": "var_large",
      "externalId": "BOWL-L",
      "branch": "achrafieh"
    },
    {
      "kind": "option",
      "tamrId": "opt_rice",
      "externalId": null
    }
  ]
}
```

- `kind` is `dish`, `variant` (a size) or `option`. `externalId: null` removes a mapping.
- `branch` makes the id apply at that branch only, over the chain-wide one, for chains whose products differ per branch.
- Tamr's ids are in the CSV the External ids page downloads, and in [Get the menu](https://tamr.link/docs/api/get-menu). Tamr keeps them stable through renames and re-imports.
- An unmapped dish is still recommended and proposed, with `externalId: null`. Your app decides what to do with it.
- The call is all or nothing: a refused call is a 400 whose `data.rows` gives each bad row's `index` and `reason`.

## Your nutrition figures

[Set nutrition figures](https://tamr.link/docs/api/set-nutrition) fills the figures the restaurant left empty in Tamr, per serving: `calories` (0 to 10,000), and `proteinGrams`, `carbsGrams` and `fatGrams` (0 to 2,000 each), by Tamr's `dishId` or your `externalId`.

PUT /api/v1/catalog/nutrition:

```json
{
  "dishes": [
    {
      "externalId": "SKU-1042",
      "calories": 640,
      "proteinGrams": 42
    },
    {
      "dishId": "cmdish0001",
      "carbsGrams": 18,
      "fatGrams": null
    }
  ]
}
```

- A field left out is unchanged, and `null` removes your figure.
- Up to 500 rows, all or nothing: a refused call is a 400 whose `data.rows` gives each bad row's `reason` (`unknown_dish`, `unknown_external_id`, `out_of_range`, `duplicate`).
- The answer, `{ "updated": n }`, counts the dishes that changed, so a repeat answers 0.
- **Your figures only fill gaps.** A figure the restaurant typed in Tamr always wins, and Tamr never estimates one. Once set, they read like the restaurant's own everywhere: the waiter, the QR menu, the menu route and the cards.
- On a dish whose options carry their own figures, yours are the dish's part without choices, as the restaurant's own would be.
