Skip to content

AttributeTemplateAttribute_Insert#


Description#

This function inserts a new attribute option into an existing attribute template.

Request Parameters#

Parameter
Type Description
AttributeTemplate_id Number The id number of the attribute template being loaded
code String Attribute Template attribute code
type String Attribute selector type
prompt String The prompt offered for selecting the attribute
price Number The price of the attribute
cost Number The cost of the attribute
weight Number The weight of the attribute
required Boolean Boolean value indicating if selecting the product attribute is required for purchase
inventory Boolean Boolean value indicating if the product attribute is recorded in inventory
image String Filepath for Attribute Image
default Boolean Boolean value indicating if the attribute is the default selection for the Attribute Template

Response Parameters#

Parameter
Type Description
success Number 1 indicating a successful request.
0 indicating an unsuccessful request.

Example Request#

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "AttributeTemplateAttribute_Insert",
    "AttributeTemplate_ID": 2,
    "Code": "custom_rips",
    "Prompt": "rips",
    "Image": "",
    "Type": "radio",
    "Price": 20.0,
    "Cost": 10.0,
    "Weight": 1.0,
    "Default": 0,
    "Required": 0,
    "Inventory": 0
}

Example Response#

{
    "success": 1
}

Error Responses#

Error Code Error Message Error Description
MER-UTL-QUOTES-00032 Attribute template not found Attribute template not found
MER-ATT-JSN-00036 Unable to load attribute template attribute: One of AttributeTemplateAttribute_ID, Edit_AttributeTemplateAttribute or AttributeTemplateAttribute_Code must be specified Attribute template attribute not found
MER-JSN-00018 Invalid value for field ‘Code’: An attribute with the code ATTRIBUTE_CODE already exists Attribute template attribute code already exists