#matheusbrandao96

1 messages ยท Page 1 of 1 (latest)

inner coralBOT
cursive girder
#

Hello ๐Ÿ‘‹
Can you share the example Subscription ID?

fallow pond
#

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

inner coralBOT
indigo forum
#

Hi ๐Ÿ‘‹

Could you please share the subscription ID that results from this? It'll start with sub_

fallow pond
#

req_wqWvJBA3c6cIk5

#

there are none that start with "sub_"

#

only req_

indigo forum
#

Thanks, taking a look

fallow pond
#

ok

indigo forum
#

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

#

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

fallow pond
#

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

indigo forum
#

No but you need to charge for the days after the initial 7 days, which you are not currently doing

fallow pond
#

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?

indigo forum
#

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

fallow pond
#

but i want it to be charged for the 7 days

indigo forum
fallow pond
#

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

indigo forum
#

You would add an item that represents the charge for the 7 days that would be billed after the trial period

fallow pond
#

In this way, 2 items would be posted on the invoice? with add_invoice_items?