Stripr API response returns 100.00 as 10000

2,103 views
Skip to first unread message

Sumit Sharma

unread,
Sep 11, 2014, 11:37:03 AM9/11/14
to api-d...@lists.stripe.com
Hi,

In my all Stripe API response that has amount in them, the amount is without '.' in the numeric value and adding the trailing '00' to the amount. 
If i have a plan for $399.00, when i get response for charge.succeed or other response types i get Amount as 39900. Even in response shown in stripe logs shows the amount without decimal point.  

I am using stripe in 'Test' mode and with 'Test Secret Key'. Working in Asp.net MVC 4. 

Please help how can i correct this. I am new to stripe API.

Michaël Gallego

unread,
Sep 11, 2014, 11:38:29 AM9/11/14
to api-d...@lists.stripe.com
Hi,

This is expected and perfectly normal. Stripe expresses amount in cents. So 39900 is actually 39900 cents (so 399 dollars).

Matthew Arkin

unread,
Sep 11, 2014, 11:41:45 AM9/11/14
to api-d...@lists.stripe.com
Just to expand this answer slightly for people coming across this thread via google. From the docs https://support.stripe.com/questions/which-zero-decimal-currencies-does-stripe-support 

Stripe accounts in the US and Europe support a number of currencies. To create a charge in any of these currencies, you need to provide the amount in the smallest common currency unit. For most, this is the amount in cents (or pence, or similarly named unit). For example, to create a charge for €1.00, you would set amount=100(100 cents).
For zero-decimal currencies, we use the regular denomination. For example, to charge ¥1, you should setamount=1 (1 JPY), since ¥1 is the smallest currency unit.

So in the dashboard when you set a plan to $399.00 it automatically makes the proper API call of 39900. The Dashboard does some UI prettiness where it displays dollars and cents instead of just cents.

Matt
On Sep 11, 2014, at 8:38 AM, Michaël Gallego <mic.g...@gmail.com> wrote:

Hi,

This is expected and perfectly normal. Stripe expresses amount in cents. So 39900 is actually 39900 cents (so 399 dollars).

--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.
To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at http://groups.google.com/a/lists.stripe.com/group/api-discuss/.

To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.

signature.asc

Sumit Sharma

unread,
Sep 11, 2014, 11:44:02 AM9/11/14
to api-d...@lists.stripe.com
Thanks :) 

Should have read API docs more deeply. 

Regards,
Sumit Sharma

On Thu, Sep 11, 2014 at 9:08 PM, Michaël Gallego <mic.g...@gmail.com> wrote:
Hi,

This is expected and perfectly normal. Stripe expresses amount in cents. So 39900 is actually 39900 cents (so 399 dollars).

--
Reply all
Reply to author
Forward
0 new messages