Recipes
Recipe — follow a region and re-price when the market moves
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.
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.
Every JSON example is abridged and illustrative — your values differ.
Prerequisites
- An API key with scopes
parts:readandparts: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 asAuthorization: Bearer(addX-Org-Slugif the user belongs to several organizations). - A part revision to price (
PART_REVISION_ID). - Optionally, an HTTPS endpoint for webhooks.
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.
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}'
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"])
[
{
"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.
curl -s "$API/regions/DE/drivers?drivers=labour.eur_per_h,energy.electricity.eur_per_kwh" \
-H "X-API-Key: $ARCNM_API_KEY"
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"])
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.
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"}}'
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"])
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). 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.
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)
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"]
Poll GET /calculations/{CALC_ID} until status is succeeded
(or failed, cancelled, timed_out), as in
Quote a part. The result says what it assumed:
{
"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:
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"]}'
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()
Subscribe your webhook endpoint to environment.version_published and
calculation.reprice_recommended (and calculation.repriced for step 9);
the payloads are in Webhooks.
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:
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"
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"])
{
"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.
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"'"}}'
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)
{
"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)
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": []}'
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()
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.
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)
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
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.
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}]}'
diff = api.get(f"/calculations/{calc_id}/diff/{new_id}").json()
for line in diff["lines"]:
print(line["line"], line["delta"], line["moved_assumptions"])
Variations
- Pin a version for a quote basis. Follow with
{"policy": "pinned", "version_id": "…"}, or switch an existing follow withPUT /environments/{ENV_ID}/subscription(owner or admin). - Freeze your own quote basis.
POST /environments/{ENV_ID}/versionswith alabelfreezes your environment's configuration as a version (owner or admin); two of your versions state the same assumptions when theircontent_hashis equal. - Re-price many at once.
POST /calculations/repricetakes up to 200calculation_ids, or thealert_delivery_idof an alert whose calculations you want re-priced. - Another delivery destination.
GET /calculations/{id}/landed-cost?destination_region=DE-BWis a free what-if of the landed cost delivered somewhere else — a destination alone, or withorigin_region,incotermandmode; orlogistics_profile_id=…for a saved profile — nothing is saved, andprofile.sourcesays which applied; see Landed cost. From an agent:get_landed_cost. - Where would it be cheaper?
GET /calculations/{id}/regional-screenrelocates the calculation's cost shares over every priced region and ranks them, estimated — readrelocated_shareandmeasured_error_p90_pctbefore 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-01lists 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_repriceandget_landed_costin the opt-inregionaltoolset (sendX-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.
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 |
429 |
Rate limit | Back off as in Rate limits |
The full catalogue is Errors.