Title: Edit orders: Integer / Float Values
Last modified: June 27, 2022

---

# Edit orders: Integer / Float Values

 *  Resolved [fruchtbote](https://wordpress.org/support/users/fruchtbote/)
 * (@fruchtbote)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/edit-orders-integer-float-values/)
 * Hi WooCommerce support,
 * We are developing custom software to access the data in WooCommerce via the API
   provided by WC.
 * One of the core features of the software is the ability to edit orders, in particular
   their line items. Of those line items we often need to make the quantity a float
   value, like 5.2 or 7.6.
 * When we do it through the WooCommerce interface, we can easily make quantities
   float values.
 * However we’ve run into a roadblock, which is that when we try to do the same 
   through the API, we get a 400 error.
 * Our WordPress installation is in German so forgive the German error message:
 *  {‘code’: ‘rest_invalid_param’, ‘message’: ‘Ungültige(r) Parameter: line_items’,‘
   data’: {‘status’: 400, ‘params’: {‘line_items’: ‘line_items[0][quantity] ist 
   nicht vom Typ integer.’}, ‘details’: {‘line_items’: {‘code’: ‘rest_invalid_type’,‘
   message’: ‘line_items[0][quantity] ist nicht vom Typ integer.’, ‘data’: {‘param’:‘
   line_items[0][quantity]’}}}}}
 * As you can see, the error from WC is that the quantity is not an integer, in 
   other words float values are not allowed.
 * But again, when we do it through the web interface, float values are actually
   allowed.
 * Could you please help us in working around this issue? An idea we had was maybe
   some hook/filter we could hook into to override the validation of the quantity
   parameter using a must-use plugin, but we weren’t sure which hook/filter to use
   for that.
 * Could you help us solve this? Or point us in the right direction?
 * Thank you very much.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fedit-orders-integer-float-values%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Rashed Ripon (a11n)](https://wordpress.org/support/users/rur165/)
 * (@rur165)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/edit-orders-integer-float-values/#post-15773493)
 * Hi [@fruchtbote](https://wordpress.org/support/users/fruchtbote/) ,
 * I understand you want to edit orders using API and you’re having trouble using
   float/decimal values for the product quantity field, right?
 * Out of the box, WooCommerce doesn’t support float values for quantity so I am
   not exactly sure how it works on your installation. Are you using a separate 
   plugin or custom code to allow that?
 * There is some alternative solution that you can try as explained in this thread:
   [https://wordpress.org/support/topic/update-order-float-quantity/](https://wordpress.org/support/topic/update-order-float-quantity/)
 * Otherwise, the changes required are beyond the scope of our [support policy](https://woocommerce.com/support-policy/)
   as this will require customization.
 * I’ll keep this thread open for a little longer to see if anyone else can chime
   in to share any other hints.
 * We have our developer resources portal that can help you get going, so I would
   recommend you to check it further from here: [https://developer.woocommerce.com/](https://developer.woocommerce.com/)
 * You can also visit the [WooCommerce Community Forum](https://wordpress.org/support/plugin/woocommerce/),
   the [WooCommerce FB group](https://www.facebook.com/groups/advanced.woocommerce/),
   or the `#developers` channel of our [Community Slack](https://woocommerce.com/community-slack/).
   We’re lucky to have a great community of open-source developers for WooCommerce,
   and many of our developers hang out there, too.
 * Another option is to check our customizations page to hire an expert that can
   create a custom solution for you: [https://woocommerce.com/experts/](https://woocommerce.com/experts/)
 * Thank you.
 *  [MayKato](https://wordpress.org/support/users/maykato/)
 * (@maykato)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/edit-orders-integer-float-values/#post-15807484)
 * This thread has been inactive for a while, so I’m going to mark this as resolved–
   if you have any further questions, you can start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Edit orders: Integer / Float Values’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [decimals](https://wordpress.org/support/topic-tag/decimals/)
 * [edit orders](https://wordpress.org/support/topic-tag/edit-orders/)
 * [float](https://wordpress.org/support/topic-tag/float/)
 * [quantity](https://wordpress.org/support/topic-tag/quantity/)

 * 2 replies
 * 3 participants
 * Last reply from: [MayKato](https://wordpress.org/support/users/maykato/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/edit-orders-integer-float-values/#post-15807484)
 * Status: resolved