---
title: Recipe — follow a region and re-price when the market moves
description: Install an available environment for your cost region, quote with a costing date, get told when it moves, estimate the change for free, then apply and re-price.
---

# Recipe: follow a region and re-price when the market moves

Price your parts on the platform's figures for your cost region instead
of typing them in, and keep those prices honest as the market moves. This
recipe finds an available environment for your region, installs and follows it, quotes
with a costing date, subscribes to the news, estimates what a new version
would change before you spend anything, then applies it and re-prices.
The concepts behind each step are in
[Costing environments, versions and costing dates](../concepts/costing-environments-and-versions.md).

Every JSON example is abridged and **illustrative — your values differ**.

---

## Prerequisites

- An API key with scopes `parts:read` and `parts:write` — reads, quotes,
  estimates, re-prices and alert rules.
- An **owner or admin** of your organization for the two follow writes
  (step 3 and step 8). They are refused to API keys (`403 forbidden`): do
  them in the app (**Environments → Install**, and the
  environment's **Upstream** tab), or through the API with that user's
  session token as `Authorization: Bearer` (add `X-Org-Slug` if the user
  belongs to several organizations).
- A part revision to price (`PART_REVISION_ID`).
- Optionally, an HTTPS endpoint for [webhooks](../webhooks.md).

```bash
export ARCNM_API_KEY="ak_live_…"
export OWNER_TOKEN="…"          # an owner's or admin's session token (steps 3 and 8)
export PART_REVISION_ID="…"
API=https://api.arcnm.io/api/v1
```

---

## Step 1 — Find the available environment for your region

`GET /catalogue/environments?region=…` lists the available environments
priced for a region **or any region beneath it**: `DE` includes `DE-BY`.
The platform publishes one environment per country; a finer region is an
environment you create (and may publish) yourself.
`process_family` keeps the ones whose machines cover a family (repeat it
for several); `q` narrows by name or description. From an agent, the
same read is `find_environments`.

<CodeTabs>

```bash title="cURL"
curl -s "$API/catalogue/environments?region=DE&process_family=milling" -H "X-API-Key: $ARCNM_API_KEY" \
  | jq '.[] | {id, slug, name, region, publisher_kind, evidence_class, current_version, capability_envelope}'
```

```python title="Python"
import os, httpx

api = httpx.Client(
    base_url="https://api.arcnm.io/api/v1",
    headers={"X-API-Key": os.environ["ARCNM_API_KEY"]},
)
listings = api.get(
    "/catalogue/environments", params={"region": "DE", "process_family": "milling"}
).json()
for env in listings:
    print(env["id"], env["slug"], env["region"], env["current_version"]["label"])
```

</CodeTabs>

```json
[
  {
    "id": "0b6e…",
    "slug": "arcnm-de",
    "name": "Germany",
    "region": "DE",
    "currency": "EUR",
    "publisher_kind": "platform",
    "evidence_class": "platform_curated",
    "licence": "platform_terms",
    "update_cadence": "monthly",
    "freshness": "current",
    "current_version": {"id": "5c1d…", "label": "2026.09", "content_hash": "…"},
    "channels": [{"channel": "latest", "version_label": "2026.09"}],
    "capability_envelope": {"process_families": ["milling", "turning"]}
  }
]
```

Keep the listing's `id` as `UPSTREAM_ID` (the `slug` addresses the same
listing on `GET /catalogue/environments/{ref}`).

---

## Step 2 — Read what it prices with

`GET /regions/{code}/drivers` answers every cost driver the region
resolves — its own values and the ones it inherits, each naming the
region that answered and whether it is `stale` (past its refresh
deadline: for a value derived from a published statistic, once two prints
of its newest input are missing; for any other, once it is older than
twice its refresh cadence; it still prices). Filter with `drivers`, or ask for
another date with `as_of`. From an agent: `get_region_drivers`.

A value whose licence lets it price but not leave the platform
(`licence_class: "derived_only"` — freight lanes, packaging, lead times)
is listed with its driver, qualifier, the region that answered, its
validity, method and staleness, but with `value`, the band and
`source_summary` set to `null`; an `internal_only` value is not listed at
all. `GET /drivers/{key}/history` lists such a value's versions the same
way, and the agent tool counts them in `withheld`. Your calculations
still price with these values — only the figure stays inside.

<CodeTabs>

```bash title="cURL"
curl -s "$API/regions/DE/drivers?drivers=labour.eur_per_h,energy.electricity.eur_per_kwh" \
  -H "X-API-Key: $ARCNM_API_KEY"
```

```python title="Python"
values = api.get(
    "/regions/DE/drivers",
    params={"drivers": "labour.eur_per_h,energy.electricity.eur_per_kwh"},
).json()
for v in values:
    print(v["driver_key"], v["qualifier"], v["value"], v["unit"], v["answered_by"])
```

</CodeTabs>

What one version of the environment states — its rate rows, machines and
capability envelope — is
`GET /catalogue/environments/{UPSTREAM_ID}/versions/{label}`.

---

## Step 3 — Install it (owner or admin)

`POST /environments/from-catalogue` installs it: it creates an environment
of your own that follows the available environment. `track_channel` on `latest`
tracks the monthly releases — each arrives as a pending version for you to
apply (step 8); `pinned` with a `version_id` stays on one version.

<CodeTabs>

```bash title="cURL"
curl -s -X POST "$API/environments/from-catalogue" \
  -H "Authorization: Bearer $OWNER_TOKEN" -H "Content-Type: application/json" \
  -d '{"upstream_env_id": "'"$UPSTREAM_ID"'", "name": "Germany — our plant",
       "follow": {"policy": "track_channel", "channel": "latest"}}'
```

```python title="Python"
owner = httpx.Client(
    base_url="https://api.arcnm.io/api/v1",
    headers={"Authorization": f"Bearer {os.environ['OWNER_TOKEN']}"},
)
env = owner.post("/environments/from-catalogue", json={
    "upstream_env_id": os.environ["UPSTREAM_ID"],
    "name": "Germany — our plant",
    "follow": {"policy": "track_channel", "channel": "latest"},
}).raise_for_status().json()
print(env["id"], env["subscription"]["applied_version"]["label"])
```

</CodeTabs>

The response (`201`) is the new environment with its `subscription`. It
states no rates of its own and prices on day one from the applied
version; anything you state on it later wins over the followed figures.
The new environment counts against your plan's environment limit
(`402 entitlement_exceeded` when it is full) unless it is the first of its
country: that one takes one of the ARCNM countries your plan prices in
(Free 3, Pro 10, Scale and Enterprise every country), and a new country
past them is `402 entitlement_exceeded` whose `details.feature` names that
limit ([Pricing & billing](../pricing.md#plan-limits)). Keep its `id` as
`ENV_ID`.

---

## Step 4 — Price with a costing date and a policy

Quote as usual, naming the environment, the **costing date** the figures
are read at, and the **assumption policy** a later re-run follows —
`frozen` for a quote you will send.

<CodeTabs>

```bash title="cURL"
CALC_ID=$(curl -s -X POST "$API/calculations/quote" \
  -H "X-API-Key: $ARCNM_API_KEY" -H "Content-Type: application/json" \
  -d '{"part_revision_id": "'"$PART_REVISION_ID"'", "costing_environment_id": "'"$ENV_ID"'",
       "lot_size": 50, "costing_date": "2026-09-01", "assumption_policy": "frozen"}' \
  | jq -r .id)
```

```python title="Python"
calc = api.post("/calculations/quote", json={
    "part_revision_id": os.environ["PART_REVISION_ID"],
    "costing_environment_id": os.environ["ENV_ID"],
    "lot_size": 50,
    "costing_date": "2026-09-01",
    "assumption_policy": "frozen",
}).raise_for_status().json()
calc_id = calc["id"]
```

</CodeTabs>

Poll `GET /calculations/{CALC_ID}` until `status` is `succeeded`
(or `failed`, `cancelled`, `timed_out`), as in
[Quote a part](./quote-a-part.md). The result says what it assumed:

```json
{
  "status": "succeeded",
  "unit_cost": 18.42,
  "costing_date": "2026-09-01",
  "assumption_policy": "frozen",
  "environment_version": {"id": "5c1d…", "label": "2026.09", "content_hash": "3f9a0c…"},
  "reference_freshness": {"oldest_valid_from": "2026-07-01", "stale": false}
}
```

A future `costing_date` is `422 costing_date_in_future`.

---

## Step 5 — Get told when it moves

News reaches you through **alert rules** (`/alerts/rules`). Your
organization's first follow ever creates default rules when it has none —
new versions of followed environments and cost-impact moves as weekly
digests, and an immediate alert for a significant move on a frozen quote;
defaults you deleted are not re-created by a later install. A new version
reaches a follow only when it changes what that follow applied. Add your
own, and add `webhook` to `channels` to receive them at your endpoint:

<CodeTabs>

```bash title="cURL"
curl -s -X POST "$API/alerts/rules" -H "X-API-Key: $ARCNM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Germany — new versions", "trigger": "version_published",
       "scope": "environment", "scope_id": "'"$ENV_ID"'",
       "digest": "immediate", "channels": ["in_app", "webhook"]}'

curl -s -X POST "$API/alerts/rules" -H "X-API-Key: $ARCNM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Frozen quotes moved 2 %", "trigger": "cost_impact",
       "threshold_pct": 2, "frozen_only": true, "digest": "daily",
       "channels": ["webhook"]}'
```

```python title="Python"
api.post("/alerts/rules", json={
    "name": "Germany — new versions", "trigger": "version_published",
    "scope": "environment", "scope_id": os.environ["ENV_ID"],
    "digest": "immediate", "channels": ["in_app", "webhook"],
}).raise_for_status()
api.post("/alerts/rules", json={
    "name": "Frozen quotes moved 2 %", "trigger": "cost_impact",
    "threshold_pct": 2, "frozen_only": True, "digest": "daily",
    "channels": ["webhook"],
}).raise_for_status()
```

</CodeTabs>

Subscribe your webhook endpoint to `environment.version_published` and
`calculation.reprice_recommended` (and `calculation.repriced` for step 9);
the payloads are in [Webhooks](../webhooks.md#event-catalog).

---

## Step 6 — Check what changed

When a new version is out, the follow shows it as `pending`, and the
three-way diff says what it would change for you:

<CodeTabs>

```bash title="cURL"
curl -s "$API/environments/$ENV_ID/subscription" -H "X-API-Key: $ARCNM_API_KEY" \
  | jq '{applied: .applied_version.label, pending: .pending, behind: .versions_behind}'
curl -s "$API/environments/$ENV_ID/subscription/diff" -H "X-API-Key: $ARCNM_API_KEY"
```

```python title="Python"
sub = api.get(f"/environments/{os.environ['ENV_ID']}/subscription").json()
diff = api.get(f"/environments/{os.environ['ENV_ID']}/subscription/diff").json()
for row in diff["rows"]:
    print(row["kind"], row["path"], row["upstream_from"], "→", row["upstream_to"])
print("conflicts:", diff["conflicts"])
```

</CodeTabs>

```json
{
  "from_version": {"label": "2026.09"},
  "to_version": {"label": "2026.10"},
  "rows": [
    {"path": "labour_rates[skilled].value", "kind": "upstream_moved_inherited",
     "upstream_from": 47.0, "upstream_to": 48.1, "delta_pct": 2.3}
  ],
  "conflicts": []
}
```

`upstream_moved_inherited` reaches your prices; `upstream_moved_overridden`
is a value you state yourself (no effect); a `conflict` needs a resolution
before you can apply. From an agent, `diff_environments` returns the
same three-way view ranked largest move first.

---

## Step 7 — Estimate before you spend

`POST /calculations/{id}/reprice-preview` estimates, from the
calculation's stored cost shares, what a re-price against the pending
version would move — per lot point, per driver. It prices nothing and
costs nothing; `measured_error_p90_pct` says how far such estimates have
landed from exact prices on the platform's nightly check. From an agent:
`preview_reprice`.

<CodeTabs>

```bash title="cURL"
PENDING=$(curl -s "$API/environments/$ENV_ID/subscription" -H "X-API-Key: $ARCNM_API_KEY" | jq -r .pending.id)
curl -s -X POST "$API/calculations/$CALC_ID/reprice-preview" \
  -H "X-API-Key: $ARCNM_API_KEY" -H "Content-Type: application/json" \
  -d '{"target": {"version_id": "'"$PENDING"'"}}'
```

```python title="Python"
preview = api.post(f"/calculations/{calc_id}/reprice-preview",
                   json={"target": {"version_id": sub["pending"]["id"]}}).json()
for lot, pct in zip(preview["lot_points"], preview["total_delta_pct_by_lot"]):
    print(lot, pct)
```

</CodeTabs>

```json
{
  "estimate": true,
  "basis": "first_order",
  "target": "version",
  "lot_points": [10, 50, 250],
  "unit_cost_by_lot": [24.10, 18.42, 16.95],
  "estimated_unit_cost_by_lot": [24.52, 18.77, 17.27],
  "total_delta_pct_by_lot": [1.7, 1.9, 1.9],
  "measured_error_p90_pct": 1.2
}
```

---

## Step 8 — Apply the new version (owner or admin)

<CodeTabs>

```bash title="cURL"
curl -s -X POST "$API/environments/$ENV_ID/subscription/apply" \
  -H "Authorization: Bearer $OWNER_TOKEN" -H "Content-Type: application/json" \
  -d '{"version_id": "'"$PENDING"'", "resolutions": []}'
```

```python title="Python"
owner.post(f"/environments/{os.environ['ENV_ID']}/subscription/apply", json={
    "version_id": sub["pending"]["id"],
    "resolutions": [],  # one {"path", "resolution"} per conflict
}).raise_for_status()
```

</CodeTabs>

Each conflict needs an entry in `resolutions`: `keep_mine`,
`take_upstream`, or `state_value` with a finite `value` (without one it is
`422`, `details.reason` `resolution_value_required`). Your own statements
are never changed. Changed your mind? `POST /environments/{ENV_ID}/subscription/revert`
restores the previous version within 72 hours and takes back the rows the
update wrote for your `keep_mine` / `state_value` resolutions (a row you
edited since stays).

---

## Step 9 — Re-price

`POST /calculations/{id}/reprice` creates a **new** calculation of the
same part in the same environment; the source never changes. The policy
decides what it reads: `frozen` keeps the version, costing date and
knowledge time of the source; `market_tracking` keeps the version and
prices as of today; `live` prices under the environment's current version
as of today. Name a policy in the body to override the source's. It prices
the geometry the source was priced from — the part is not read again, so
the diff in step 10 attributes every delta to assumptions — and answers
`geometry_by_reference: true` (asked for; the new calculation's
`geometry_origin` says whether the stored reading was used, `by_reference`,
or the part was read again); if the part's files changed since the
source ran it is refused with `422 reprice_inputs_changed` (send
`re_extract: true` to read the new files). A re-price is metered as a
calculation.

<CodeTabs>

```bash title="cURL"
NEW_ID=$(curl -s -X POST "$API/calculations/$CALC_ID/reprice" \
  -H "X-API-Key: $ARCNM_API_KEY" -H "Content-Type: application/json" \
  -d '{"assumption_policy": "live"}' | jq -r .calculation_id)   # the body also says geometry_by_reference: true (asked for)
```

```python title="Python"
new = api.post(f"/calculations/{calc_id}/reprice",
               json={"assumption_policy": "live"}).raise_for_status().json()
new_id = new["calculation_id"]  # links back through repriced_from_calculation_id
```

</CodeTabs>

Poll the new calculation like any other run.

---

## Step 10 — Explain the change

`GET /calculations/{old}/diff/{new}` lists every cost line that moved and
the assumptions behind it — the rates, reference values and currency
pairs each run read, with both values and where each came from.

<CodeTabs>

```bash title="cURL"
curl -s "$API/calculations/$CALC_ID/diff/$NEW_ID" -H "X-API-Key: $ARCNM_API_KEY" \
  | jq '{lines: [.lines[] | {line, delta, delta_pct}], assumptions: [.assumptions[] | {kind, driver_key, from_value, to_value}]}'
```

```python title="Python"
diff = api.get(f"/calculations/{calc_id}/diff/{new_id}").json()
for line in diff["lines"]:
    print(line["line"], line["delta"], line["moved_assumptions"])
```

</CodeTabs>

---

## Variations

- **Pin a version for a quote basis.** Follow with
  `{"policy": "pinned", "version_id": "…"}`, or switch an existing follow
  with `PUT /environments/{ENV_ID}/subscription` (owner or admin).
- **Freeze your own quote basis.** `POST /environments/{ENV_ID}/versions`
  with a `label` freezes your environment's configuration as a version
  (owner or admin); two of your versions state the same assumptions when
  their `content_hash` is equal.
- **Re-price many at once.** `POST /calculations/reprice` takes up to 200
  `calculation_ids`, or the `alert_delivery_id` of an alert whose
  calculations you want re-priced.
- **Another delivery destination.** `GET /calculations/{id}/landed-cost?destination_region=DE-BW`
  is a free what-if of the landed cost delivered somewhere else — a
  destination alone, or with `origin_region`, `incoterm` and `mode`; or
  `logistics_profile_id=…` for a saved profile — nothing is saved, and
  `profile.source` says which applied; see
  [Landed cost](../concepts/landed-cost.md). From an agent:
  `get_landed_cost`.
- **Where would it be cheaper?** `GET /calculations/{id}/regional-screen`
  relocates the calculation's cost shares over every priced region and
  ranks them, estimated — read `relocated_share` and
  `measured_error_p90_pct` before trusting a delta, then re-price in the
  candidate region's environment to confirm.
- **What moved this month?** `GET /market/events?region=DE&since=2026-09-01`
  lists the platform's market events for a region and the regions above
  it — moves, publisher revisions, source outages and new versions of
  available environments.
- **From an agent.** Steps 1, 2, 6 and 7 and the landed-cost what-if are
  the curated tools `find_environments`, `get_region_drivers`,
  `diff_environments`, `preview_reprice` and
  `get_landed_cost` in the opt-in `regional` toolset (send
  `X-MCP-Toolsets: regional`); step 10, the screen and the events are
  generated read-only tools; following, applying and re-pricing stay with
  a person — see [MCP for agents](../mcp.md).

---

## When it fails

| Response | Why | What to do |
|---|---|---|
| `409 conflict`, `error.message` `subscription_conflicts_unresolved` | A conflict in the diff has no resolution | Add one entry per path in `details.conflicts` |
| `409 conflict`, `error.message` `revert_window_closed` | The last apply is more than 72 hours old | Apply the version you want instead |
| `409 nothing_to_revert` | The follow has no earlier applied version to restore | Nothing to undo; apply the version you want |
| `404 not_found`, `error.message` `subscription_not_found` | The environment follows nothing | Use an environment created in step 3 |
| `404 region_unknown` (`422` as a filter or a field) | The region code is not a cost region or an alias of one, in any case | `GET /regions` lists them |
| `422 unprocessable_entity`, `details.reason` `resolution_value_required` | A `state_value` resolution names no finite `value` | Send the value, or choose `keep_mine` / `take_upstream` |
| `422 costing_date_in_future` | The costing date is after today (UTC) | Send today or an earlier date |
| `422 reprice_inputs_changed` | The part's drawing, mesh or RFQ text changed after the source calculation ran (`details.roles`) | Re-price with `re_extract: true`, or quote the part again |
| `422 process_family_unknown` | A `process_family` is not a machine family | `details.known` lists them |
| `403 forbidden` | A follow write with an API key or a member's session | Use an owner's or admin's session, or the app |
| `402 entitlement_exceeded` | The plan's environment limit is reached, or a new country is past the plan's ARCNM countries (`details.feature` names the limit) | See [Pricing & billing](../pricing.md#plan-limits) |
| `429` | Rate limit | Back off as in [Rate limits](../rate-limits.md) |

The full catalogue is [Errors](../errors.md).

---

## See also

- [Costing environments, versions and costing dates](../concepts/costing-environments-and-versions.md)
- [Webhooks](../webhooks.md) · [Errors](../errors.md) · [Rate limits](../rate-limits.md)
- [Recipe: quote a part end-to-end](./quote-a-part.md)
