Set a store's countries and currencies
Sets which countries, currencies, languages and URL path prefixes one storefront scope of an installation covers.
PUT /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). Set $COMPANY_ID, $SCOPE_ID first.
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 \
--jsonResponse
API response (200):
{
"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 marginDefaultCatalog), which 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 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 (company_id). |
scopeId | string (uuid) | The tracking scope: its id from tracking.get_commerce_configuration or tracking.get_configuration. |
Body
| Name | Type | Required | Description |
|---|---|---|---|
installationId | string (uuid) | Yes | The tracking installation: installationId from tracking.get_commerce_configuration or 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.
{
"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. |