#trueinviso

1 messages · Page 1 of 1 (latest)

near arrowBOT
prime anchor
#

When you say "users receive credit to use on the site", where do you want them to be able to apply that credit? To their Subscription? Or to other one-off products?

full lichen
#

The credit is used internally for taking classes, so if they have a subscription that gives them $50 in credit on our site per month, they might use $20 and then decide to upgrade to a pro plan that gives them unlimited classes and costs $125, so they should receive a discount of $30. $50 - $20 of used credit.

#

actually this scenario is even more complicated, I need to keep the same billing cycle as well, so if there is 15 days left in the month, we'd want to prorate 15 days for the pro plan and discount $30 off that prorated amount.

prime anchor
#

Ah, okay. Stripe doesn't have a credit system that would allow for that. You would need to track credits on your end and then use your own system's logic to apply the discount.

full lichen
#

Right, I'm already tracking the credit on my side, just trying to understand how I would apply the discount

#

Since this amount will be changing, it doesn't seem that I can use a coupon

prime anchor
#

Coupons would likely be a bad fit for this anyway, so it would be best to just create an Invoice Item for a negative amount (on the fly) and attach that Invoice Item to whichever Invoice you want to discount for your Customer

full lichen
#

is schedules a bad fit for this then?

#

I guess I"m not sure when I'm able to grab an invoice for the new phase I'm moving them to

prime anchor
#

Schedules could work, it would just be more complicated, so if you don't need Subscription Schedules for some other aspect of your integration, then I'd just stick to regular Subscriptions without an attached Schedule

full lichen
#

I have one scenario where subscriptions go on hold that I need them. But outside of that, if someone does a downgrade, and you want it to take effect at the end of the billing cycle, can that only be done with a subscription schedule?

prime anchor
#

I was just drafting a reply for a workaround, but I think I explained my way out of it and it won't actually work. Setting future updates on Subscriptions is difficult/impossible to do without Subscription Schedules unfortunately

full lichen
#

well upgrades happen immediately, so I don't need schedules for those, downgrades don't require discounts so I can keep those using schedules

#

so maybe on upgrades I just do a normal subscription update and attach the discount to the invoice as you suggest

#

Is there some documentation you could point me to on how to do this?

prime anchor
#

I don't think we have docs that capture this specific use-case, but it's as simple as creating an Invoice Item with a negative amount attribute (https://stripe.com/docs/api/invoiceitems/create) and setting the specific Invoice that you want it to apply to using the Invoice ID with the invoice attribute (https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-invoice)