{
    "additionalProperties": true,
    "definitions": {},
    "description": "order_update_v1",
    "links": [
        {
            "description": "order_update_v1",
            "href": "/order_update_v1",
            "method": "post",
            "rel": "instances",
            "schema": {
                "allOf": [
                    {
                        "properties": {
                            "action": {
                                "description": "Action Name name",
                                "example": "catalog_get_config",
                                "type": "string"
                            },
                            "channel_info": {
                                "properties": {
                                    "id": {
                                        "description": "channel id",
                                        "example": 21,
                                        "type": "integer"
                                    }
                                },
                                "type": "object"
                            },
                            "client_id": {
                                "description": "RetailOPS client id",
                                "example": 497,
                                "type": "integer"
                            },
                            "integration_auth_token": {
                                "description": "Randomly generated authorization token, for authenticating genuine RetailOps- originated requests.",
                                "example": "2KuxqV9rsAtAM78i47CITMvtnflUapNmgGJAvWiHqgUrk1xkeDNWlM3EsrmJEtmV",
                                "type": "string"
                            },
                            "version": {
                                "description": "Action Version",
                                "example": 1,
                                "type": "integer"
                            }
                        },
                        "required": [
                            "action",
                            "version",
                            "client_id",
                            "channel_info"
                        ],
                        "type": "object"
                    },
                    {
                        "properties": {
                            "order": {
                                "properties": {
                                    "channel_order_refnum": {
                                        "description": "channel reference number for order",
                                        "type": "string"
                                    },
                                    "grand_total": {
                                        "description": "RetailOps current order grand total",
                                        "type": "number"
                                    },
                                    "order_items": {
                                        "description": "List of order line items",
                                        "items": {
                                            "properties": {
                                                "apportioned_ship_amt": {
                                                    "description": "Apportioned ship amount",
                                                    "type": "number"
                                                },
                                                "channel_item_refnum": {
                                                    "description": "channel reference number for order",
                                                    "type": "string"
                                                },
                                                "direct_ship_amt": {
                                                    "description": "Direct ship amount",
                                                    "type": "number"
                                                },
                                                "estimated_cost": {
                                                    "description": "Estimated item cost",
                                                    "type": "number"
                                                },
                                                "estimated_extended_cost": {
                                                    "description": "Estimated extended cost of item",
                                                    "type": "number"
                                                },
                                                "estimated_ship_date": {
                                                    "description": "estimated ship date of item",
                                                    "example": "2016-04-08T21:13:11Z",
                                                    "type": "string"
                                                },
                                                "estimated_unit_cost": {
                                                    "description": "Estimated unit cost of item",
                                                    "type": "number"
                                                },
                                                "order_item_id": {
                                                    "description": "Retail Ops order item ID",
                                                    "type": "integer"
                                                },
                                                "quantity": {
                                                    "description": "Order quantity of item",
                                                    "type": "integer"
                                                },
                                                "removed": {
                                                    "description": "boolean indicator of whether the item was removed from the order.",
                                                    "type": "boolean"
                                                },
                                                "sku": {
                                                    "description": "SKU specified by the order item",
                                                    "type": "string"
                                                },
                                                "unit_price": {
                                                    "description": "base unit price of item",
                                                    "type": "number"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "type": "array"
                                    },
                                    "retailops_order_id": {
                                        "description": "RetailOps Order ID",
                                        "type": "integer"
                                    },
                                    "shipments": {
                                        "description": "List of all fulfilled shipments for this order. Each RetailOps shipment corresponds to one portion of the order routing plan, usually one per each facility or vendor. Each fulfilled shipment will contain one or more packages",
                                        "items": {
                                            "properties": {
                                                "packages": {
                                                    "items": {
                                                        "description": "a package included in shipment",
                                                        "properties": {
                                                            "carrier_class_name": {
                                                                "description": "Ship Carrier's Class Name",
                                                                "example": "Ground",
                                                                "type": "string"
                                                            },
                                                            "carrier_name": {
                                                                "description": "Ship Carrier Name",
                                                                "example": "UPS",
                                                                "type": "string"
                                                            },
                                                            "channel_ship_code": {
                                                                "description": "Code which has been configured for this channel to represent the above carrier/class. EG: 'UPS Ground' -> 'UPSGRND' or 'U,GRD'",
                                                                "type": "string"
                                                            },
                                                            "date_shipped": {
                                                                "description": "Date the package was shipped",
                                                                "example": "2016-04-08T21:13:11Z",
                                                                "type": "string"
                                                            },
                                                            "package_items": {
                                                                "items": {
                                                                    "properties": {
                                                                        "channel_item_refnum": {
                                                                            "description": "Channel reference number for this item",
                                                                            "type": "string"
                                                                        },
                                                                        "quantity": {
                                                                            "description": "Quantity of the referenced items which was included in this package",
                                                                            "type": "integer"
                                                                        },
                                                                        "retailops_order_item_id": {
                                                                            "description": "RetailOps Order Item ID",
                                                                            "type": "integer"
                                                                        },
                                                                        "retailops_shipment_item_id": {
                                                                            "description": "RetailOps Shipment Item ID",
                                                                            "type": "integer"
                                                                        },
                                                                        "sku": {
                                                                            "description": "SKU Number of the item",
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "type": "object"
                                                                },
                                                                "type": "array"
                                                            },
                                                            "retailops_package_id": {
                                                                "description": "RetailOps Package ID",
                                                                "type": "integer"
                                                            },
                                                            "tracking_number": {
                                                                "description": "Tracking number",
                                                                "example": "ZX29827782929",
                                                                "type": "string"
                                                            },
                                                            "weight_kg": {
                                                                "description": "Weight in Kilograms",
                                                                "type": "number"
                                                            }
                                                        },
                                                        "type": "object"
                                                    },
                                                    "type": "array"
                                                },
                                                "retailops_shipment_id": {
                                                    "description": "RetailOps Shipment ID",
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "type": "array"
                                    },
                                    "unshipped_items": {
                                        "description": "List of items which were not shipped as of the time of order completion. Presumably these items should be canceled in the channel",
                                        "items": {
                                            "properties": {
                                                "channel_item_refnum": {
                                                    "description": "channel reference number for order",
                                                    "type": "string"
                                                },
                                                "effective_extended_price": {
                                                    "description": "extended price associated with the order item (after discounts), specified in the counterparty currency",
                                                    "type": "number"
                                                },
                                                "effective_unit_price": {
                                                    "description": "effective unit price associated with the order item (after discounts), specified in the counterparty currency",
                                                    "type": "number"
                                                },
                                                "ordered_quantity": {
                                                    "description": "quantity of the order item which was ordered",
                                                    "type": "integer"
                                                },
                                                "sku": {
                                                    "description": "SKU specified by the order item",
                                                    "type": "string"
                                                },
                                                "unshipped_quantity": {
                                                    "description": "quantity of the order item which has not been shipped",
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        },
                                        "type": "array"
                                    }
                                },
                                "type": "object"
                            },
                            "rmas": {
                                "items": {
                                    "properties": {
                                        "discount_amt": {
                                            "description": "amount of applied discount",
                                            "example": 0,
                                            "type": "number"
                                        },
                                        "items": {
                                            "items": {
                                                "description": "credited item ref",
                                                "properties": {
                                                    "channel_item_refnum": {
                                                        "description": "ref number of returned item being credited",
                                                        "example": "return_item 90",
                                                        "type": "string"
                                                    },
                                                    "credit_amt": {
                                                        "description": "",
                                                        "example": 30,
                                                        "type": "number"
                                                    },
                                                    "giftwrap_amt": {
                                                        "description": "item giftwrap cost",
                                                        "example": 0,
                                                        "type": "number"
                                                    },
                                                    "giftwrap_tax_amt": {
                                                        "description": "",
                                                        "example": 0,
                                                        "type": "number"
                                                    },
                                                    "item_shipping_tax_amt": {
                                                        "description": "",
                                                        "example": 30,
                                                        "type": "number"
                                                    },
                                                    "product_amt": {
                                                        "description": "",
                                                        "example": 30,
                                                        "type": "number"
                                                    },
                                                    "quantity": {
                                                        "description": "quantity",
                                                        "example": 1,
                                                        "type": "integer"
                                                    },
                                                    "reason": {
                                                        "description": "return reason",
                                                        "example": "CustomerReturn",
                                                        "type": "string"
                                                    },
                                                    "recycling_amt": {
                                                        "description": "",
                                                        "example": 0,
                                                        "type": "number"
                                                    },
                                                    "restock_fee_amt": {
                                                        "description": "item restock fee",
                                                        "example": 0,
                                                        "type": "number"
                                                    },
                                                    "retailops_item_id": {
                                                        "description": "order item id",
                                                        "example": 7395,
                                                        "type": "integer"
                                                    },
                                                    "shipping_amt": {
                                                        "description": "item shipped amount",
                                                        "example": 0,
                                                        "type": "number"
                                                    },
                                                    "sku": {
                                                        "description": "sku id",
                                                        "example": "132",
                                                        "type": "string"
                                                    },
                                                    "subtotal_amt": {
                                                        "description": "",
                                                        "example": 30,
                                                        "type": "number"
                                                    },
                                                    "tax_amt": {
                                                        "description": "",
                                                        "example": 0,
                                                        "type": "number"
                                                    }
                                                },
                                                "type": "object"
                                            },
                                            "type": "array"
                                        },
                                        "product_amt": {
                                            "description": "",
                                            "example": 30,
                                            "type": "number"
                                        },
                                        "refund_action": {
                                            "description": "action name of return",
                                            "example": "refund",
                                            "type": "string"
                                        },
                                        "refund_amt": {
                                            "description": "amount refunded",
                                            "example": 30,
                                            "type": "number"
                                        },
                                        "retailops_return_id": {
                                            "description": "RetailOps Order return id",
                                            "example": 87,
                                            "type": "integer"
                                        },
                                        "retailops_rma_id": {
                                            "description": "RetailOps RMA id",
                                            "example": "null",
                                            "type": "string"
                                        },
                                        "shipping_amt": {
                                            "description": "amount shipped",
                                            "example": 0,
                                            "type": "integer"
                                        },
                                        "subtotal_amt": {
                                            "description": "",
                                            "example": 30,
                                            "type": "number"
                                        },
                                        "tax_amt": {
                                            "description": "tax amount on returned items",
                                            "example": 0,
                                            "type": "number"
                                        }
                                    },
                                    "type": "object"
                                },
                                "type": "array"
                            }
                        },
                        "type": "object"
                    }
                ]
            },
            "targetSchema": {
                "properties": {
                    "events": {
                        "items": {
                            "description": "event returned in action response",
                            "properties": {
                                "associations": {
                                    "description": "",
                                    "items": {
                                        "properties": {
                                            "identifier": {
                                                "description": "identify value corresponding to the type",
                                                "example": "S1234",
                                                "type": "string"
                                            },
                                            "identifier_type": {
                                                "description": "Type of identifier being provided",
                                                "enum": [
                                                    "order_id",
                                                    "order_refnum",
                                                    "orderitem_id",
                                                    "orderitem_refnum",
                                                    "shipment_id",
                                                    "shipmentitem_id",
                                                    "product_id",
                                                    "sku_number"
                                                ],
                                                "example": "sku_number",
                                                "type": "string"
                                            }
                                        },
                                        "type": "object"
                                    },
                                    "type": [
                                        "array",
                                        "null"
                                    ]
                                },
                                "code": {
                                    "description": "error/warning code",
                                    "example": "ERR1234",
                                    "type": "string"
                                },
                                "diagnostic_data": {
                                    "description": "",
                                    "type": "string"
                                },
                                "event_type": {
                                    "description": "event type",
                                    "enum": [
                                        "error",
                                        "warning",
                                        "info"
                                    ],
                                    "example": "error",
                                    "type": "string"
                                },
                                "message": {
                                    "description": "descriptive error/warning message",
                                    "example": "Example error message",
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        },
                        "type": [
                            "array",
                            "null"
                        ]
                    },
                    "line_items": {
                        "items": {
                            "description": "individual writeback line item",
                            "properties": {
                                "discount_amt": {
                                    "description": "Item discount amount (if any)",
                                    "type": "number"
                                },
                                "discount_pct": {
                                    "description": "Item discount percentage",
                                    "type": "number"
                                },
                                "order_item_id": {
                                    "description": "RetailOps order item ID (required)",
                                    "type": "integer"
                                },
                                "quantity": {
                                    "description": "Quantity of line item",
                                    "type": "integer"
                                },
                                "refnum": {
                                    "description": "The channel item refnum (required)",
                                    "type": "string"
                                },
                                "ship_amt": {
                                    "description": "Item ship amount",
                                    "type": "number"
                                },
                                "shiptax_amt": {
                                    "description": "item ship tax amount",
                                    "type": "number"
                                },
                                "unit_tax": {
                                    "description": "item unit tax",
                                    "type": "number"
                                },
                                "unit_tax_pct": {
                                    "description": "item unit tax percentage",
                                    "type": "number"
                                }
                            },
                            "required": [
                                "order_item_id",
                                "refnum"
                            ],
                            "type": "object"
                        },
                        "type": [
                            "array",
                            "null"
                        ]
                    },
                    "values": {
                        "properties": {
                            "discount_amt": {
                                "type": "number"
                            },
                            "discount_pct": {
                                "type": "number"
                            },
                            "shipping_amt": {
                                "type": "number"
                            },
                            "tax_amt": {
                                "type": "number"
                            },
                            "tax_pct": {
                                "type": "number"
                            }
                        },
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "title": "/order_update_v1"
        }
    ],
    "properties": {},
    "stability": "draft",
    "title": "/order_update_v1",
    "type": "object"
}