#r3vanek_api

1 messages ¡ Page 1 of 1 (latest)

terse patioBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1319222950859247719

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

dusky meteor
#

Could you share the scenario / example which you expect the proration to happen? In both requests, all I can see is just subscription deletion and creation, and I'm not too sure what is the expected behavior you're looking for

west scroll
#

yes so Im trying to create this flow:

  1. Trial for customer ends
  2. I cancel it
  3. In the app we wait for the user to click our internal button "Want to continue?"
#
  1. I create new susbcription
#
  1. It immediately creates invoice to be paid for 7 days
#

that way I dont generate invoices always, bc in my country invoices left blank are still taxed by gov. I already talked about it with stripe support and its only way to do it

#

today is 19th of December and I expect on creating this new subscription to be issued invoice for covering costs up to the 1 of January

#

but sadly I cant do it, the subscripiton is created and already paid

dusky meteor
#
  1. Trial for customer ends
  2. I cancel it
    Do you create anything in Step 1? What are you trying to cancel in Step 2?
terse patioBOT
autumn quartz
#

today is 19th of December and I expect on creating this new subscription to be issued invoice for covering costs up to the 1 of January
I don't really understand what this part means. You want to start a subscription today, but only issue an invoice on 1/1?

west scroll
#

in step 1 I merely notice in the app that subscription trial ends

#

in step 2 I cancel this subscription

west scroll
autumn quartz
west scroll
#

I cant do that

#

bc you dont provide that option for the subscription with collectionmethod='send_invoice'

autumn quartz
west scroll
#

but im setting it in the creation of this new subscription

        customer=subscription_info.stripe_customer_id,
        collection_method="send_invoice",
        billing_cycle_anchor_config={"day_of_month": 1},
        days_until_due=7,
        items=[{"price": default_subscription.stripe_price_id}],
    )```
autumn quartz
west scroll
#

emm no, thats the problem

#

its not supported for the creation of new subscription

autumn quartz
west scroll
#

sub_1QXfEyINvAt2H6prwopoGojk

autumn quartz
#

Ah, it's because the Customer you're passing is associated to a test clock that is frozen at 2/1

west scroll
#

ohh ok

autumn quartz
#

So it is prorating, hence the 270 invoice, but until 1/2

west scroll
#

pardon me for that, didn't noticed

autumn quartz
#

You should use a new test clock fixed to today and it should work as you need

#

Prorations will automatically be applied to the invoice on creation

west scroll
#

yes you are right, when I change the trail to the 4 days it works as intended

#

many thanks for help