#itxve-subscription

1 messages · Page 1 of 1 (latest)

sterile narwhal
#

👋 Happy to help

#

Are you referring to subscription integration with Stripe?

analog tundra
#

yeah

sterile narwhal
#

itxve-subscription

analog tundra
#

I can't find refund information in my subscription

sterile narwhal
#

Could you share the scenario when the refund of a subscription will happen? Is it due to downgrading or cancelling a subscription?

analog tundra
#

I want to cancel my subscription and get a gold star refund for my most recent bill, probably because the user forgot to cancel the subscription

sterile narwhal
#

Cancelling a subscription doesn't refund automatically. The fund will be credited to customer's balance which customer can use for the next invoice: https://stripe.com/docs/billing/customer/balance

If you wish to refund the credits in customer's balance, then you can:

  1. Find the invoice list of a subscription and expand the charge field: https://stripe.com/docs/api/invoices/list
    https://stripe.com/docs/api/expanding_objects
  2. Create a refund on the charge for up to the amount of customer's balance obtained from Step 1: https://stripe.com/docs/api/refunds/create
  3. If the charge amount is smaller than the credit, refund fully and subtract the charge amount from the credit
    4.Move to the next invoice in the list until the full credit has been refunded
  4. Update the customer’s balance back to 0: https://stripe.com/docs/api/customers/update
analog tundra
#

I recorded invoiceId from invoice.paid webhook, which means that I can find charge from invoice and perform refund operation

sterile narwhal
#

Yes, you can refund from the charge here. After refund the customer, please also update customer's balance back to 0

analog tundra
#

I have two more questions about the refund.

  1. I can find the charge of each bill, can I refund each one?
  2. Do I need to process a refund for the same charge multiple times, or the stripe has already been processed, and the same bill can only be refunded once
sterile narwhal
#

I can find the charge of each bill, can I refund each one?
You can refund the amount up to the original charged amount for each charge. If the charged amount is $10, you can refund up to $10 (it'll fail if you refund $11).

#

Do I need to process a refund for the same charge multiple times, or the stripe has already been processed, and the same bill can only be refunded once
Refund can be performed multiple times up to the charged amount. For example, you can refund $1 three times for a charged amount of $5

analog tundra
#

I understand
please also update customer's balance back to 0, means, I can always charge the order until the amount is 0

sterile narwhal
#

When a subscription is cancelled, the refund amount will be credited to customer's balance: https://stripe.com/docs/billing/customer/balance

After you refund the amount, customer's balance does not change since the refund is directly on the charge and it has no knowledge about customer's balance. You'll need to update customer's balance back to 0 (https://stripe.com/docs/api/customers/update). If you don't update the customer's back to 0, the credit will be used in the next invoice, i.e. customer will pay less in the next invoice.

analog tundra
#

thx,I read the documentation more.

sterile narwhal
#

No problem! Happy to help 🙂