Appearance
Attributes
Manage product attributes and specifications. Define custom fields, technical specifications, and filterable characteristics for your catalog products with flexible data types and validation rules.
Basic CRUD Actions
Get Attributes listing
View on PostmanGet a list of all product attributes.
js
const attributes = await $SDK.API.Core.Attributes.getAll();ts
import type { Attributes } from '@tscommerce/sdk-typescript/resources/Core';
const attributes: Attributes[] = await $SDK.API.Core.Attributes.getAll();php
$attributes = $sdk->core->attributes->getAll();Create new Attribute
View on PostmanCreate a new product attribute with custom specifications.
js
const newAttribute = await $SDK.API.Core.Attributes.create({
name: 'Material',
slug: 'material',
type: 'select',
values: ['Cotton', 'Polyester', 'Wool']
});ts
import type { Attribute, Attributes } from '@tscommerce/sdk-typescript/resources/Core';
const newAttribute: Attribute = await $SDK.API.Core.Attributes.create({
name: 'Material',
slug: 'material',
type: 'select',
values: ['Cotton', 'Polyester', 'Wool']
});php
$newAttribute = $sdk->core->attributes->create([
'name' => 'Material',
'slug' => 'material',
'type' => 'select',
'values' => ['Cotton', 'Polyester', 'Wool']
]);Get Attribute
View on PostmanGet an existing attribute by ID.
js
const attribute = await $SDK.API.Core.Attributes.get(1);ts
import type { Attribute, Attributes } from '@tscommerce/sdk-typescript/resources/Core';
const attribute: Attribute = await $SDK.API.Core.Attributes.get(1);php
$attribute = $sdk->core->attributes->get(1);Update Attribute
View on PostmanUpdate an existing product attribute.
js
const updated = await $SDK.API.Core.Attributes.update(1, {
name: 'Updated Material',
values: ['Cotton', 'Polyester', 'Wool', 'Silk']
});ts
import type { Attribute, Attributes } from '@tscommerce/sdk-typescript/resources/Core';
const updated: Attribute = await $SDK.API.Core.Attributes.update(1, {
name: 'Updated Material',
values: ['Cotton', 'Polyester', 'Wool', 'Silk']
});php
$updated = $sdk->core->attributes->update(1, [
'name' => 'Updated Material',
'values' => ['Cotton', 'Polyester', 'Wool', 'Silk']
]);Partial Update Attribute
View on PostmanPartially update specific fields of an attribute.
js
const updated = await $SDK.API.Core.Attributes.partialUpdate(1, {
name: 'New Name'
});ts
import type { Attribute, Attributes } from '@tscommerce/sdk-typescript/resources/Core';
const updated: Attribute = await $SDK.API.Core.Attributes.partialUpdate(1, {
name: 'New Name'
});php
$updated = $sdk->core->attributes->partialUpdate(1, [
'name' => 'New Name'
]);Delete Attribute
View on PostmanDelete a product attribute.
js
await $SDK.API.Core.Attributes.delete(1);ts
await $SDK.API.Core.Attributes.delete(1);php
$sdk->core->attributes->delete(1);Search
Search Attributes
View on PostmanSearch attributes by name, type or other criteria.
js
const results = await $SDK.API.Core.Attributes.search({
name: 'material',
type: 'select'
});ts
import type { Attributes } from '@tscommerce/sdk-typescript/resources/Core';
const results: Attributes[] = await $SDK.API.Core.Attributes.search({
name: 'material',
type: 'select'
});php
$results = $sdk->core->attributes->search([
'name' => 'material',
'type' => 'select'
]);