For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update an attribute

Replaces the details of an existing attribute. Provide the full set of writable fields.

Changing behavior flags that are inherited by dependent attribute configurations (those whose default_fields include the changed flag) cascades the new value to those configurations.

put
/attributes/{id}/
Authorizations
AuthorizationstringRequired

Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.

Path parameters
idintegerRequired

The unique identifier of the attribute.

Body

The payload accepted when creating or fully updating an attribute.

keystring · max: 255Required

The unique machine key of the attribute.

Pattern: ^[a-zA-Z_][a-zA-Z0-9_-]*$
namestring · max: 255Required

The human-readable, translatable name of the attribute.

data_typestring · enumRequired

The data type of an attribute, controlling how its value is entered and interpreted. See the Data Types table under Attributes.

Possible values:
default_valueinteger · nullableOptional

The identifier of the attribute value used as the default, when any.

is_requiredbooleanOptional

Whether the attribute must have a value on the product.

is_visiblebooleanOptional

Whether the attribute is shown in management and storefront contexts.

is_searchablebooleanOptional

Whether the attribute is indexed for search.

is_filterablebooleanOptional

Whether the attribute can be used as a storefront filter.

is_variantbooleanOptional

Whether the attribute distinguishes variants of a product.

is_variant_listablebooleanOptional

Whether the attribute participates in choosing the listable variant.

is_form_requiredbooleanOptional

Whether the attribute is required in the product form.

is_form_field_requiredbooleanOptional

Whether the attribute's form field is required.

translationsobject · nullableWrite-onlyOptional

Localized values of the translatable fields, keyed by language code. Write-only.

Responses
200

The updated attribute.

application/json

An attribute definition as returned by the API.

pkintegerRead-onlyOptional

The unique identifier of the attribute.

keystring · max: 255Optional

The unique machine key of the attribute. Matches ^[a-zA-Z_][a-zA-Z0-9_-]*$.

namestring · max: 255Optional

The human-readable, translatable name of the attribute.

data_typestring · enumOptional

The data type of an attribute, controlling how its value is entered and interpreted. See the Data Types table under Attributes.

Possible values:
default_valueinteger · nullableOptional

The identifier of the attribute value used as the default, when any.

is_requiredbooleanOptional

Whether the attribute must have a value on the product.

is_visiblebooleanOptional

Whether the attribute is shown in management and storefront contexts.

is_searchablebooleanOptional

Whether the attribute is indexed for search.

is_filterablebooleanOptional

Whether the attribute can be used as a storefront filter.

is_variantbooleanOptional

Whether the attribute distinguishes variants of a product.

is_variant_listablebooleanOptional

Whether the attribute participates in choosing the listable variant.

is_form_requiredbooleanOptional

Whether the attribute is required in the product form.

is_form_field_requiredbooleanOptional

Whether the attribute's form field is required.

put/attributes/{id}/
PUT /api/remote/1/attributes/{id}/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 266

{
  "key": "text",
  "name": "text",
  "data_type": "text",
  "default_value": null,
  "is_required": true,
  "is_visible": true,
  "is_searchable": true,
  "is_filterable": true,
  "is_variant": true,
  "is_variant_listable": true,
  "is_form_required": true,
  "is_form_field_required": true,
  "translations": null
}
{
  "pk": 42,
  "key": "color",
  "name": "Color",
  "data_type": "dropdown",
  "default_value": null,
  "is_required": true,
  "is_visible": true,
  "is_searchable": true,
  "is_filterable": true,
  "is_variant": true,
  "is_variant_listable": true,
  "is_form_required": false,
  "is_form_field_required": false
}

Last updated

Was this helpful?