#bugkiller.
1 messages ยท Page 1 of 1 (latest)
Yeah it won't affect any already-created Subscriptions
Only new Subscriptions will be affected
ah, so it's ok to delete this trial period from price.
Yep
what about refund?
I mean, I want to have refund button in my dashboard (backend is python)
so admin click the refund button, then we will just refund and then cancel subscription for user
Hi there ๐ jumping in as my teammate needed to step away.
Can you elaborate on what you're hoping to accomplish when you say "we will just refund" with regards to a Subscription? Is that refunding all previous Invoices, only some of them, or possibly something else?
user made subscription but sometimes, tehy asks for refund
they say like made subscription by accidently
so I want to give our website admin to manage this easily
what I want to do is
refund stripe invoice made by subscription and cancel that subscription
Gotcha, I believe you can use this endpoint to Refund the undelrying Charge of the Invoice:
https://stripe.com/docs/api/refunds/create
I'm not sure whether you'll want to use Credit Notes as part of your flow, but would recommend taking a look through here to check whether they're relevant.
https://stripe.com/docs/invoicing/integration/programmatic-credit-notes
You can then use this endpoint to cancel the subscription:
https://stripe.com/docs/api/subscriptions/cancel
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok, thanks for giving me a link.
let me check
Can I make a refund based on invoice?
like refund specific invoice id
100% not partial
Not by creating a Refund, you would need to create a Credit Note to initiate a refund using an Invoice ID.
not sure yet
didn't catch about credit note
my purpose is just refund specific invoice
not partial refund . just total for that invoice
The second document I linked previously walks through how to create a Credit Note, when doing so you can provide the ID of an Invoice to trigger a refund for that already paid Invoice.
trigger a refund?
Indirectly, you create a Credit Note which will create a Refund:
https://stripe.com/docs/invoicing/integration/programmatic-credit-notes
why refund amount here?
Is there any way for refund like 100%
full refund for that invoice
why I need to specify the refund amount
Hm, I'm thinking Credit Notes may be more than you're after.
Once I create a credit note for refund, refund will be done asap?
Instead, let's pivot back to talking about Refunds directly.
You can't provide the ID of an Invoice when creating a Refund, instead you will need to find the associated Charge object.
On the Invoice object there is a reference to the associated Payment Intent, in the payment_intent field. Then the Payment Intent object will have a latest_charge field with the ID of the Charge object associated with it.
https://stripe.com/docs/api/invoices/object#invoice_object-payment_intent
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-latest_charge
but please let me know if during your testing you find that is not doing what you're hoping.
what if payment_intent is null for invoice?
Then the Invoice hasn't been paid or is a zero-dollar Invoice, and there isn't anything to refund.
you mean, payment_intent will never be null if it's paid invoice?
It will be null if it's a zero-dollar Invoice that didn't require payment to move into a paid state. Do you have a specific example you're looking at, or is this a hypothetical question?
just asking to know not about specific invoice question
then for now let me try and then will ask again ๐
thanks for your kind answers.
Gotcha, totally understand. Was just curious if there was a specific example to look at as a reference so we could discuss that specifically.
Glad I could help! If any of that doesn't accomplish what you're hoping, you know where to find us ๐
if we make refund as you explained, it will make an update for invoice object as refunded?