rounding problems with api (orders)
-
Hi, we’re experiencing rounding errors with the API when transferring orders to another system. Orders in the database contain the correct tax amount with multiple decimal places. However, the API rounds this value to two decimal places. This causes rounding errors and incorrect amounts in the other system.
Example order with ID xxx in table wc_order_product_lookup, column tax_amount shows: 1.354545

When retrieving the same order from the API via /wp-json/wc/v3/orders/xxx, the values for subtotal_tax and total_tax are only: 1.35

Is this rounding intentional? And can I change this somewhere? We need the exact value with six decimal places from the API, exactly as it’s stored in the database.
Best regards, Anja
You must be logged in to reply to this topic.