#anoush_72862

1 messages · Page 1 of 1 (latest)

forest wrenBOT
carmine crest
jagged stream
#

what will happen when the customer is deleted?

carmine crest
#

No you can't delete a customer if its credit balance is not 0

jagged stream
#

how handle cases when user has positive credit balance but want to cancel subscription?

carmine crest
#

What do you want to achieve? do you want to refund the customer?

jagged stream
#

yes

#

I am using billing portal

carmine crest
#

You need to implement the following

  • Retrieve the Customer's Credit Balance and/or sum pending invoice items
  • Using the List Invoices API, pass the Subscription ID in the subscription parameter to view Invoices for that Subscription ID only
  • You'll then need to expand the associated charge
  • Then, for each invoice:
  • Locate the associated charge
  • Create a refund for up to the amount of the Customer's Credit Balance
  • If the charge amount is smaller than the credit, refund the full credit amount and minus the charge amount
  • Move to the next invoice in the list until the full credit has been refunded
  • Update the customer’s account balance back to $0.00 via the API, by deleting the pending invoice items, or by modifying the balance directly through the Dashboard