How to send even line item unit price

Leif_Leroy
New Member
4 0 0

Hello!

I am currently facing a challenge with sending line items over to shopify. In this example I purchased a single item with a quantity of 3 for 5 dollars. The line item price should be 1.6666666666666666666666666666667, but when I send this to Shopfiy's Order's API they round it to 1.67 thus showing an incorrect grand total. Instead of $5 shopify reads $5.01 since they're rounding the price values sent to them from an external source (kind of dumb if you ask me). They should do the calculation and round the final result, not round the inputs before calculation is done.

Is there any current work-around for this? It screams "BUG" to me since their API is manipulating line_item inputs without consideration that those values have to be accepted exactly as they are sent. Since I cannot get proper price sent over I am subjected to legal issues since Shopify is sending an invalid order confirmation email with a price they derived on their own without letting me set my prices.

Reply 1 (1)
csam
Shopify Staff
Shopify Staff
267 40 43

Hi @Leif_Leroy 

This is a current limitation of how discounted line items are rounded, I understand it is not behaving how you expected it to. Thanks for letting us know how this affects you - I will pass this along to our product team for future consideration.

 

CS | API Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog