Backend API
Update an existing attribute using the ID, that was returned when created. Updating performs a merge operation. To explicitly override values such as arrays, use the $set operator.
Arguments
Unique identifier for the attribute. Defaults to attribute name underscored.
A human-friendly name for the attribute.
Default value used when entering a value for the attribute.
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.
Set true to make the attribute require a value when added 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.
Indicates if this attribute is a variant.
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');
await swell.put('/attributes/{id}', {
id: 'material',
required: true
});
Response
{
"id": "material",
"name": "Material",
"date_created": "2019-04-01T00:00:00.000Z",
"date_updated": "2019-04-01T00:00:00.000Z",
"required": true,
"visible": true,
"type": "dropdown",
"values": [
"Cotton",
"Polyester",
"Wool"
]
}