Created by potrace 1.16, written by Peter Selinger 2001-2019

Miva Developer Docs

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


Description#

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

Request Parameters#

Parameter Type Required Description
AttributeTemplate_id Number The id number of the attribute template being loaded
code String Yes Attribute Template attribute code
type String Yes Attribute selector type. One of checkbox, radio, text, select, memo or swatch-select
prompt String Yes The prompt offered for selecting the attribute
price Number No The price of the attribute
cost Number No The cost of the attribute
weight Number No The weight of the attribute
required Boolean No Boolean value indicating if selecting the product attribute is required for purchase
inventory Boolean No Boolean value indicating if the product attribute is recorded in inventory
image String No Filepath for Attribute Image

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,
    "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