Backend API
Create a new attribute.
Arguments
A human-friendly name for the attribute.
Indicates the attribute requires a value when assigned to a product.
Input type used when entering a value for the attribute.
Possible enum values:
List of the attribute's associated select options used with attribute type of checkbox, radio, or select.
Indicates the attribute is visible to customers.
Default value used when entering a value for the attribute.
Indicates if the category is available in the storefront category page filters.
Indicates if this attribute supports localized content.
When attribute type=image is indicated, the attribute contains multiple images.
Expandable list of products using the attribute.
Indicates if this attribute is searchable on the backend.
Indicates if this attribute is a variant.
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');
await swell.post('/attributes', {
name: 'Material',
visible: true,
type: 'dropdown',
values: [
'Cotton',
'Polyester',
'Wool'
],
});
Response
{
"id": "material",
"name": "Material",
"date_created": "2019-04-01T00:00:00.000Z",
"required": false,
"visible": true,
"type": "dropdown",
"values": [
"Cotton",
"Polyester",
"Wool"
]
}