#tymm
1 messages ยท Page 1 of 1 (latest)
You specify it by the start_date of each phases
what if i wanna calculate the proration for the first month when the customer subscribes?
Hey! Taking over for my colleague. Let me catch up.
What do you mean? could you elaborate more ? prorated charges is a result of a change (upgrading/downgrading) in the subscription
hi i wanted to make customer pay upfront for a subscription basically
what are ur suggestions
and also, i will need to set billing cycle on 1st of every month
therefore, eg:
product 1 is $10/month
customer subscribe to product 1 on 15th of the month, so $5 for 1st month + $10 for next month, so $15 in total for the first invoice
automatic payment collection continues from the 3rd month onwards
When you create a subscription, the first invoice for the first month will be paid already:
https://stripe.com/docs/billing/subscriptions/build-subscriptions
You can do some tests in TestMode:
https://dashboard.stripe.com/test/subscriptions
Here you need to specify backdate_start_date to the 1st of the month if it isn't already
https://stripe.com/docs/api/subscriptions/create#create_subscription-backdate_start_date
yes i have already done that, its just that i want to charge customer for $15 on the first month like i said in the previous message
i was told that subscription schedule can help but after playing around with it i couldnt find a way to apply proration + charge customer for upfront payment
In that case you can set the billing_cycle_anchor to the first of the next month:
https://stripe.com/docs/api/subscriptions/create#create_subscription-billing_cycle_anchor
If you want to make your customer pay up front, then you can fetch the upcoming invoice of a customer and ask him to pay it using your integration:
https://stripe.com/docs/api/invoices/upcoming
The customers can pay it via this link in this attribute:
https://stripe.com/docs/api/invoices/object#invoice_object-hosted_invoice_url
๐ Stepping down for today, but @latent oak let's refer to Subscription Schedule use cases (https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases) and play around with the API a little bit more. Subscription Schedule is a powerful yet a bit difficult API, but it is basically the most flexible setup API
hi i've tried this but how do i pay for the upcoming invoice?
i tried getting the paymentintent of the upcoming invoice however it's null
Ok I think I made a confusion, the upcoming invoice is just an preview and you can't finalize it
In your case you need to use subscription_schedule:
1- Create a first phase with one Month and 15 days (from 15th of the current month to the end of the next month), the first invoice will include all the periode (5$ +10$)
2- Create a next phase of 1 month and which starts at the 1st of the month
for 1, i have tried to do that by setting startdate of "NOW" and enddate of 1st of nov, is this suffice?
for 2, do i do this while creating the schedule or must i update the schedule because i cant seem to set the startdate in create
and also how do i set the schedule to only renew the 2nd phase?
for 1, i have tried to do that by setting startdate of "NOW" and enddate of 1st of nov, is this suffice?
yes
for 2, do i do this while creating the schedule or must i update the schedule because i cant seem to set the startdate in create
When creating the subscription schedule
For each phase you can specify its start_date:
https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-start_date
im using SubscriptionScheduleCreateParams.Phase.builder() and i cant see setStartdate
this is the subid of the subscription i created with subscription schedule sub_1LmDSnLK0bfo5HSblZLepPoc
this is the code snippet
SubscriptionScheduleCreateParams params = SubscriptionScheduleCreateParams.builder()
.setCustomer(customerid)
.setStartDate(SubscriptionScheduleCreateParams.StartDate.NOW)
.setEndBehavior(SubscriptionScheduleCreateParams.EndBehavior.RELEASE)
.addPhase(
SubscriptionScheduleCreateParams.Phase.builder()
.addItem(SubscriptionScheduleCreateParams.Phase.Item.builder()
.setPrice(priceid)
.setQuantity(2L)
.build())
.setProrationBehavior(SubscriptionScheduleCreateParams.Phase.ProrationBehavior.CREATE_PRORATIONS)
.setEndDate(1667253600L)
.build()
)
.addPhase(
SubscriptionScheduleCreateParams.Phase.builder()
.addItem(SubscriptionScheduleCreateParams.Phase.Item.builder()
.setPrice(priceid)
.setQuantity(2L)
.build())
.setIterations(1L)
.build()
)
.build();
SubscriptionSchedule schedule = SubscriptionSchedule.create(params);
Hi! I'm taking over this thread.
Could you summarize what you are trying to achieve exactly?
im expecting the next invoice to come in nov 1?
You can set juste the endDate of the first phase, then the second phase with the normal 1 month interval will start just after, no need to specify the star_date either
yes, ive done that as u can see in this snippet incase u missed it
#1023862898562433024 message
hi i wanted to make customer pay upfront for a subscription basically
plus i will need to set billing cycle on 1st of every month
therefore, eg:
product 1 is $10/month
customer subscribe to product 1 on 15th of the month, so $5 for 1st month + $10 for next month, so $15 in total for the first invoice
automatic payment collection continues from the 3rd month onwards
i was advised to use subscription schedule to achieve this
Sorry, I was testing something,
SO after analyzing your creation request, it looks great so far:
https://dashboard.stripe.com/test/logs/req_5O7CZi2olZs1LV
a first phase until 31th of October and a second one for only one month
Now in order to force the customer to pay the first invoice, you need to finalize and pay the draft invoice atttached to the subsciption:
https://dashboard.stripe.com/test/subscriptions/sub_1LmDSnLK0bfo5HSblZLepPoc
Which is this one:
https://dashboard.stripe.com/test/invoices/in_1LmDSnLK0bfo5HSbgOPq0wzt
in order to pay it, you need to finalize it via API:
https://stripe.com/docs/api/invoices/finalize
in the response you'll get a PaymentIntent:
https://stripe.com/docs/api/invoices/object#invoice_object-payment_intent
Then you charge your customer
ive manually charged the customer for it, but im still seeing "next invoice on oct 26...", shouldnt the next invoice come on 1st of nov?
and also the amount charged was only for a month, it should be more than 280, with the prorated charges from today till 1st of oct
The price you are using is this one price_1LSwiJLK0bfo5HSbel7zQZah which is 140MYR/month, the first invoice is including 2 months
yes and no, i set the quantity to 2, so 280 is for one month
this is how i create the subscription schedule
I understand your issue, it's regarding the billing cycle anchor of the invoices. You want to bill in advance for the full next month with the remaining days of the current months. Then every first of the month you charge your customer. I'm doing some tests so far, but it looks not possible by default.
You can keep the actual invoice cycle month by month (starting from 26th), and let the subscription phases iterate separately by phases. At the end of the subscription schedule, the last period will be a prorated for the remaining days
ok i guess i'll find another way to do this, thanks for ur help today, talk to u later
if u have any new ideas regarding this please drop a message here, i'll be checking tomorrow. ๐