# ProductRelation

object type

A product relation — a TYPED, DIRECTED, RANKED suggestion edge between two Products (alternative | replacement | accessory | upsell | cross-sell — canned, AT-extensible). Parent = the SOURCE Product (relations die with their source); the TARGET is gate-protected from doom while suggested. Directed by design — symmetric intent = create both directions. Relation identity (source x target x relationType) is unique (a live duplicate is CONFLICT/IDENTITY_TAKEN naming the holder; a doomed one is taken over). Variant-level matching is DERIVED at read time — a later read-side slice.

## Fields

| Field | Type | Notes |
| --- | --- | --- |
| `id` | [ID](/types/#scalars) `ID!` | The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it. |
| `sysId` | [String](/types/#scalars) `String!` | The group-scoped human-facing system id (PR-…). |
| `type` | [String](/types/#scalars) `String!` | The kind of record — always `ProductRelation` here. |
| `caption` | [String](/types/#scalars) `String!` | The record’s display name — what people see it called. |
| `status` | [String](/types/#scalars) `String!` | The FSM state: active \| inactive \| doomed. |
| `parentId` | [ID](/types/#scalars) `ID!` | The parent SOURCE Product; for a ProductRelation parentId!== rootId. |
| `rootId` | [ID](/types/#scalars) `ID!` | The org-group family root. |
| `createdAt` | [String](/types/#scalars) `String!` | When the record was created, as a UTC timestamp. |
| `updatedAt` | [String](/types/#scalars) `String!` | When the record last changed, as a UTC timestamp. |
| `revisionNum` | [Int](/types/#scalars) `Int!` | How many times this record has been edited; the first save is 0. |
| `revision` | [ID](/types/#scalars) `ID!` | The OCC revision token — supply it on every mutation of this record; rotates on every write. |
| `refCaptions` | [RefCaption](/types/RefCaption/) `[RefCaption!]!` | The server-composed captions of this record's declared references (the referenced-caption rule) — one row per referenced id; see RefCaption. |
| `targetProductId` | [ID](/types/#scalars) `ID!` | The suggested TARGET Product — set at creation, IMMUTABLE thereafter. |
| `relationType` | [String](/types/#scalars) `String!` | The canned relation type — set at creation, IMMUTABLE thereafter. |
| `ordinal` | [Int](/types/#scalars) `Int!` | The suggestion rank. Mutable — reordering is an ordinary edit. |

## Used by

- [createProductRelation](/reference/product-relation/createProductRelation/)
- [deactivateProductRelation](/reference/product-relation/deactivateProductRelation/)
- [doomProductRelation](/reference/product-relation/doomProductRelation/)
- [productRelation](/reference/product-relation/productRelation/)
- [reactivateProductRelation](/reference/product-relation/reactivateProductRelation/)
- [updateProductRelation](/reference/product-relation/updateProductRelation/)
