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

Partially update an attribute

Updates one or more fields of an existing attribute. Only the fields you send are changed.

As with the full update, changing a behavior flag that dependent attribute configurations inherit cascades the new value to those configurations.

patch
/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 partially updating an attribute. All fields are optional; only the fields you send are changed.

keystring · max: 255Optional

The unique machine key of the attribute.

Pattern: ^[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
is_visiblebooleanOptional
is_searchablebooleanOptional
is_filterablebooleanOptional
is_variantbooleanOptional
is_variant_listablebooleanOptional
is_form_requiredbooleanOptional
is_form_field_requiredbooleanOptional
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.

patch/attributes/{id}/
PATCH /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?