#tidymince_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1257652281181077504
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
I've checked that the API version used in the account is the one pinned in the Go sdk (2024-04-10) so it's strange that by using it I get this error
I'm not sure I'm using the API correctly. Alternatively I'd like to know how to create a subscription schedule that does what I described above. About the start date in the past I can give an example:
- today 2 July 2024 I want to create this subscription
- I want the subscription to start on the 1st of July 2024 with a single price as per phase 1 (invoice #1 has a single price)
- On the 1st of August 2024 I want the subscription to renew and charge for the existing price plus an additional one I added in the phase 2 (invoice #2 has two prices)
It's a top-level param, not nested in phases: https://docs.stripe.com/api/subscription_schedules/create#create_subscription_schedule-start_date
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So the go SDK is not correct?
Thanks
Btw will this allow me to achieve what I mentioned above?
Because I already have the StartDate as top level param but I then see a proration applied and the billing cycle anchor set to the moment I create the subscription schedule
I mean it probably shouldn't be here https://github.com/stripe/stripe-go/blob/26539500cc8267f40f25c0c4ff7235fbdeec6ebf/subscriptionschedule.go#L307
But it doensn't matter, my mistake for not reading the docs properly, I just looked at the go docs tbh
This is the thing I'd like to solve, any thoughts?
Worth filing an issue!
I'll check shortly
Thanks
Hey! Taking over for my colleague. Let me catch up.
Yes this seems to be a bug on the go SQK, thanks for opening the issue. The owning team will pick it as soon as possible
Between, can you try using the latest version ? v79.1.0 ?
Also, could you please share the code you are using in order to create the scheduler? same on the github issue
The latest version should have the same problem looking at the code: https://github.com/stripe/stripe-go/blob/master/subscriptionschedule.go#L341
Yeah, the SubscriptionSchedulePhaseParams is used for both scheduler creation and update. But it can't be set when creating the Scheduler agree.
I'm afraid bumping the sdk used would result in a bit of additional work that I'd prefer to avoid if not necessary to solve the problem I'm trying to solve which is the behaviour described here #1257652281181077504 message
But I will add code to the issue, no problem
Could you please share the code you are using with the go SDK ?
Yes
this is the full code but I will share a redacted version in the issue if that's ok
Well, you need to remove this StartDate: stripe.Int64(startAt.Unix()), from the phase
line 68 in your function
And keep just the one at the root level.
Why are you passing StartDate at the phase level ?
Yes, this is super clear and I've moved on from this problem after opening the issue on github and I'm now looking at finding a solution for I wanted to achieve with that. What I'm trying to achieve is to create a subscription with:
- start date in the past (back date)
- billing cycle anchor on that date
- an additional phase to add an item to the subscription in the second billing cycle
I'll give you an example:
- today 2 July 2024 I want to create this subscription
- I want the subscription to start on the 1st of July 2024 with a single price as per phase 1 (invoice #1 has a single price)
- On the 1st of August 2024 I want the subscription to renew and charge for the existing price plus an additional one I added in the phase 2 (invoice #2 has two prices)
Is it clear what I'm trying to achieve?
Yes, this is super clear and I've moved on from this problem after opening the issue on github and I'm now looking at finding a solution for I wanted to achieve with that.
Then you should close that issue, as it's solved now? As mentioned earlier the " theSubscriptionSchedulePhaseParamsis used for both scheduler creation and update. But it can't be set when creating the Scheduler."
I want the subscription to start on the 1st of July 2024 with a single price as per phase 1 (invoice #1 has a single price)
Sure, you can create a backdate Subscription:
https://docs.stripe.com/billing/subscriptions/subscription-schedules/use-cases#backdating-subscription
On the 1st of August 2024 I want the subscription to renew and charge for the existing price plus an additional one I added in the phase 2 (invoice #2 has two prices)
You can achieve this using phases sure.
Thanks for sharing this piece of doc. I've actually followed this already but it results in a proration and setting the billing cycle to the date when the schedule is created
What am I doing wrong?
Can you share the invoiceId ?
yes
This is the invoice that is generated with the proration: in_1PY4BuIPsU8bKnjX3mPpWs9O
This is the subscription: sub_1PY4BuIPsU8bKnjX3yS75vhJ
Thanks for sharing. When creating the Scheduler try setting the billing_anchor at phase start too:
https://docs.stripe.com/api/subscription_schedules/create#create_subscription_schedule-default_settings-billing_cycle_anchor
I've already set this on the first phase and it doesn't seem to work. I guess I should set this again in the top level?
Yes it's a top level param: default_settings.billing_cycle_anchor