#Marcel Wolf
1 messages · Page 1 of 1 (latest)
Hi there,
You can set automatic tax behavior in Subscription Schedule also:
https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-default_settings-automatic_tax
I invite to analyse the doc API specification and see if you can find the desired field
if not, you can create a Subscription Schedule from a Subscription:
https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-from_subscription
ok thank you. i missed the default settings object.
but makes sense since this applies to the whole subscription, not the phases
Yup!
can i ask a other question?
Yeah for sure!
i have a subscription with 1 year cycle. i want to apply 30 days trial in phase one and in a secound phase a coupon
what are my phase out dates?
You can set trial on the first phase:
https://stripe.com/docs/billing/subscriptions/subscription-schedules#using-trials
https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases-trial
and set trial_end with the timestamp corresponding after 30days
https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases-trial_end
And apply coupon to phase 2:
https://stripe.com/docs/billing/subscriptions/subscription-schedules#subscription-schedule-phases
and phase 2 can end directly after or must it be the rest of the year
i want to put the subscription in release after applying coupon
yeah you can set end behavior to release on the schedule:
https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-end_behavior
Np!
Can i apply the PaymentBehavior to the scheduler like default_incomplete?
Not directly on the schedule no
my plan is i have
subScriptParams = &stripe.SubscriptionParams{ Customer: stripe.String(req.CustomerID), Items: []*stripe.SubscriptionItemsParams{ { Price: stripe.String(req.PriceID), }, }, TrialPeriodDays: stripe.Int64(30), PaymentBehavior: stripe.String("default_incomplete"), AutomaticTax: &stripe.SubscriptionAutomaticTaxParams{Enabled: stripe.Bool(true)}, }
this at the moment. and i want to be this the first phase.
After this the subscription should apply a promo like this:
PromotionCode: stripe.String(req.PromotionCode),
})```
and i want to convert this to a scheduler
Then you can pass from_subscription when creating the schedule: https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-from_subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok so i would create the subscription with the trial
and add a phase starting 30 days later with the update?
Well, what is it you're trying to achieve with the schedule?
i want to create a subscription with a 30 days trial period, depending on the coupon that was applied. if a specific coupon was used, the subscription should start with 30 days trial after this a fixed value coupon should be applied to the yearly subscription
Which coupon system are you using?
i have a product with three prices. i manually filter if coupon.name == "<name> " to apply the trial since this is the only sales channel that has to be applied to
Why do you think you'd need a schedule in this case? Are you changing the Price object they're subscribed to, or literally just expiring the trial?
some of your colleques suggested this
the problem is i can not apply a coupon and trial at the creation since the first invoice is 0
Are you using Stripe coupons?
yes
What kind of coupons?
onetime fixed value with customer promo code
So your intention is to offer a free trial and then once trial ends apply the coupon?
exactly
if this coupon is entered, 30 days trial, after this starting the subscription for one time of 30€
Then yes you'd want to update the schedule with a 2nd phase starting at the end of the trial period, applying the discount: https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases-coupon
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 i would create the subscription with the trial
and apply then a scheduler to it
or create both in the scheduler
Well, if you need the payment_behavior param you'd need to create the subscription initially with the trial
and then its just one phase
for the update or?
can i use PromotionCode: stripe.String(req.PromotionCode),
in the scheduler or must i use the coupon code?
You can't pass a promotion code to the schedule API, no
Well, depends how long you want the coupon to be applied for
since this is one time off for the first cycle
Ok, then you want a phase with a single iteration that applies the coupon. I think you can then just set end_behaviour: 'release' and it'll keep recurring ongoing like a regular sub: https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-end_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.
You can (and should) test all this with clocks: https://stripe.com/docs/billing/testing/test-clocks
so i will do following now:
Step 1: Create the subscription with trial as i do for now.
Step 2: Create a scheduler from subscription with one phase applying the coupon and release as and behavior and this might do the trick?
I think so yep! But you should test it with the clocks, they'll help you fast forward time to ensure its behaving as you need
yes sure
a question according the clock
is there a way to send a existing user and subscription on time travel?
for now my workflow is to create a user with the normal way in staging (aquireing information and payment method) and do the same in the clock and switch the ids in my database
to get the hooks working with it
There is not no. You need to create new, isolated Customer and Subscription objects
ok then i will try this
but can i do a scheduler on the timeclock subscription object?
I don't understand
when i create a customer + subscription in the ui
i have to write a extra script to apply the scheduler
Yep, the clocks support schedules
but not from dashboard or?
No you can't create a schedule from a subscription via the Dashboard
ok
does it makes sense to apply the promo code to the customer object instead of the subscription?
then if useable it will be applied?
i tink i saw this in the event logs from creating subscription and user in the test clock with trial and coupon
not sure I follow the use case, what does ' apply the promo code to the customer object ' mean and how is that done?
Ok my problem is:
Create customer, create subscription with 30 day trial and then when the billing begins apply a one time fixed rate discount.
I tried to follow the instructions with subscription schedule and created a test clock object with the coupon applied and a trial.
I took a look into the events that where logged and saw the discount code was added to the customer instead of the subscription.
so i think this also could solve my problem with starting with trial and for the first billing cycle a one time off is applied
might work, did you try it?