Organize the catalog into categories and collections
Give the catalog its shape — a tree of categories to browse by, curated collections to merchandise with, and the links between products that belong together — so people, storefronts and agents find things the same way.
Catalog · a play in 4 steps.
The steps
- Add the branch of the product tree the items belong under. — createCategory
- Name a curated set — a theme, a season, a promotion shelf. — createCollection
- Pin the products into the collection, in the order you want them seen. — createCollectionMember
- Link products that belong together — goes with, replaces, upsell. — createProductRelation
The calls
Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.
createCategory
createCategory — mutation · Create a new category — the product tree’s branches at your organization.
Example request
mutation ExampleCreateCategory($input: NewCategoryInput!) {
createCategory(input: $input) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
treeParent
merchandiseDivisionId
code
}
}
Variables:
{
"input": {
"caption": "Blue jeans"
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"createCategory": {
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "CT-EXMP-0000-000F",
"type": "Category",
"caption": "Blue jeans",
"status": "active",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-b7960e180000",
"treeParent": "01900000-0000-7000-8000-e095a88d0000",
"merchandiseDivisionId": "01900000-0000-7000-8000-7ab1ed960000",
"code": "BJ-001"
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
createCollection
createCollection — mutation · Create a new collection — a curated or rule-driven product set at your organization.
Example request
mutation ExampleCreateCollection($input: NewCollectionInput!) {
createCollection(input: $input) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
collectionType
excludedProductIds
sortMode
code
}
}
Variables:
{
"input": {
"caption": "Blue jeans",
"collectionType": "static"
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"createCollection": {
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "CL-EXMP-0000-000F",
"type": "Collection",
"caption": "Blue jeans",
"status": "active",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-b7960e180000",
"collectionType": "static",
"excludedProductIds": [
"01900000-0000-7000-8000-ae8f24380000"
],
"sortMode": "<sort mode>",
"code": "BJ-001"
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
createCollectionMember
createCollectionMember — mutation · Create a new one product pinned into a collection at your organization.
Example request
mutation ExampleCreateCollectionMember($input: NewCollectionMemberInput!) {
createCollectionMember(input: $input) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
productId
ordinal
}
}
Variables:
{
"input": {
"caption": "Blue jeans",
"collectionId": "01900000-0000-7000-8000-8d2b0a040000",
"productId": "01900000-0000-7000-8000-969657010000"
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"createCollectionMember": {
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "CM-EXMP-0000-000F",
"type": "CollectionMember",
"caption": "Blue jeans",
"status": "active",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-b7960e180000",
"productId": "01900000-0000-7000-8000-969657010000",
"ordinal": 1
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}
createProductRelation
createProductRelation — mutation · Create a new product relationship — “goes with”, “replaces”, “upsell” links between products at your organization.
Example request
mutation ExampleCreateProductRelation($input: NewProductRelationInput!) {
createProductRelation(input: $input) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
targetProductId
relationType
ordinal
}
}
Variables:
{
"input": {
"caption": "Blue jeans",
"sourceProductId": "01900000-0000-7000-8000-d0b0862a0000",
"targetProductId": "01900000-0000-7000-8000-5fc8acba0000",
"relationType": "<relation type>"
}
}
Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"createProductRelation": {
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "PR-EXMP-0000-000F",
"type": "ProductRelation",
"caption": "Blue jeans",
"status": "active",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-b7960e180000",
"targetProductId": "01900000-0000-7000-8000-5fc8acba0000",
"relationType": "<relation type>",
"ordinal": 1
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}