Assign a store to a property
Assigns a storefront scope's orders to a property, so the property's reports and purchase tracking use that store.
POST /companies/{companyId}/tracking/scopes/{scopeId}/property-assignments
Scope setup · Access Changes data · Operation id tracking.assign_property
Try it
productmetrics runs after productmetrics login; curl needs PM_TOKEN (see Authentication). Set $COMPANY_ID, $SCOPE_ID first.
productmetrics tracking assign-property \
--company-id $COMPANY_ID \
--scope-id $SCOPE_ID \
--installation-id 6f1c2a7e-3b4d-4e8f-9a01-2c3d4e5f6a7b \
--property-id 8c1f4d2e-7a3b-4c5d-9e6f-0a1b2c3d4e5f \
--jsonResponse
API response (200):
{
"data": {
"assignment_id": "6f1c2a7e-3b4d-4e8f-9a01-2c3d4e5f6a7b",
"company_id": "2a7d9b3c-1e4f-4a5b-8c6d-7e8f9a0b1c2d",
"domain_installation_id": "6f1c2a7e-3b4d-4e8f-9a01-2c3d4e5f6a7b",
"storefront_scope_id": "6f1c2a7e-3b4d-4e8f-9a01-2c3d4e5f6a7b",
"property_id": "8c1f4d2e-7a3b-4c5d-9e6f-0a1b2c3d4e5f",
"enabled": true,
"changed": true,
"publication_changed": true,
"desired_revision": 0,
"status": "tracking_setup_required",
"setup_reason": "connection_not_found",
"promoted_property_link_id": null
},
"request_id": "req_01J84NRXBKG78514J75F6YE5Q1"
}CLI output: productmetrics tracking assign-property --json prints { "ok": true, "data": …, "request_id": "…" } with the same data.
Before you call
Needs editor or admin access. Answers tracking_ready, or tracking_setup_required with the setup_reason still to fix. installationId and the scope id come from tracking.get_configuration.
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. |
propertyId | string | Yes | The property id, from productmetrics whoami or properties.list (property_id). |
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_01J5XGGYT3CRR47JY09DCNMWKW"
}| 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. |
| 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. |