I think we've figured out most of what's happening now. A few questions remain though:
Preferably, we'd like to simply sync the line item amount from the ecom store, overruling the calculation that is made (price * quantity) in HubSpot. The reason is that we don't get the single quantity prices from the ecom, but the total line item amount. Hence, in order for us to set the line item price in HubSpot, we'd need to divide that amount by the quantity, which possibly could lead to discrepancies in how the values are rounded.
So the question is if it somehow is possible to set line item amounts manually? Or do we have to set a price for a single quantity and let HubSpot calculate the amount? In our testing it seems like if we set the amount property to a value, it is treated as the price and multiplied with the quantity and put as the line item amount.
Just to provide an example, take a look at this deal: https://app.hubspot.com/contacts/4943257/deal/385619083/
Here we've made the following Json call:
Or compare with this “clean” example where we've only sent one call: https://app.hubspot.com/contacts/4943257/deal/387315027
On a related note, the price of the product that is referenced in this line item is set to $200 in the product library. How is this price used? It seems like it doesn't matter what the price is set to on a product level since it will be given a price on the line item anyway.