Zoey REST API reference ยท Interactive version: apidocs.zoey.com

Attributes

These endpoints are used to GET / CREATE / UPDATE attributes for Entity Types:

Examples of data for each entity type can be found in the "Update" examples.

Get

GET https://container-url.zoeysite.com/api/rest/attributes/:entity_type/:attribute_id/:store_id

Query parameters:

NameExampleNotes
attrsattribute_code, sort_order

Get All

GET https://container-url.zoeysite.com/api/rest/attributes/:entity_type

Update

PUT https://container-url.zoeysite.com/api/rest/attributes/:entity_type/:attribute_id/:store_id

See the Example requests for information about each entity type.

When attribute data is created/updated is it assigned to the default attribute group/set by default. There is no need to assign an attribute to an attribute set.

Updating Attribute Options

See the "Select & Multiselect Options" example on how to post options.

WARNING
THIS OPERATION IS DESTRUCTIVE! MAKE SURE TO LIST EVERY SINGLE ATTRIBUTE OPTION. IF IT IS NOT LISTED IT WILL BE DELETED

Example request body:

{
    "attribute_code": "test_api_attribute_select",
    "frontend_input": "select",
    "frontend_label": "Test API Attribute Select",

    "allow_account_restriction": "1",
    "customer_group_restricted": "1",
    "restricted_groups_data": { "1": 1, "2": 1 },
    "quote_restricted_groups_data": { "1": 1, "2": 1, "18": 1 },
    "is_enabled": "1",
    "show_in_emails": "1",
    "show_in_pdf": "1",
    "show_in_frontend": "1",
    "show_in_csv": "1",
    "show_in_order_success": "1",
    "edit_in_admin": "1",
    "checkout_location": "billing",
    "checkout_position": "bottom",
    "admin_render_location": "general",
    "pdf_render_location": "billing",
    "quote_is_enabled_fe": "1",
    "quote_is_enabled_admin": "1",
    "quote_is_required": "1",
    "quote_copy_to_order": "1",
    "quote_sort_order": "1",
    "quote_checkout_location": "general",
    "quote_admin_render_location": "general",
    "quote_customer_group_restricted": "1",
    "quote_show_in_pdf": "1",
    "quote_show_in_emails": "1",
    "quote_show_in_csv": "1",
    "quote_edit_after_submit_fe": "1",

    "is_required": "0",
    "sort_order": "10",

    "default_value": "95",
    "option": [
        {"option_id": "94", "value": "Option 1"},
        {"option_id": "95", "value": "Option 2"}
    ],

    /* validate_rules are for Date attributes only. */
    "validate_rules": {
        "date_offset_min_group": [
            {
                "customer_groups": [],
                "date_offset_min": 2
            }
        ],
        "date_offset_max_group": [
            {
                "customer_groups": [],
                "date_offset_max": 4
            }
        ],
        "default_to_today": 1,
        "store_front_only": 1
    }
}

Create

POST https://container-url.zoeysite.com/api/rest/attributes/:entity_type/

More information on post data can be found in the "Update" examples.

When attribute data is created/updated is it assigned to the default attribute group/set by default. There is no need to assign an attribute to an attribute set.

Example request body:

{
    "attribute_code": "test_api_attribute_select",
    "frontend_input": "select",
    "frontend_label": "Test API Attribute Select",
    "allow_account_restriction": "1",
    "customer_group_restricted": "1",
    "use_in_grid": "1",
    "use_in_order_grid": "1",
    "use_in_pdfs": "1",
    "use_in_emails": "1",
    "use_in_order_view": "2",
    "is_required": "0",
    "sort_order": "10",
    "used_in_forms": [
        "adminhtml_customer",
        "customer_account_create",
        "customer_account_edit",
        "customer_register_checkout",
        "adminhtml_checkout",
        "adminhtml_order_export"
    ],
    "required_in_forms": [
        "adminhtml_customer",
        "customer_account_create",
        "customer_account_edit",
        "customer_register_checkout",
        "adminhtml_checkout",
        "adminhtml_order_export"
    ],
    "default_value": "_2",
    "option": [
        {
            "option_id": "_1",
            "value": "Option 1"
        },
        {
            "option_id": "_2",
            "value": "Option 2"
        }
    ]
}

Example response (Create):

"134"

Delete

DELETE https://container-url.zoeysite.com/api/rest/attributes/:entity_type/:attribute_id

More information on post data can be found in the "Update" examples.

When attribute data is created/updated is it assigned to the default attribute group/set by default. There is no need to assign an attribute to an attribute set.

Example request body:

{
    "attribute_code": "test_api_attribute_select",
    "frontend_input": "select",
    "frontend_label": "Test API Attribute Select",
    "allow_account_restriction": "1",
    "customer_group_restricted": "1",
    "use_in_grid": "1",
    "use_in_order_grid": "1",
    "use_in_pdfs": "1",
    "use_in_emails": "1",
    "use_in_order_view": "2",
    "is_required": "0",
    "sort_order": "10",
    "used_in_forms": [
        "adminhtml_customer",
        "customer_account_create",
        "customer_account_edit",
        "customer_register_checkout",
        "adminhtml_checkout",
        "adminhtml_order_export"
    ],
    "required_in_forms": [
        "adminhtml_customer",
        "customer_account_create",
        "customer_account_edit",
        "customer_register_checkout",
        "adminhtml_checkout",
        "adminhtml_order_export"
    ],
    "default_value": "_2",
    "option": [
        {
            "option_id": "_1",
            "value": "Option 1"
        },
        {
            "option_id": "_2",
            "value": "Option 2"
        }
    ]
}

Example response (Create):

"134"