Functions
The receiver can only accept unit prices with two decimals. The sender's system is using up to four decimals. In order to transmit four decimals, the receiver is allowing a "price basis factor" to be transmitted. The price basis factor is the quantity the transmitted unit_price refers to. Example:
This is how real unit prices with more than two decimals can be transmitted to the receiver.
For each line item, create an object containing the product_id as well as a unit_price and a price_basis. If the unit_price has more than two decimals, use a price_basis of 100 and a unit_price of x*100 to transmit the remaining decimals.
Note: The input uses strings instead of numbers for the unit_price which will have to be cast to numbers before you can do calculations.