#tymm-help

1 messages · Page 1 of 1 (latest)

neat egret
#

hello! how can i help?

rich gull
#

hi have u seen the thread

#

i want to create a subscription and i couldnt get the invoice id at that stage

#

because if i set the billing cycle anchor without proration then the invoice seems to be not generated?

neat egret
#

can you share the subscription id of what you've tried?

rich gull
#

one sec

#

sub_1LeqNwLK0bfo5HSbY3zDHBi7

neat egret
#

hrm, so just to make sure i understand the requirements correctly - you want to create a subscription, that charges the full price up front even though the customer starts in the middle of the cycle? and the subscription should charge on the 1 of every month

rich gull
#

yes

#

actually preferably the subscription starts immediately and charge for a full price, and then the next cycle will be set to 1st of every month

neat egret
#

for example, if the customer starts the subscription today, set the backdate_start_date to 1 sep, and the billing_cycle_anchor to 1 oct

#

it'll generate an invoice for the full month

rich gull
#

interesting, aight lemme try

#

thanks

#

so i should set ProrationBehavior.CREATE_PRORATIONS or NONE for this case when creating a subscription?

neat egret
#

leave it as the default which is create_prorations

#

out of curiosity, does backdate_start_date work for your use case?

rich gull
#

yeah it worked

#

but how do i do the same for subscriptionitem?

#

lets say a customer has an existing ongoing subscription and would like to increase the amount of subscriptionitems now

neat egret
#

so you want to charge the full price even if the customer increases the quantity on the 29 of the month?

rich gull
#

yes

neat egret
#

there's no easy way to do it for a change in an existing subscription.~~ The only way i can think of is to update the subscription with proration set to none. Then create a separate Invoice to charge for the quantity change immediately~~

#

hrm, actually it should be the other way round

  1. create a separate invoice to charge for the quantity change
  2. if payment is successful, update the subscription to increase quantity
rich gull
#

ok, understood. thanks

#

when creating a separate invoice do u suggest using the same priceid/ product and set the subscription end date to the next billing cycle or create a new one off product and use that instead?

neat egret
#

you can't use the same Price as the Subscription - you should create a one-time Price . You can use the same Product if you want though.

#

i don't get the bit about updating the Subscription - set the subscription end date to the next billing cycle or create a new one off product and use that instead. Why do you want to do that?

rich gull
#

create a new subscription for only 1 month, so that i can reuse the priceid

#

at the same time update the subscriptionitems in the old subscription so that the amount of subscriptionitems reflects in the next billing

neat egret
#

i personally wouldn't do that, but it's up to you. A Subscription is essentially a recurring payment. It doesn't quite make sense to me to create a Subscription for what is essentially a one-time payment. But theoretically it would work.

#

hmmm, looking at it from another angle, i guess it would work also, your customers are theoretically subscribing for X more quantity of that Price.

#

you would probably want to use Subscription Schedules to update the quantity of the main subscription on the start of the next billing cycle

rich gull
#

ok letme take a look

rich gull
#

so with this subscription schedule i dont need to create a separate invoice for changes on subscriptionitems is that right?

neat egret
#

if you're planning to create a subscription for the number of additional items, then update the main subscription to include the additional items on the new billing cycle. Then no, you don't need to create a separate invoice for changes on subscription items.

#

i'd suggest you test it out to see what happens

rich gull
#

ok gotta try out this schedule thing

rich gull
#

apparently i cannot set phase if i setFromSubscription? then how should i updaate the existing subscription with this?

neat egret
#

you need to do two separate requests

#

like you mentioned, you cannot set the phase at the same time you create a SubscriptionSchedule from an existing subscription

rich gull
#

what request?

neat egret
#

request 1 : create Subscription Schedule from existing Subscription
request 2 : update phases for Subscription Schedule from request 1

rich gull
#

hmmm okay

#

i think this schedule api is not suitable for my use case and im better off using invoice + update subscriptionitem

narrow jasper
#

Hi @rich gull I'm taking over, let me know if you have a follow-up question