#tymm-subscription

1 messages · Page 1 of 1 (latest)

floral grove
#

👋 Happy to help

#

What is your question?

frail basalt
#

hi let me reiterate, i want to:

  1. make monthly subscription
  2. charge full amount for the first/ portion of the month
  3. set billing cycle anchor date to 1st of every month
#

i have managed to set the anchor date, but it's with proration

floral grove
#

have you tried the recommendation that orakaro suggested?

frail basalt
#

pi dont understand the 2nd part

#

so theres 2 invoices?

floral grove
#

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

frail basalt
#

how do i add an item with a dynamic price?

digital slate
#

Hi @frail basalt I'm taking over this thread

#

So you want to add an ad-hoc price when creating a subscription?

frail basalt
#

no...

frail basalt
#

basically i wanna create subscription with billing cycle anchor but no proration

digital slate
#

There's no proration for subscription creation, proration happens when subscription changes.

#

Can you show me the code you wrote?

frail basalt
#

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());```
digital slate
#

You are setting ProrationBehavior to CREATE_PRORATIONS, you should set it to NONE if you don't want proprations.

frail basalt
#

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?

digital slate
#

Send me the subscription ID