Catalog Attribute — Update
Updates an existing attribute. Mirrors Catalog → Attributes → Edit in the Bagisto admin panel.
Endpoint
| Endpoint | Method |
|---|---|
/api/admin/catalog/attributes/{id} | PUT |
{id} must be a positive integer (requirements: ['id' => '\\d+']).
Request body
Same fields as Create, with these rules:
codeis immutable. Sending a different code returns422.typecannot be changed if any product attribute value references this attribute. Returns422.optionsis a full-set replacement. Entries with anidare updated, entries withoutidare inserted, and any existing option ids omitted from the payload are deleted.- System attributes (
is_user_defined = 0) silently ignore immutable fields by convention — only mutable fields (e.g.admin_name, translations) are applied. translationsmerges per-locale — only the supplied locales are updated; others are untouched.
Response
200 OK returning the full attribute detail — identical shape to GET /api/admin/catalog/attributes/{id}.
Errors
| HTTP | Cause |
|---|---|
401 Unauthorized | Missing or invalid Bearer token |
404 Not Found | The attribute does not exist |
422 Unprocessable Entity | Code change attempted, type change refused, or other validation failure |

