Skip to content

OrderItem_Update#


Description#

This function allows you to update an item (product) which is part of an order. All fields except Order_ID and Line_ID are optional.

Request Body Parameters#

Parameter
Type Description
order_id Number Order Id to add item to
line_id Number The line_id is the id of the line item in the order. This value is returned in OrderList_Load_Query
code String Product Code to Add (this does not need to exist as a product in Miva’s Database)
name String Product Name
sku String Product SKU
quantity Number Product Quantity
weight Number Weight
Taxable Boolean Taxable
attributes Object Attributes

attributes object#

Parameter
Type Description
attr_code Number Attribute Code
opt_code_or_data String Option Code/Data. Note. You can use this parameter or opt_code. Both are not required
opt_code String Option Code
price Number Price
weight Number Weight

Response Parameters#

Parameter
Type Description
total Number Order Total after new item has been added.
formatted_total String Currenty Formatted Order Total

Example Request#

{
    "Store_code": "beta",
    "Function": "OrderItem_Update",
    "line_id": 154,
    "Order_ID": 200101,
    "Code": "shirt",
    "Name": "Custom T-Shrt",
    "SKU": "shirt-red-small",
    "Quantity": 3,
    "Price": 10.58,
    "Weight": 1,
    "Taxable": true,
    "Attributes": [
        {
            "attr_code": "size",
            "opt_code_or_data": "small",
            "price": 0,
            "weight": 0
        },
        {
            "attr_code": "color",
            "opt_code_or_data": "red",
            "price": 0,
            "weight": 0
        }
    ]
}

Example Response#

{
    "success": 1,
    "data": {
        "total": 63.48,
        "formatted_total": "$63.48"
    }
}

Error Responses#

Error Code Error Message Error Description
MER-JSN-ORD-00025 Order not found Order number not found
MER-JSN-00023 One or more parameters are invalid Missing required line_id parameter
EOF Record not found: MER-DBP-OIT-00007 line_id passed is not valid