24/7 Support: 800.608.6482

Navigation


ProductVariant_Insert

This function inserts a new product variant.

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:
Product Variant Insert
The name of the function being executed
product_id Type:
Number
Title:
Product ID
The id number of the product
attribute_ids Type:
Number
Title:
Attribute IDs
The attribute id of the product
attributetemplateattribute_ids Type:
Number
Title:
Attribute Template Attribute IDs
The attribute template ids of the product attribute
option_ids Type:
Number
Title:
Option IDs
The option id numbers of the product
part_ids Type:
Number
Title:
Part IDs
The id numbers of the product parts
quantities Type:
Number
Title:
Quantities
The part quantities for the product variant
pricing Type:
Object
Title:
Variant Pricing
Object containing variant pricing data (Available in 10.08.03 and newer)
pricing.method Type:
String or Number
Title:
Variant Pricing Method
Values can be "master" or 0, "specific" or 1, "sum" or 2
pricing.pice Type:
[Optional] Number
Title:
Variant Price
Maximum 10 digits before decimal and 2 digits after decimal
pricing.cost Type:
[Optional] Number
Title:
Variant Cost
Maximum 10 digits before decimal and 2 digits after decimal
pricing.weight Type:
[Optional] Number
Title:
Variant Weight
Maximum 10 digits before decimal and 2 digits after decimal

Response Parameters

success Type:
Boolean
Title:
Status Response
Boolean value indicating if the api request was successful
product_id Type:
Number
Title:
Product ID
The product id for the variant
variant_id Type:
Number
Title:
Variant ID
The new variant id

Example Request

Example Response

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