Skip to main content

createSKUPattern

Requires permission products:product:update.

Creates a SKU pattern, optionally scoped to a brand or category. Any brand or category named must belong to the organization. Needs the products update permission.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation CreateSKUPattern($createSKUPatternInput: CreateSKUPatternInput!) {
createSKUPattern(createSKUPatternInput: $createSKUPatternInput) {
id
name
createdAt
brandId
categoryId
deletedAt
brand {
id
code
name
createdAt
deletedAt
deletedBy
}
}
}

Variables:

{
"createSKUPatternInput": {
"isActive": true,
"name": "string",
"pattern": "string",
"priority": 0,
"sequenceLength": 0
}
}

Response:

{
"data": {
"createSKUPattern": {
"id": "id",
"name": "string",
"createdAt": "2025-01-15T00:00:00Z",
"brandId": "id",
"categoryId": "id",
"deletedAt": "2025-01-15T00:00:00Z",
"brand": {
"id": "id",
"code": "string",
"name": "string",
"createdAt": "2025-01-15T00:00:00Z",
"deletedAt": "2025-01-15T00:00:00Z",
"deletedBy": "string"
}
}
}
}
createSKUPattern(
createSKUPatternInput: CreateSKUPatternInput!
): SKUPattern!

Arguments​

createSKUPattern.createSKUPatternInput ● CreateSKUPatternInput! non-null input​

The pattern's name, pattern text, priority, sequence length, optional brand and category, and active state.

Type​

SKUPattern object​

A rule that builds SKUs from placeholders such as brand, category and a running number.