> ## Documentation Index
> Fetch the complete documentation index at: https://6f524b4-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://6f524b4-productmetrics.manicule.dev/docs/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://6f524b4-productmetrics.manicule.dev/docs/api/mcp.
> Every agent surface: https://6f524b4-productmetrics.manicule.dev/docs/.well-known/llms-manifest.json

# Assign a store to a property (/docs/api/stores-and-tracking/tracking-assign-property)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 1526 · 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), [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), [Get tracking configuration](/docs/api/stores-and-tracking/tracking-get-configuration.md)

> Assigns a storefront scope's orders to a property, so the property's reports and purchase tracking use that store.

`POST https://prod-backend.productmetrics.io/api/public/v1/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](/docs/api/overview#authentication)). Set `$COMPANY_ID`, `$SCOPE_ID` first.



**productmetrics CLI:**

```bash
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 \
  --json
```

**curl:**

```bash
curl -X POST "https://prod-backend.productmetrics.io/api/public/v1/companies/$COMPANY_ID/tracking/scopes/$SCOPE_ID/property-assignments" \
  -H "Authorization: Bearer $PM_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "installationId": "6f1c2a7e-3b4d-4e8f-9a01-2c3d4e5f6a7b",
    "propertyId": "8c1f4d2e-7a3b-4c5d-9e6f-0a1b2c3d4e5f"
  }'
```

## Response

API response (200):

```json
{
  "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`](/docs/api/stores-and-tracking/tracking-get-configuration).

## 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). |
| `propertyId`     | string        | Yes      | The property id, from `productmetrics whoami` or [`properties.list`](/docs/api/account/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`.

```json
{
  "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.                           |

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