#jeffnv-schedule-sub-update

1 messages ยท Page 1 of 1 (latest)

neon bison
#

Hi there!

proven crystal
#

Hey bismarck!

neon bison
proven crystal
#

๐Ÿค˜

#

thank you

neon bison
#

Sure thing!

proven crystal
#

ooh nice, it looks like I can backdate a subscription too

#

could I use this to update a subscription retroactive to the beginning of the current cycle and charge them immediately?

neon bison
#

Yes, you can do that without Subscription Schedules as well. Just need the Subscription API for that

#

Hrmm not exactly sure what you mean by that last part

proven crystal
#

ok so i have 2 subscription products

#

license, and upgrade pack

#

everyone has 1 license

#

but people can add/remove upgrade packs

#

minimum of 0

#

if on day 1 I start with zero, day 10 add 1 pack, i'd like to charge them on day 10

#

and on day 20 they decide they dont' want it, refund on day 20

#

however many they end the month with should be recurring

neon bison
#

Hmmm

proven crystal
#

but the critical rule is that whatever change you make mid month, you pay or are refunded right then

neon bison
#

You can't really charge here without changing the billing cycle anchor

proven crystal
#

right that's what I observed

neon bison
#

So

#

Instead

proven crystal
#

workaround i was going to do was to have another product, an ad-hoc product that we charge them for right then

neon bison
#

You would use one-off invoices for this

proven crystal
#

and upon success set the schedule

neon bison
#

And add invoice items

proven crystal
#

ok! so i can invoice them for the ad-hoc non-recurring product

neon bison
#

Right

proven crystal
#

I don't understand the subscription key

#

how is this related to a subscription? is it not just a customer?

neon bison
#

It will link the invoice into the Sub

#

So when you view the Subscription you will see that one-off invoice as well

#

You don't have to do this

#

But if you want to keep it all together you can

proven crystal
#

oh ok, but when i query the subscription i can see the invoice

neon bison
#

Right

proven crystal
#

yes that was a big problem i was having, after checkout completed i couldn't figure out what was purchased

#

i could only see that customer cus_1234 paid 1000

#

but for what?

neon bison
#

Well there are various ways to solve that

proven crystal
#

๐Ÿ‘‚

neon bison
#

The most common way is to use metadata

#

You attach metadata to your flow to link to an order ID

#

So that you can reconcile with your database and handle fulfillment

proven crystal
#

metadata attached to which object?

#

the price of the item i invoiced?

neon bison
#

You are using Stripe Checkout?

#

What integration flow?

proven crystal
#

stripe.checkout.Session.create...

#

in ๐Ÿ

neon bison
#

This will carry the metadata down to the Sub object

proven crystal
#

and ultimately this will be posted to me in a webhook?

#

checkout session complete or something?

neon bison
#

It will come through on the customer.subscription.updated webhook.

#

Which would come through via checkout.session.completed

proven crystal
#

ok ok!

neon bison
#

So just depends on what you want to listen for and how you want to handle your data

proven crystal
#

im used to just inspecting the subscription items

#

unfamiliar territory for me

#

ok you've given me lots of new tools thank you

#

im sure I'll be back again!

#

CEO want's it 'just so'

neon bison
#

Sounds good! We'll be here