Webflow API requires exclusively integer pricing for ecommerce projects?

Dear Community,

I hope this message finds you well. I’m writing to seek clarification regarding the pricing requirements in the Webflow API, specifically regarding the handling of decimal places.

Recently, while working on integrating pricing data with the Webflow API, I encountered an issue where the API expects price values to be integers. This requirement contradicts typical pricing practices where decimal places are commonly used to represent prices accurately.

I’ve tried various approaches, including rounding the prices to integers before sending them to the API, using the numberParsing and formatNumber tools. However, this workaround results in pricing getting sent to the CMS Products collection as the decimal being misplace making the prices under a dollar instead of 28 or 42.

image

The error message from the API, “[400] Validation Error: [“Value (sku.fieldData.price.value)'s type should be integer”],” implies that the API only accepts price values without decimal places. This presents a challenge for maintaining pricing accuracy and consistency, especially when dealing with a large number of product entries.

I wanted to reach out to the community to see if others have encountered similar challenges and if there are best practices or recommended approaches for handling pricing with decimal places in the Webflow API. Any insights, experiences, or suggestions would be greatly appreciated.

Thank you for your time and assistance.

Best regards,
Sean

PS — I’m not sure what to show from my website for this but let me know if something would be helpful.

– EDIT –

Okay, I can’t even get it to output an accurate full price, round, integer. It just keeps shifting the decimal places over.

I’ve never seen a professional ecommerce system or banking system that uses decimals. The problems with rounding errors in most decimal-storage data structures are too great.

I haven’t looked at WF’s docs here, but check Stripe’s which is the underlying service for Webflow’s ecom. They’d express $10.00 USD as 1000

2 Likes

At this point I’m down to sell things at round numbers. But the API turns everything into under $1 lol — I tried it with another tool and it worked fine so I sent a screen video to support.

Only frustrating because now this is the last thing I have to go into every product to fix. Not that it is the first time Webflow API has necessitated that, defeating the purpose of API lol. Hopefully it is just a weird glitch. Maybe I’m using the parsing tool / formatting tool wrong… after hours of working with GPT learning it haha.

BUT I tried just entering round numbers that weren’t mapped from some other API and still does not enter into my Webflow product accurately.

IT WAS THE DANG FORMULA IN THE NOTION CELL.

I just made a plain number property field and put 3700 in it and shipped it to Webflow API and -boom- I have a 37 dollar product.

I guess I’m just going to be rounding everything up and selling goods at flat dollar amounts a like a bourgeois shop or one of those restaurants who don’t print prices on the menu because who wants to see that before they eat. Lol

Thanks for the reply!

Why would you round them?
3723 is $37.23

1 Like

oh my gd that damn robot had me parsing and formatting

saw this comment. mapped the notion formula cell to webflow’s price field and just added “*100” right in the freaking api module and that was it. worked perfectly

already made all my prices flat tho and sooorrt of like the design better.

cant believe how overcomplicated this became. i feel so asd hahaahhaha like gpt is my go to because usually it explains things in ways i understand bc i dont understand a human explanation – totally backfired this time. i even looked up a forum first and thats’ where someone mention parser and i went down that rabbit hole

1 Like

lord it even wrote this post for me hahahaha i half want to delete it and half dgaf what a weird series of events

thank YOU