#OptimalSurprise - Decimal Price

1 messages ยท Page 1 of 1 (latest)

soft breach
#

Hi ๐Ÿ‘‹

#

You cannot. Stripe only accepts integers as amounts

#

If you need to represent decimals in your integration you will need to convert to an integer value prior to submitting data to Stripe

brittle surge
#

Hmm but according to the documentation it should take a decimal to 12 decimal places?

soft breach
#

Oh, unit amount...sorry. I was thinking price. Is this for usage based pricing?

brittle surge
#

yes correct

#

stripe.Price.create with billing scheme of metered

#

sorry per unit

soft breach
#

And do you have failing requests to set the amount?

brittle surge
#

yes

#

so I get invalid integer 0.001 for instance

soft breach
#

Can you share a request ID?

brittle surge
#

yes

#

req_cp3O8N4rXyUC06

soft breach
#

Thanks, looking

brittle surge
#

np thank you

soft breach
brittle surge
#

hmm really? i am seeing unit decimal in my function

soft breach
#

In the request BODY it's passing in unit_amount

#
tiers: {
    0: {
      unit_amount: "0.001",
      up_to: "10000"
    },
    1: {
      up_to: "inf",
      unit_amount: "0.001"
    }
  }
brittle surge
#

wow that is weird

#

ok i'm looking into this rn

#

thank you for picking this up

soft breach
#

NP, that's why we like to look at the API requests so we can see that stuff.

brittle surge
#

AMAZING!!!!

#

thank you for fixing this

soft breach
#

I'm glad it was such an easy fix ๐Ÿ™‚

brittle surge
#

I am too haha

#

thank you so much

soft breach
#

Happy to help ๐Ÿ‘