#network
1 messages ยท Page 1 of 1 (latest)
๐ @dire folio How can I help?
hey river
simple question: after cancelling a subscription, with Prorate
trueand InvoiceNowtrue, it cancels the subscription and it invoices the amount for the customer, now how to refund the customer?
@stoic pivot
You may issue a credit note to refund to the customer: https://stripe.com/docs/invoicing/dashboard/credit-notes
Or you can refund the amount on the Payment Intent of the invoices: https://stripe.com/docs/refunds?dashboard-or-api=api#issuing
ok but the issue is the last_invoice has no paument intent nor charge
i try already
.AddExpand("latest_invoice")
.AddExpand("latest_invoice.charge")
.AddExpand("latest_invoice.payment_intent")
see this
chagre is empty, same for pi
no ids even
Can you share the invoice ID (in_xxx)?
Thanks for waiting! Discord is busy now
in_1NXvYxK9PgQOuTLU9mGwspPH is in draft status. Only when the invoice is finalised, payment intent will be available
In the case of in_1NXvYxK9PgQOuTLU9mGwspPH, the amount is -US$480.00 that the amount will be applied to customer balance after the invoice is finalised and no Payment Intent will be created. You may perform refund on the previous invoices in_1NXvYaK9PgQOuTLUjXYrtDSq and in_1NXvYoK9PgQOuTLUmVDNGqeX and adjust the customer balance.
Customer balance: https://stripe.com/docs/billing/customer/balance
ok so do you mean i first need to "finalize" the invoice, then i can use the pi generated on it to refund the customer?
- if i can do that then why i need to refund previous invoices?, the thing is after the subscription is cancelled, i get this invoice id, then i need to only work with THIS invoice id, not other stuff
you get my point?
if this is doable then it will be great
if so how can i finalize the invoice to proceed?
ok so do you mean i first need to "finalize" the invoice, then i can use the pi generated on it to refund the customer?
In usual case, finalising an invoice will generate a Payment Intent if the final charge amount is larger than $0.
Sorry for the confusion as I didn't check the amount for in_1NXvYxK9PgQOuTLU9mGwspPH prior to typing this line and only noticed that in the next line.
The steps will be:
- Finalise the invoice: https://stripe.com/docs/api/invoices/finalize and ensure that the amount has been credited to customer balance. Stripe doesn't perform refund on the negative amount, so your system should refund the amount on previous balances or issuing credit note
- Determine the refund amount and refund it on the previous invoices with refund API (https://stripe.com/docs/refunds?dashboard-or-api=api#issuing) or credit note (https://stripe.com/docs/invoicing/dashboard/credit-notes)
if i finalize the invoice, i can directly use the same invoice id to issue credit note as refund for the customer?
Credit note can only be applied on the invoices that is larger than $0. In in_1NXvYxK9PgQOuTLU9mGwspPH, the amount is negative, so the credit note can be issued on this invoice, but only on the previous positive ones
ok but how should i get the previous ones that are exactly related to this cancelled subscription that i need to refund the customer for? @stoic pivot
You may use List Invoice API with subscription field set: https://stripe.com/docs/api/invoices/list#list_invoices-subscription to get the invoices related to this subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.