QuoteItem_Add
#
Description#
This function adds an item to a quote.
Request Parameters#
Parameter |
Type | Description |
---|---|---|
function |
String | For module level functions this parameter will always have the value Module |
module_code |
String | The module code will always have the value quote for this function |
module_function |
String | Specifies the function being executed, in this case QuoteItem_Add |
quote_id edit_quote quote_code |
Number String String |
The id of the quote The code of the quote The code of the quote |
code |
String | Product Code for the item to be added |
name |
String | Product Name for the item |
sku |
String | Product SKU number of the item |
quantity |
Number | Quantity of the item to be added |
price |
Number | Product price of the item |
weight |
Number | Product weight of the item |
taxable |
Boolean | The taxable status of the item |
attributes |
Object | Attribute options for the item |
attributes
Object#
Parameter |
Type | Description |
---|---|---|
attr_id |
Number | Item Attribute ID |
attmpat_id |
Number | Attribute Template ID |
attr_code |
String | Item Attribute Code |
opt_code_or_data |
String | Product option code or additional product data |
price |
Number | Product Attribute Price |
weight |
Number | Product Attribute Weight |
Response Parameters#
Parameter |
Type | Description |
---|---|---|
success |
Boolean | Boolean value indicating if the API request was successful |
total |
Number | Total of the quote |
formatted_total |
String | Formatted total of the quote |
Example Request#
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "Module",
"Module_Code": "quote",
"Module_Function": "QuoteItem_Add",
"Quote_ID": 1008,
"Code": "bulk-01",
"Name": "Bulk Rock Coffee",
"SKU": "817715",
"Quantity": 2,
"Price": 1247.5,
"Weight": 100,
"Taxable": 1,
"Attributes": [
{
"attr_id": 1,
"attmpat_id": 0,
"attr_code": "roast",
"opt_code_or_data": "toasted",
"price": 0,
"weight": 0
}
]
}
Example Response#
{
"success": 1,
"data": {
"total": 2519.95,
"formatted_total": "$2,519.95"
}
}
Error Responses#
Error Code | Error Message | Error Description |
---|---|---|
MER-UTL-QUOTES-00343 | Quote not found | Quote not found |
MER-UTL-QUOTES-00346 | Unable to load quote: One of Quote_ID, Edit_Quote, or Quote_Code must be specified | Unable to load quote |
MER-JSN-00023 | One or more parameters are invalid | Missing line_id(s) parameter |
MER-UTL-QUOTES-00150 | This quote has already been purchased, you can no longer modify items | Quote not eligible for update |