#network

1 messages ยท Page 1 of 1 (latest)

native daggerBOT
stoic pivot
#

๐Ÿ‘‹ @dire folio How can I help?

dire folio
#

hey river

#

simple question: after cancelling a subscription, with Prorate true and InvoiceNow true, it cancels the subscription and it invoices the amount for the customer, now how to refund the customer?

#

@stoic pivot

stoic pivot
dire folio
#

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

stoic pivot
#

Can you share the invoice ID (in_xxx)?

dire folio
#
in_1NXvYxK9PgQOuTLU9mGwspPH
#

@stoic pivot

stoic pivot
#

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

dire folio
#
  • 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?

dire folio
#

if so how can i finalize the invoice to proceed?

stoic pivot
#

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:

  1. 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
  2. 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)
dire folio
#

if i finalize the invoice, i can directly use the same invoice id to issue credit note as refund for the customer?

stoic pivot
#

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

dire folio
#

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

stoic pivot