#matheusbrandao96
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Can you share the example Subscription ID?
SubscriptionCreateParams sub = SubscriptionCreateParams.builder().setCustomer(stripeCustomerId)
.addItem(SubscriptionCreateParams.Item.builder().setPrice(stripePriceId).build())
.setPaymentSettings(paymentSettings)
.setTrialPeriodDays(TRIAL_PERIOD_DAYS)
.setCancelAtPeriodEnd(true)
.setBillingCycleAnchor(billingCycleAnchor.getEpochSecond())
.setProrationBehavior(SubscriptionCreateParams.ProrationBehavior.NONE)
.setPaymentBehavior(SubscriptionCreateParams.PaymentBehavior.DEFAULT_INCOMPLETE)
.addAllExpand(Arrays.asList("latest_invoice.payment_intent"))
.build();
trial = 7 days
billingCycleAnchor = same day next month
Hi ๐
Could you please share the subscription ID that results from this? It'll start with sub_
Thanks, taking a look
ok
Oka so in this case you are creating a subscription that will start on 4/24/2023, with a 7 day free trial. Which means it will need to start billing on 5/1
But you set the billing cycle anchor to 5/24
That's the problem
The only way the subscription can do that is if it prorates, since you have the days between 5/1 and 5/24 to account for
If you wish to try a more complex timing for your subscriptions I recommend you look into using Subscription Schedules: https://stripe.com/docs/billing/subscriptions/subscription-schedules
They do add some complexity to how you create/update your subscriptions but they offer a greater degree of flexibility for non-standard use cases
If you start billing only on 01/05, you will not be charged for the previous 7 days. The period will run from 01/05 to 01/06, but I want it to stay from 04/24 to 05/24 with the possibility for the customer to cancel during the first 7 days. Do I need to charge the initial 7 days
No but you need to charge for the days after the initial 7 days, which you are not currently doing
so after the trial period (eighth day) do I charge for the 7 day price? After that, the subscription will normally be applied to the full amount on the eighth day. Thus generating 2 entries in the customer's invoice, one for the 7 days and the other for the monthly charge, correct?
We describe how this would be prorated here: https://stripe.com/docs/billing/subscriptions/trials#combine-trial-anchor
Essentially the customer would get a prorated invoice for the period between 5/1 and 5/24
So they don't pay for the 7 day trial
and, after the initial period they go to a billing cycle that repeats on the 24th
but i want it to be charged for the 7 days
But that's not how "free" trials work. So to accomplish this I think you would need to add that charge in the form of an add_invoice_items : https://stripe.com/docs/api/subscriptions/update#update_subscription-add_invoice_items
The 7-day period I want to offer is for free cancellation, but if the customer doesn't cancel, the 7 days will be included in the normal period of the month.
If the customer registered on 05/01, he has until 05/07 to cancel, if he does not cancel, he will be charged the total amount referring to 05/01 until 05/31
You would add an item that represents the charge for the 7 days that would be billed after the trial period
In this way, 2 items would be posted on the invoice? with add_invoice_items?