#Darby-credit-purchase
1 messages ยท Page 1 of 1 (latest)
Hi there! Can you explain a little bit more what you mean by that and exactly what you are trying to do?
So in our system we have users with credits, we want to apply this to a transaction. But they still need to taxed for the entire price. Is that a thing?
So you want to apply tax on top of the transaction amount?
errr, yes? OK so my user has $100 dollars in credits in my system. And they purchase something for $200. So I only want to charge them $100, and pay the taxes for the entire $200 purchase
How are you representing the $100 credits within Stripe? Are you taking that payment up front? Are you using customer balance?
I haven't gotten that far yet? The customer balance probably wont be in Stripe
Okay then you would need to calculate this yourself when you create the PaymentIntent to charge your customer.
That sounds right
I just dont know how to set it so that the tax should be on the entire amount, and not the subtotal
You likely want some conditional statements when you calculate the amount you want to charge.
sure, can you tell me what fields i should look into?
Well not really... you would calculate the amount and then input it into the amount for the PaymentIntent you are creating: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-amount
right, i just dont know how to set the tax for the full amount
To clarify... you wouldn't use the Stripe API to calculate amount here. You would write your own code to do so and then send that amount to the Stripe API
I think you are insinuating that you want Stripe to calculate the tax for you?
yeah
is there like a discount field or something? where i say the amount is 200, but there's a discount of 100, but the tax is for the entire 200?
Okay so yeah this isn't really how Stripe Tax works... the hacky workaround would be to preview an invoice for the amount that you want to charge tax on in order to see how much tax would be calculated. Then you would create the PaymentIntent based on that preview tax amount. I recommend reading through our docs on Stripe Tax to familiarize with how it works: https://stripe.com/docs/tax
OK
Ah yes, you could use coupons if you want to go that route
ty
You can add discounts upon Checkout Session creation: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-discounts
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
are discounts applied pre or post tax?
So it looks like i'll have to create a coupon before applying it as a discount?
OK, i can do that
Yes or you can provide promo codes
So your customers can enter the coupon themselves
gotcha