#tymm
1 messages ยท Page 1 of 1 (latest)
Gimme a few mins to catchup with the thread
Okie how about this
Let's say today is Sep 27. You create 2 phases:
- Phase 1 from now(Sep 27) to Oct 1, price = 10$
- Phase 2 from Oct 1, same price, setting
billing_cycle_anchor: 'phase_start', same price = 10$
This way, you will immediately have an Invoice 1 of $10, then on Oct 1 will have a prorated Invoice 2 of -($10-around $9 for unused time) + another $10
The total would be around 11$ which is for Sep 27 -> Nov 1
And from Nov 1 it will be a normal monthly $10
If you want to, furthermore, combine Invoice 1 and Invoice 2, you can apply a 100% discount on Invoice 1, then add an additional item of $10 on Invoice 2
It's a complicated setup TBH
ok thanks
btw is there docs that list out all the stripe callbacks? i cant seem to find them online
like invoice.finalized charge.succeeded etc
You mean webhook events?
yeah all of them
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
how do i make this happen? do i set endbehaviour to renew for this?
hi this is the subscription that i have created with schedule sub_1LmTT5LK0bfo5HSbeO0gowtI
now how do i combine the invoices?
Okie, now you have 2 Invoices, correct?
in_1LmTT5LK0bfo5HSbC7tfSV5u in draft and will be finalized in 1 hour
and an upcoming Invoice on Oct 1
seems so, yeah
Now you apply a 100% discount to in_1LmTT5LK0bfo5HSbC7tfSV5u while it's still in draft
if i have multiple subscriptionitems in the subscription and in my use case i want all of them to be 100% off so i can just set discount on the invoice level, right? or do i need to set them at invoiceitem level?
Yes I think so (please test it out)
yes im testing as we speak ๐
ok whats next? how do i get the next invoice?
It would be a bit complicated. You will need to save/memory the task somewhere in your database. In the future when the UpcomingInvoice created and send a webhook event to you, you catch it and modify while in draft state, by adding an invoice item of $10
erm but i want to charge customers immediately, since i want an upfront payment so charging them later during the billing cycle doesnt make sense...
like, on Sep 27 instead of Oct 1?
yep
Okie taking back the step of adding 100% discount.
Instead, you call the Upcoming Invoice to see the prorated amount "RM17.81", then add an invoice item into the current Invoice of "RM140.00"
then in future, make sure to discount them 100%
so you will invoice them RM157.81 today, but will bill RM0 (discounted) on Oct 1
i see
may i know what are the circumstances and use cases to create subscription schedule from an existing subscription?
is it possible to shcedule subscriptionitems updates eg:
customer have existing subscription and i want to update the subscriptionitems in the subscription in 2 months (november cycle)