24/7 Support: 800.608.6482

Navigation


Attribute_Insert

This function inserts an attribute directly into a product.

Request Parameters

store_code Type:
String
Title:
Store Code
Store code to run the function against. Found in the Miva Admin under Settings > Store Details
function Type:
String
Title:
Attribute Insert
The name of the function being executed
product_id Type:
Number
Title:
Product Id
The id number of the product receiving the attribute
code Type:
String
Title:
Attribute Code
Attribute code
prompt Type:
String
Title:
Attribute Prompt
Name of the attribute prompt
image Type:
String
Title:
Attribute Image
Filepath for the attribute image
type Type:
String
Title:
Attribute Selection Type
Type of selector used for the attribute
price Type:
Number
Title:
Attribute Retail Price
The price of the attribute
cost Type:
Number
Title:
Attribute Cost
The cost of the attribute
weight Type:
Number
Title:
Attribute Weight
The weight of the attribute
default Type:
Boolean
Title:
Attribute Default
Boolean value indicating if the attribute is the default selection for the product
required Type:
Boolean
Title:
Attribute Required
Boolean value indicating if selecting the attribute is required for purchase
inventory Type:
Boolean
Title:
Attribute Inventory
Boolean value indicating if the attribute is recorded in inventory

Response Parameters

success Type:
Boolean
Title:
Status Response
Boolean value indicating if the api request was successful

Example Request

Example Response

Error Responses

error code:
MER-JSN-00018
error message:
Invalid value for field 'Code': An attribute with the code 'size' already exists
description:
Attribute code already exists

Copyright © 1997 – 2026 Miva®, Miva Merchant®, MivaPay Vault®, Camp Miva®, Miva Connect®, Vexture℠, Miva, Inc. All Rights Reserved.