#tymm-subscription
1 messages · Page 1 of 1 (latest)
hi let me reiterate, i want to:
- make monthly subscription
- charge full amount for the first/ portion of the month
- set billing cycle anchor date to 1st of every month
i have managed to set the anchor date, but it's with proration
have you tried the recommendation that orakaro suggested?
There should be one invoice only
In step 2, you will add one-off invoice item to the first prorated invoice to ensure that it sums up to $10
how do i add an item with a dynamic price?
Hi @frail basalt I'm taking over this thread
So you want to add an ad-hoc price when creating a subscription?
no...
^
basically i wanna create subscription with billing cycle anchor but no proration
There's no proration for subscription creation, proration happens when subscription changes.
Can you show me the code you wrote?
that is if i create subscription through session, im creating an invoice instead because i need the billing cycle anchor
.builder()
.setCustomer(customer.getId())
.setProrationBehavior(SubscriptionCreateParams.ProrationBehavior.CREATE_PRORATIONS)
.setBillingCycleAnchor(utils.getFirstOfNextMonth())
.setPaymentBehavior(SubscriptionCreateParams.PaymentBehavior.DEFAULT_INCOMPLETE)
.setPaymentSettings(
SubscriptionCreateParams.PaymentSettings.builder()
.setSaveDefaultPaymentMethod(SubscriptionCreateParams.PaymentSettings.SaveDefaultPaymentMethod.ON_SUBSCRIPTION)
.build()
)
.addAllExpand(Arrays.asList("latest_invoice.payment_intent"));
paramsBuilder.addItem(
SubscriptionCreateParams.Item
.builder()
.setPrice(item.getKey())
.setQuantity(item.getValue())
.build()
);
Subscription.create(paramsBuilder.build());```
You are setting ProrationBehavior to CREATE_PRORATIONS, you should set it to NONE if you don't want proprations.
ok if i put none, and lets say a customer already has 5 of a subscriptionitem and decided to increase the quantity to 10, will stripe only invoice for the 5 or 10?
Send me the subscription ID