PHPackages                             snowio/magento2-attribute-option-code - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. snowio/magento2-attribute-option-code

ActiveMagento2-module

snowio/magento2-attribute-option-code
=====================================

v3.2.0(2y ago)11204.7k↓42.9%11MITPHPPHP ^7.4||^8.1

Since Nov 15Pushed 2y ago4 watchersCompare

[ Source](https://github.com/snowio/magento2-attribute-option-code)[ Packagist](https://packagist.org/packages/snowio/magento2-attribute-option-code)[ RSS](/packages/snowio-magento2-attribute-option-code/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (35)Used By (0)

Magento 2 Attribute Option Code
===============================

[](#magento-2-attribute-option-code)

Description
-----------

[](#description)

Magento 2 module that that adds a unique code to an attribute option. Attribute options can now be created by remote clients with an identifier (attribute option code) that the client can specify and later reference during product saves. Attribute options that were created with the client can also be deleted by specifing the attribute option code that belongs to the attribute option. Please refer to the endpoint table for uri endpoint paths.

### Magento Versions

[](#magento-versions)

- 2.3.x use 2.x tags
- 2.4.x use master

Prerequisites
-------------

[](#prerequisites)

- PHP 5.6 or newer
- Composer ().
- `magento/framework` 100 or newer
- `magento/module-eav` 100 or newer
- `magento/module-catalog` 101 or newer

Installation
------------

[](#installation)

```
composer require snowio/magento2-attribute-option-code
php bin/magento module:enable SnowIO_AttributeOptionCode
php bin/magento setup:upgrade

```

Usage
-----

[](#usage)

### Endpoint table

[](#endpoint-table)

HTTP MethodURI PathDescriptionPOST`/V1/coded-attribute-options`Creates an Attribute option with a corresponding option code. See *Creating a coded attribute option*DELETE`/V1/coded-attribute-options/entity-type/:entityType/attribute-code/:attributeCode/option-code/:optionCode`Deletes an attribute option code. See *Deleting attribute options* for more information.PUT`/V1/products-with-option-codes/:sku`Saves a product with attribute option codes specified instead of attribute option IDs'. See *Specifying attribute options in products* for more information### Creating a coded attribute option

[](#creating-a-coded-attribute-option)

#### Request message body (JSON)

[](#request-message-body-json)

```
{
    "entity_type" : 4,
    "attribute_code" : "testAttribute",
    "option" : {
        "label": "foo",
        "value": "bar",
        "sort_order": 0,
        "is_default": true,
        "store_labels": [
            {
                "store_code" : "testStore",
                "label": "Foo Label Test"
            }
        ]
    }
}
```

##### Message body description

[](#message-body-description)

- `entity_type` *integer* : The entity type that the attribute option corresponds to.
- `attribute_code` *string* : The attribute code of the that corresponds to the option
- `option` :
    - `label` *string* : The option label
    - `value` *string* : The option code
    - `sort_order` *integer* : The option's sort order
    - `is_default` *boolean* : default option flag
    - `store_labels` *1..n* :
        - `store_code` *string* : The store code for the option
        - `label` *string* : The option label

### Deleting attribute options

[](#deleting-attribute-options)

- `:entityType` *integer* : The entity type that the attribute option corresponds to.
- `:attributeCode` *string* : The attribute code that the attribute option corresponds to.
- `:optionCode` *string* : The attribute option code.

### Specifying attribute options in products

[](#specifying-attribute-options-in-products)

#### URI parameters

[](#uri-parameters)

- `:sku` *string* : The products sku.

#### Request message body (JSON)

[](#request-message-body-json-1)

```
{
    "product": {
        "type_id": "simple",
        "sku": "test-from-snowio-simple",
        "attribute_set_id": 4,
        "name": "test from snow.io simple",
        "price": 10,
        "visibility": 4,
        "status": 1,
        "custom_attributes": {
            "testAttribute": "bar"
        }
    }
}
```

**NOTE** that the **value** of the custom attribute `testAttribute` is the **attribute option code** `bar`.

License
-------

[](#license)

This software is licensed under the MIT License. [View the license](LICENSE)

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 52.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~83 days

Recently: every ~258 days

Total

31

Last Release

965d ago

Major Versions

v1.8.3 → v2.0.02019-05-31

v2.1.1 → v3.0.02020-11-26

PHP version history (3 changes)v1.0.0PHP &gt;=5.6

v3.0.0PHP ~7.4.0

v3.1.0PHP ^7.4||^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/aa904d0f61196b12bd6727175110ad7a58e19d888960279e7e4b9dbb636f34b9?d=identicon)[convenient](/maintainers/convenient)

![](https://www.gravatar.com/avatar/248c125feb1acc5c8932c06226dcd5086760736ff5fc9ec69be32a3aeae8a339?d=identicon)[chickenland](/maintainers/chickenland)

---

Top Contributors

[![joshdifabio](https://avatars.githubusercontent.com/u/5609851?v=4)](https://github.com/joshdifabio "joshdifabio (25 commits)")[![qrz-io](https://avatars.githubusercontent.com/u/3646206?v=4)](https://github.com/qrz-io "qrz-io (7 commits)")[![convenient](https://avatars.githubusercontent.com/u/600190?v=4)](https://github.com/convenient "convenient (6 commits)")[![tr33m4n](https://avatars.githubusercontent.com/u/1771667?v=4)](https://github.com/tr33m4n "tr33m4n (4 commits)")[![peekarboo](https://avatars.githubusercontent.com/u/39334796?v=4)](https://github.com/peekarboo "peekarboo (2 commits)")[![nei](https://avatars.githubusercontent.com/u/33385?v=4)](https://github.com/nei "nei (1 commits)")[![meng-tian](https://avatars.githubusercontent.com/u/4396851?v=4)](https://github.com/meng-tian "meng-tian (1 commits)")[![realmtian](https://avatars.githubusercontent.com/u/4396851?v=4)](https://github.com/realmtian "realmtian (1 commits)")[![darryla](https://avatars.githubusercontent.com/u/12641702?v=4)](https://github.com/darryla "darryla (1 commits)")

---

Tags

middlewaresnowio

###  Code Quality

Static AnalysisRector

### Embed Badge

![Health badge](/badges/snowio-magento2-attribute-option-code/health.svg)

```
[![Health](https://phpackages.com/badges/snowio-magento2-attribute-option-code/health.svg)](https://phpackages.com/packages/snowio-magento2-attribute-option-code)
```

###  Alternatives

[smile/elasticsuite

Magento 2 merchandising and search engine built on ElasticSearch

8044.5M33](/packages/smile-elasticsuite)[mollie/magento2

Mollie Payment Module for Magento 2

1121.6M10](/packages/mollie-magento2)[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50374.2k18](/packages/dotdigital-dotdigital-magento2-extension)[swissup/module-search-mysql-legacy

Legacy mysql search for magento 2.4

10483.0k](/packages/swissup-module-search-mysql-legacy)[graycore/magento2-graphql-introspection-cache

1015.2k](/packages/graycore-magento2-graphql-introspection-cache)[opengento/module-category-import-export

This module add the capability to import and export the categories from the back-office.

119.1k](/packages/opengento-module-category-import-export)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
