#idhruv
1 messages · Page 1 of 1 (latest)
👋 Thanks for reaching out
Yes you can refund that PaymentIntent using refund API:
https://stripe.com/docs/refunds
https://stripe.com/docs/api/refunds/create
const refund = await stripe.refunds.create({ payment_intent: 'pi_Aabcxyz01aDfoo', amount: 1000, });
this will work?
Otherwise, why aren't you using Stripe Subscription without managing PaymentIntent and invoices on your own?
Take a look at this if you think it may helps you
https://stripe.com/docs/billing/subscriptions/build-subscriptions
For your case, you can specify a proration behaviour
https://stripe.com/docs/billing/subscriptions/prorations
Yes, if you want to refund partial amount you can specify it, otherwise pass just the PaymentIntent Id:
https://stripe.com/docs/refunds#api
what happens exactly if i dont specify amount and use just this one liner await stripe.refunds.create({payment_intent: 'pi_Aabcxyz01aDfoo'});
actually, our setup is custom setup with its own payment screens and behavior. I am reading about how proration can help me here
It will refund all the amount of that PaymentIntent to the customer
okay
I am not able to understand how prorations can help me here?
right now in my case prorations are set to none, proration_behavior: 'none'
while creating subscription schedule
and I am using subscription schedule, not just subscriptions
Even with subscription_schedule you can specify proartion behaviour, it can be set for each phase:
https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases-proration_behavior
but it'll depends on your business, if the user cancels the subscription in the middle of the month for example and you want to refund the user all the charged amount, then you need to use refund API and not proration