> ## Documentation Index
> Fetch the complete documentation index at: https://85b42a7-productmetrics.manicule.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://85b42a7-productmetrics.manicule.dev/docs/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://85b42a7-productmetrics.manicule.dev/docs/api/mcp.
> Every agent surface: https://85b42a7-productmetrics.manicule.dev/docs/.well-known/llms-manifest.json

# Set a store's countries and currencies (/docs/api/stores-and-tracking/tracking-update-scope-dimensions)

<!-- agent-signals: reading_time_min: 4 · est_tokens: 2207 · updated: 2026-11-16 -->
Related: [Connect a store](/docs/api/stores-and-tracking/stores-connect.md), [New WooCommerce setup token](/docs/api/stores-and-tracking/stores-create-woocommerce-setup-claim.md), [Choose the store platform](/docs/api/stores-and-tracking/stores-select-platform.md), [Assign a store to a property](/docs/api/stores-and-tracking/tracking-assign-property.md), [Track a website](/docs/api/stores-and-tracking/tracking-create-website-installation.md), [Get store connections](/docs/api/stores-and-tracking/tracking-get-commerce-configuration.md)

> Sets which countries, currencies, languages and URL path prefixes one storefront scope of an installation covers.

`PUT https://prod-backend.productmetrics.io/api/public/v1/companies/{companyId}/tracking/scopes/{scopeId}/dimensions`

**Scope** `setup` · **Access** Changes data · **Operation id** `tracking.update_scope_dimensions`

## Try it

`productmetrics` runs after `productmetrics login`; curl needs `PM_TOKEN` (see [Authentication](/docs/api/overview#authentication)). Set `$COMPANY_ID`, `$SCOPE_ID` first.



**productmetrics CLI:**

```bash
productmetrics tracking update-scope-dimensions \
  --company-id $COMPANY_ID \
  --scope-id $SCOPE_ID \
  --installation-id 6f1c2a7e-3b4d-4e8f-9a01-2c3d4e5f6a7b \
  --country-codes NL \
  --path-prefixes / \
  --locale-codes nl-NL \
  --currency-codes EUR \
  --json
```

**curl:**

```bash
curl -X PUT "https://prod-backend.productmetrics.io/api/public/v1/companies/$COMPANY_ID/tracking/scopes/$SCOPE_ID/dimensions" \
  -H "Authorization: Bearer $PM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "installationId": "6f1c2a7e-3b4d-4e8f-9a01-2c3d4e5f6a7b",
    "countryCodes": [
      "NL"
    ],
    "pathPrefixes": [
      "/"
    ],
    "localeCodes": [
      "nl-NL"
    ],
    "currencyCodes": [
      "EUR"
    ]
  }'
```

## Response

API response (200):

```json
{
  "data": {
    "storefront_scope_id": "6f1c2a7e-3b4d-4e8f-9a01-2c3d4e5f6a7b",
    "desired_revision": 1,
    "changed": true
  },
  "request_id": "req_01JG30WEXFE6NRRFCFD91DKZJN"
}
```

**CLI output:** `productmetrics tracking update-scope-dimensions --json` prints `{ "ok": true, "data": …, "request_id": "…" }` with the same `data`.

## Before you call

A store's default scope (`isDefault: true`) covers every page that no other scope claims: it takes no paths and at most one country, one language and one currency (the market the store sells in; 400 `invalid_scope_dimensions` otherwise). `countryCodes` (ISO 3166-1 alpha-2, e.g. NL) and `currencyCodes` (ISO 4217, e.g. EUR) are what that scope sells in; a property whose scopes each have exactly one of each gets Product Metrics' default margin costs for that market ([`tracking.get_configuration`](/docs/api/stores-and-tracking/tracking-get-configuration) `marginDefaultCatalog`), which [`tracking.update_margin_policy`](/docs/api/stores-and-tracking/tracking-update-margin-policy) builds on. `localeCodes` (e.g. nl or nl-NL) and `pathPrefixes` (e.g. /nl/) split one website into several scopes. Every field replaces the stored value, so read the scope first ([`tracking.get_configuration`](/docs/api/stores-and-tracking/tracking-get-configuration) `scopes[]`: its `installationId` and current values), change only what the person asked for, and send all four back. Ask the person which countries and currency the store sells in; never guess them. Needs editor or admin access. Answers the scope id, the configuration's new `desired_revision` and `changed`.

## Path parameters

| Name        | Type          | Description                                                                                                                                                                                                                     |
| ----------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `companyId` | string (uuid) | Your workspace id, from `productmetrics whoami` or [`properties.list`](/docs/api/account/properties-list) (`company_id`).                                                                                                            |
| `scopeId`   | string (uuid) | The tracking scope: its `id` from [`tracking.get_commerce_configuration`](/docs/api/stores-and-tracking/tracking-get-commerce-configuration) or [`tracking.get_configuration`](/docs/api/stores-and-tracking/tracking-get-configuration). |

## Body

| Name             | Type            | Required | Description                                                                                                                                                                                                                                    |
| ---------------- | --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `installationId` | string (uuid)   | Yes      | The tracking installation: `installationId` from [`tracking.get_commerce_configuration`](/docs/api/stores-and-tracking/tracking-get-commerce-configuration) or [`tracking.get_configuration`](/docs/api/stores-and-tracking/tracking-get-configuration). |
| `countryCodes`   | array of string | Yes      | `countryCodes` (ISO 3166-1 alpha-2, e.g. Up to 50 items.                                                                                                                                                                                       |
| `pathPrefixes`   | array of string | Yes      | `localeCodes` (e.g. nl or nl-NL) and `pathPrefixes` (e.g. /nl/) split one website into several scopes. Up to 50 items.                                                                                                                         |
| `localeCodes`    | array of string | Yes      | `localeCodes` (e.g. nl or nl-NL) and `pathPrefixes` (e.g. /nl/) split one website into several scopes. Up to 50 items.                                                                                                                         |
| `currencyCodes`  | array of string | Yes      | NL) and `currencyCodes` (ISO 4217, e.g. Up to 50 items.                                                                                                                                                                                        |

## Errors

A failure answers with its HTTP status and `{ error: { code, message, details? }, request_id }`. Branch on `code` (stable, lower_snake); show `message` to the person. The CLI prints the same `error` with `"ok": false`.

```json
{
  "error": {
    "code": "insufficient_scope",
    "message": "This operation needs the setup scope; connect again and allow it.",
    "details": {
      "required_scope": "setup"
    }
  },
  "request_id": "req_01JBER0DD9FEX11RRF9BNCYQ2N"
}
```

| Status | Code                       | When                                                                                                                                                                                                                                          |
| ------ | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400    | `invalid_request`          | A path, query or body value does not match this page. `details.issues` lists each `location`, `path` and `message`.                                                                                                                           |
| 400    | `invalid_scope_dimensions` | A store's default scope (`isDefault: true`) covers every page that no other scope claims: it takes no paths and at most one country, one language and one currency (the market the store sells in; 400 `invalid_scope_dimensions` otherwise). |
| 401    | `invalid_token`            | The token is missing, expired or revoked: sign in again (`productmetrics login`). The `WWW-Authenticate` header says why.                                                                                                                     |
| 403    | `insufficient_scope`       | The token lacks the `setup` scope (`details.required_scope`): sign in again and allow it.                                                                                                                                                     |
| 404    | `not_found`                | An id in the path does not exist, or the signed-in person cannot open it.                                                                                                                                                                     |
| 429    | `rate_limited`             | More than 600 requests a minute for this person: wait the `Retry-After` seconds (60) and retry.                                                                                                                                               |

[All Stores and tracking operations](/docs/api/stores-and-tracking)
