Skip to content

AttributeAndOptionList_Load_Product#


Description#

This function loads a list of attributes and options for a product.

Request Parameters#

Parameter
Type Description
product_id
Edit_Product
Product_Code
Product_SKU
Number
String
String
String
ID Number of product
Product code string
Product code string
Product SKU string

Response Parameters#

Parameter
Type Description
success Number 1 indicating a successful request.
0 indicating an unsuccessful request.
data Object Object containing function attributes and option list of product
id Number ID Number of attribute
product_id Number ID Number of product
default_id Number ID default option if available (default is 0)
disp_order Number Display order number
code String Attribute code
type String Atttribute type (radio,select,checkbox,text,memo,template,swatch-select)
attemp_id Number ID Number of attribute template (default is 0)
prompt String Prompt for attribute
price Number Price of attribute
formatted_price String Formatted price of attribute
cost Number Cost of attribute
formatted_cost String Formatted cost of attribute
weight Number Weight of attribute
required Boolean True or False value for required
inventory Boolean True or False value for inventory active
image String Filepath for the attribute image
options Object Object containing option list
options.id Number ID number of option
options.product_id Number ID number of product associated with option
options.attr_id Number ID number of attribute associated with option
options.disp_order Number Display order number of option
options.code String Option code
options.prompt String Option prompt
options.price Number Option price
options.formatted_price String Option formatted price
options.cost Number Option cost
options.formatted_cost String Option formatted cost
options.weight Number Option weight
options.image String Option image

Example Request#

{
    "Store_code": "beta",
    "Function": "AttributeAndOptionList_Load_Product",
    "Product_ID": 2960
}

Example Response#

{
    "success": 1,
    "data": [
        {
            "id": 540,
            "product_id": 2960,
            "default_id": 2084,
            "disp_order": 542,
            "code": "size",
            "type": "select",
            "attemp_id": 0,
            "prompt": "Size",
            "price": 0.00,
            "formatted_price": "$0.00",
            "cost": 0.00,
            "formatted_cost": "$0.00",
            "weight": 0.00,
            "required": true,
            "inventory": true,
            "image": "graphics\/00000001\/size.png",
            "options": [
                {
                    "id": 2084,
                    "product_id": 2960,
                    "attr_id": 540,
                    "disp_order": 2092,
                    "code": "small",
                    "prompt": "Small",
                    "price": 2.00,
                    "formatted_price": "$2.00",
                    "cost": 0.00,
                    "formatted_cost": "$0.00",
                    "weight": 0.00,
                    "image": ""
                },
                {
                    "id": 2085,
                    "product_id": 2960,
                    "attr_id": 540,
                    "disp_order": 2093,
                    "code": "medium",
                    "prompt": "Medium",
                    "price": 4.00,
                    "formatted_price": "$4.00",
                    "cost": 0.00,
                    "formatted_cost": "$0.00",
                    "weight": 0.00,
                    "image": ""
                },
                {
                    "id": 2086,
                    "product_id": 2960,
                    "attr_id": 540,
                    "disp_order": 2094,
                    "code": "large",
                    "prompt": "Large",
                    "price": 6.00,
                    "formatted_price": "$6.00",
                    "cost": 0.00,
                    "formatted_cost": "$0.00",
                    "weight": 0.00,
                    "image": ""
                },
                {
                    "id": 2087,
                    "product_id": 2960,
                    "attr_id": 540,
                    "disp_order": 2095,
                    "code": "regular",
                    "prompt": "Regular",
                    "price": 8.00,
                    "formatted_price": "$8.00",
                    "cost": 0.00,
                    "formatted_cost": "$0.00",
                    "weight": 0.00,
                    "image": ""
                }
            ]
        },
        {
            "id": 550,
            "product_id": 2960,
            "default_id": 0,
            "disp_order": 552,
            "code": "color",
            "type": "select",
            "attemp_id": 0,
            "prompt": "color",
            "price": 0.00,
            "formatted_price": "$0.00",
            "cost": 0.00,
            "formatted_cost": "$0.00",
            "weight": 0.00,
            "required": true,
            "inventory": true,
            "image": "",
            "options": [
                {
                    "id": 2112,
                    "product_id": 2960,
                    "attr_id": 550,
                    "disp_order": 2120,
                    "code": "red",
                    "prompt": "red",
                    "price": 0.00,
                    "formatted_price": "$0.00",
                    "cost": 0.00,
                    "formatted_cost": "$0.00",
                    "weight": 0.00,
                    "image": ""
                },
                {
                    "id": 2113,
                    "product_id": 2960,
                    "attr_id": 550,
                    "disp_order": 2121,
                    "code": "blue",
                    "prompt": "blue",
                    "price": 0.00,
                    "formatted_price": "$0.00",
                    "cost": 0.00,
                    "formatted_cost": "$0.00",
                    "weight": 0.00,
                    "image": ""
                }
            ]
        }
    ]
}

Error Responses#

Error Code Error Message Error Description
MER-JSN-00018 Invalid value for field ‘CODE’: An attribute with the code ‘ATTRIBUTE_CODE’ already exists Attribute code already exists