Skip to main content

getAttributes

Get all attribute sets and their total count.

Description​

Resolves to an IAttributesSetsResponse: the attribute sets plus their total count, which you can use for pagination. An online store, for example, might keep one attribute set for clothing (size, color, material) and another for electronics.

The attribute set doesn't include attribute values; those live on specific entities such as pages and products. The only exception is the timeInterval attribute type, which can carry values when the corresponding box is checked in the admin panel (opens in a new tab).

.getAttributes(

, , , ,

);

Parameters schema​

Schema

langCode: string
Language code. Default: the langCode passed to defineOneEntry ("en_US" if none).
example: "en_US"

offset: number
Number of records to skip. Default: 0. offset + limit must not exceed 200; a larger window is rejected with 400.
example: 0

limit: number
Maximum number of records to return. Default: 30.
example: 30

typeId: number
ID of the attribute set type to filter by. Default: null.

sortBy: string
Field to sort by: id or position. Default: "id".
example: "id"

Record limit. If the user group's permission for this method allows only restricted reading, the API returns at most the number of records set in the project settings (10 by default), whatever limit you pass. With full read access, limit works as usual. See Module permissions (opens in a new tab).
While this cap is in effect, the API currently ignores offset: every request returns the first records again.

Examples​

Minimal example​

const response = await AttributesSets.getAttributes();

Example with all parameters​

const response = await AttributesSets.getAttributes('en_US', 0, 30, null, 'id');

Example response​

{
"total": 21,
"items": [
{
"id": 38,
"createdDate": "2026-06-09T06:06:13.667Z",
"updatedDate": "2026-06-09T06:12:00.790Z",
"version": 0,
"identifier": "subscription",
"title": "Subscription",
"schema": {
"price": {
"id": 2,
"type": "integer",
"isPrice": true,
"original": true,
"isVisible": true,
"splitUnit": "percent",
"identifier": "price",
"isCurrency": false,
"splitPrice": false,
"initialValue": null,
"localizeInfos": {
"title": "price"
},
"value": null
},
"currency_products": {
"id": 4,
"type": "string",
"isPrice": false,
"original": true,
"isVisible": true,
"splitUnit": false,
"identifier": "currency_products",
"isCurrency": true,
"splitPrice": false,
"validators": {
"defaultValueValidator": {
"customErrorText": "Custom error",
"fieldDefaultValue": "usd",
"fieldDefaultValue2": ""
}
},
"initialValue": null,
"localizeInfos": {
"title": "Currency"
}
}
},
"isVisible": true,
"type": {
"id": 5,
"type": "forProducts"
},
"position": 1
},
{
"id": 33,
"createdDate": "2026-04-22T16:28:05.346Z",
"updatedDate": "2026-04-23T10:57:26.245Z",
"version": 1,
"identifier": "percent_split",
"title": "Percent split",
"schema": {
"s0": {
"id": 1,
"type": "float",
"isPrice": true,
"original": true,
"isVisible": true,
"splitUnit": "percent",
"identifier": "s0",
"splitParts": [
2,
3
],
"splitPrice": true,
"localizeInfos": {
"title": "s0"
},
"value": null
},
"s1": {
"id": 2,
"type": "float",
"isPrice": false,
"original": true,
"isVisible": true,
"splitUnit": false,
"identifier": "s1",
"splitParts": false,
"splitPrice": false,
"localizeInfos": {
"title": "s1"
},
"value": null
},
"s2": {
"id": 3,
"type": "float",
"isPrice": false,
"original": true,
"isVisible": true,
"splitUnit": false,
"identifier": "s2",
"splitParts": false,
"localizeInfos": {
"title": "s2"
},
"value": null
},
"currency": {
"id": 4,
"type": "string",
"isPrice": false,
"original": true,
"isVisible": true,
"splitUnit": false,
"identifier": "currency",
"isCurrency": true,
"validators": {
"defaultValueValidator": {
"fieldDefaultValue": "usd",
"fieldDefaultValue2": ""
}
},
"localizeInfos": {
"title": "currency"
}
}
},
"isVisible": true,
"type": {
"id": 5,
"type": "forProducts"
},
"position": 2
},
{
"id": 31,
"createdDate": "2026-03-14T14:53:28.721Z",
"updatedDate": "2026-03-14T14:53:52.760Z",
"version": 0,
"identifier": "discounts",
"title": "Discounts",
"schema": {
"example_discount": {
"id": 1,
"type": "string",
"original": true,
"isVisible": true,
"identifier": "example_discount",
"localizeInfos": {
"title": "example_discount"
}
}
},
"isVisible": true,
"type": {
"id": 11,
"type": "forDiscounts"
},
"position": 3
}
]
}

Response schema​

Schema: IAttributesSetsResponse

total: number
Total number of attribute sets.
example: 100

items: IAttributeSetsEntity[]
Attribute sets in this response.
example:

[
{
"id": 1,
"identifier": "set1"
},
{
"id": 2,
"identifier": "set2"
}
]

items.id: number
ID of the attribute set.
example: 123

items.createdDate: string
Creation date of the attribute set.
example: "2023-10-01T12:00:00Z"

items.updatedDate: string
Date the attribute set was last updated.
example: "2023-10-01T12:00:00Z"

items.version: number
Version number of the attribute set; changes with each update.
example: 1

items.identifier: string
Marker of the attribute set.
example: "attributeSet1"

items.title: string
Name of the attribute set.
example: "Product Attributes"

items.schema: Record<string, IAttributeSchemaItem>
Schema fields keyed by marker.
example:

{
"attribute1": {
"id": 1,
"type": "string",
"isPrice": false,
"original": true,
"identifier": "string",
"localizeInfos": {
"en_US": {
"title": "String"
}
}
}
}

items.isVisible: boolean
Whether the attribute set is visible.
example: true

items.type: string
Type of the attribute set.
example: "product"

items.position: number
1-based index of the set in the response (1 for a single set).
example: 1