• Resolved emda

    (@emda)


    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?

    • This topic was modified 4 years, 7 months ago by emda.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @emda!

    This error isn’t coming from the core WooCommerce plugin. You mentioned that you are using ERP software. Which one would that be, and have you contacted the provider to see if they have a solution for you?

    Cheers!

    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Howdy.

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please start a new thread.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WooCommerce webhook price field to long’ is closed to new replies.