#r3vanek_api
1 messages ¡ Page 1 of 1 (latest)
đ 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.
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
yes so Im trying to create this flow:
- Trial for customer ends
- I cancel it
- In the app we wait for the user to click our internal button "Want to continue?"
- I create new susbcription
- 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
- Trial for customer ends
- I cancel it
Do you create anything in Step 1? What are you trying to cancel in Step 2?
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?
in step 1 I merely notice in the app that subscription trial ends
in step 2 I cancel this subscription
not exactly. Suppose the subscription costs 300 USD. Up to the 1/1 you have approximetly 33% of full month so I want to issue invoice covering 100 USD
Why do you do that? FWIW, you can set it to auto cancel: https://docs.stripe.com/billing/subscriptions/trials#create-free-trials-without-payment
I cant do that
bc you dont provide that option for the subscription with collectionmethod='send_invoice'
Sure, should be possible if you fix the billing anchor to 1/1 on creation. It'll prorate by default: https://docs.stripe.com/billing/subscriptions/billing-cycle#new-subscriptions
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}],
)```
If you want to immediately include those prorations on the new invoice, pass proration_behavior: 'always_invoice': https://docs.stripe.com/api/subscriptions/create#create_subscription-proration_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Share the sub_xxx ID that is created as a result of this request please
sub_1QXfEyINvAt2H6prwopoGojk
Ah, it's because the Customer you're passing is associated to a test clock that is frozen at 2/1
ohh ok
So it is prorating, hence the 270 invoice, but until 1/2
pardon me for that, didn't noticed