WooCommerce webhook price field to long
-
So I have been using webhooks in WooCommerce which passes on orders automatically to our ERP software. However today I had a webhook which caused an error due to the price being to long.
We never showed taxes to our customers before, but since a few weeks we do and WooCommerce calculates these taxes themselves. Which can cause prices to have a high amount of decimals. The webhook uses this information and somehow has a limit of a price to be not more than 10 characters.
I got the following error in the webhook log:
[Body] => {"code":400,"message":"The \"price\" field is too long and should be 10 characters"}
When I look at the price part in the webhook, it shows the following in which you can see the long price:
\"subtotal\":\"148.44\", \"subtotal_tax\":\"13.36\", \"total\":\"148.44\", \"total_tax\":\"13.36\", \"taxes\":[{\"id\":1,\"total\":\"13.359633\", \"subtotal\":\"13.359633\"}], \"meta_data\":[],\"sku\":\"ABCT002\", \"price\":37.110091750000002}], \"tax_lines\":[{\"id\":12519, \"rate_code\":\"NL-BTW-1\"
Anybody know if this can be overruled of has another solution to this problem?
- The topic ‘WooCommerce webhook price field to long’ is closed to new replies.