#OptimalSurprise - Decimal Price
1 messages ยท Page 1 of 1 (latest)
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
Hmm but according to the documentation it should take a decimal to 12 decimal places?
Oh, unit amount...sorry. I was thinking price. Is this for usage based pricing?
And do you have failing requests to set the amount?
Can you share a request ID?
Thanks, looking
np thank you
Ah, you were using the unit_amount parameter. Can you try using the unit_amount_decimal instead?
https://stripe.com/docs/api/prices/create#create_price-tiers-unit_amount_decimal
hmm really? i am seeing unit decimal in my function
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"
}
}
NP, that's why we like to look at the API requests so we can see that stuff.
I'm glad it was such an easy fix ๐
Happy to help ๐