OrderItem_Split#
Description#
This function splits an order item from an order. The response contains objects for the original_orderitem as well as the split_orderitem. Specifically the line_id of the split item is returned for storing in an external system.
Request Parameters#
| Parameter | Type | Description | 
|---|---|---|
| order_id | Number | Order ID | 
| line_id | Number | Line ID | 
| status | Number | 0 = Pending 100 = Picking 200 = Shipped 210 = Gift Certificate: Not Redeemed 211 = Gift Certificate: Redeemed 220 = Digital: Not Downloaded 221 = Digital: Downloaded 300 = Cancelled 400 = Backordered 500 = RMA Issued 600 = Returned | 
| subscrp_id | Number | Subscription ID | 
| subterm_id | Number | Subscription Term Id | 
| rma_id | Number | Return Merchandise Authorization Id | 
| dt_instock | Number | Date/Time Instock (Unix timestamp) | 
| code | String | Code | 
| name | String | Name | 
| sku | String | Sku Number | 
| retail | Number | Retail Price | 
| base_price | Number | Base Price | 
| price | Number | Price | 
| weight | Number | Weight | 
| taxable | Boolean | Taxable | 
| tax | Number | Sales tax for this specific Item | 
| formatted_tax | String | Currency formatted sales tax for this specific Item | 
| upsold | Boolean | Upsold | 
| quantity | Number | Quantity | 
| total | Number | Order Item Total | 
| discounts | Object | Discounts | 
| options | Object | Options | 
discounts object#
| Parameter | Type | Description | 
|---|---|---|
| order_id | Number | Order ID | 
| line_id | Number | Line ID | 
| pgrp_id | Number | Price Group Id | 
| display | Boolean | Display | 
| descrip | String | Description | 
| discount | Number | Discount Amount | 
options object#
| Parameter | Type | Description | 
|---|---|---|
| id | Number | Option ID | 
| order_id | Number | Order Id | 
| line_id | Number | Line ID | 
| attr_id | Number | Attribute ID | 
| attr_code | String | Base Attribute Code | 
| attmpat_id | Number | Attribute Template ID | 
| option_id | Number | Option ID | 
| opt_code | String | Option Code | 
| retail | Number | Retail Price | 
| base_price | Number | Base Price | 
| price | Number | Price | 
| weight | Number | Weight | 
| data | String | Option Data up to 255 characters | 
| data_long | String | Option Long Data (Memo) | 
| attr_prompt | String | Attribute Prompt | 
| opt_prompt | String | Option Prompt | 
| attribute | String | Attribute Code | 
| value | String | Option Value | 
Example Request#
{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "OrderItem_Split",
    "Line_ID": 6,
    "Order_ID": 1000,
    "Quantity": 4
}
Example Response#
{
    "success": 1,
    "data": {
        "original_orderitem": {
            "order_id": 1000,
            "line_id": 6,
            "status": 0,
            "subscrp_id": 0,
            "subterm_id": 0,
            "shpmnt_id": 0,
            "rma_id": 0,
            "product_id": 1,
            "dt_instock": 0,
            "code": "shirt",
            "name": "Shirt",
            "sku": "",
            "retail": 25.0,
            "base_price": 25.0,
            "price": 20.0,
            "weight": 0.0,
            "taxable": true,
            "tax": 0.0,
            "formatted_tax": "$0.00",
            "upsold": false,
            "quantity": 2,
            "discounts": [
                {
                    "order_id": 1000,
                    "line_id": 6,
                    "pgrp_id": 1,
                    "display": true,
                    "descrip": "20OFF",
                    "discount": 5.0
                }
            ],
            "options": [
                {
                    "id": 7,
                    "order_id": 1000,
                    "line_id": 6,
                    "attr_id": 1,
                    "attr_code": "size",
                    "attmpat_id": 0,
                    "option_id": 1,
                    "opt_code": "small",
                    "retail": 0.0,
                    "base_price": 0.0,
                    "price": 0.0,
                    "weight": 0.0,
                    "data": "",
                    "data_long": "",
                    "attr_prompt": "Select Size",
                    "opt_prompt": "Small",
                    "attribute": "size",
                    "value": "small"
                }
            ],
            "total": 40.0
        },
        "split_orderitem": {
            "order_id": 1000,
            "line_id": 10,
            "status": 0,
            "subscrp_id": 0,
            "subterm_id": 0,
            "shpmnt_id": 0,
            "rma_id": 0,
            "product_id": 1,
            "dt_instock": 0,
            "code": "shirt",
            "name": "Shirt",
            "sku": "",
            "retail": 25.0,
            "base_price": 25.0,
            "price": 20.0,
            "weight": 0.0,
            "taxable": true,
            "tax": 0.0,
            "formatted_tax": "$0.00",
            "upsold": false,
            "quantity": 4,
            "discounts": [
                {
                    "order_id": 1000,
                    "line_id": 10,
                    "pgrp_id": 1,
                    "display": true,
                    "descrip": "20OFF",
                    "discount": 5.0
                }
            ],
            "options": [
                {
                    "id": 9,
                    "order_id": 1000,
                    "line_id": 10,
                    "attr_id": 1,
                    "attr_code": "size",
                    "attmpat_id": 0,
                    "option_id": 1,
                    "opt_code": "small",
                    "retail": 0.0,
                    "base_price": 0.0,
                    "price": 0.0,
                    "weight": 0.0,
                    "data": "",
                    "data_long": "",
                    "attr_prompt": "Select Size",
                    "opt_prompt": "Small",
                    "attribute": "size",
                    "value": "small"
                }
            ],
            "total": 80.0
        }
    }
}
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 | 
| MER-DBP-OIT-00007 | Record not found | line_id passed is not valid |