#Chris M - Subscription Schedules
1 messages · Page 1 of 1 (latest)
Not quite sure how I would set up the sort of thing that I mentioned
In the past I've tackled one-time payments and also recurring payments, but I need to be able to have a single payment up front, and then a recurring payment after that for a different amount
Do I just add a second price object into the "phases" array of the schedule setup?
You want add_invoice_items in the first phase: https://stripe.com/docs/api/subscription_schedules/object#subscription_schedule_object-phases-add_invoice_items
That will add a one-time Price to the first Invoice for that phase, which is your initial $10.
So in the phases array, it would be a price object for the upfront cost under "add_invoice_items", and then another price object for the recurring costs under "items"?
Yep!
So something like:
"phases" => [
[
"add_invoice_items" => [
[
"price" => $upfrontStripePrice->id
],
]
],
[
"items" => [
[
"price" => $recurringStripePrice->id
],
]
],
],
where the $upfrontStripePrice object does not have any recurring info and $recurringStripePrice does?
Not sure if I structured that set of arrays right
Yep, you're on the right track assuming the array structure is correct.
if I have the start_date set to "now", then, it will do that first phase immediately, wait the recurring phase's time, then start charging the recurring amount? It will know to wait between phase 1 and 2?
If the recurring Price is in the first phase it will apply to the first phase, but yes the rest of what you said is correct.
So $upfrontStripePrice is, for example, $10
And $recurringStripePrice is, let's say, $1 every 2 weeks
It would just $10 today
Then in 2 weeks it would charge $1
Then in another 2 weeks it would charge $1, and so on?
No, it would be $11 now ($10 once + the first $1 bi-weekly payment).
Hmm, okay, how can I push back that second phase to start 2 weeks after the first one?
Let's back up a bit... can you describe the payment schedule you want?
The way we describe it is "Upfront cost w/ recurring payments". The client can choose a schedule, an upfront cost, and a recurring cost
The client's customer pays the initial cost, then one iteration of the schedule later they start pay the recurring amount, and it continues to charge the recurring amount on the recurring schedule (for example every 2 weeks)
So ideally I'd like $10 now, wait 2 weeks, $1, wait 2 weeks, $1, etc
Okay, so I don't think you actually need Subscription Schedules for this. You can create a Subscription with a $10 one-time Price in add_invoice_items, the $1 recurring Price in items, and a two-week trial period.
Seems similar to a schedule... If I took the one-time payment, re-added the recurring values, and then change 'type" to "one_time" would it then charge it, wait, then continue to the next phase?
Sorry, not sure I understand. What does "re-added the recurring values" mean? And change type where?
My understanding with a schedule was that it sort of book-ended a number of subscriptions one after the other - once one subscription/phase ended, the next began - is that not the case?
That is the case, but I'm saying you don't need a Subscription Schedule at all.
You can get the one-time payment followed by recurring payments behavior with just a Subscription.
Might make my implementation details a little easier, as some of our other payment scheduling options operate off schedules rather than subscriptions.
I acknowledge that I don't need a schedule, but if it fits out models better would it do the job equally well?
Yeah, you can use whichever you want. Most people avoid Subscription Schedules if they don't need them due to their complexity.
So with the Subscription Schedule you need to have a recurring Price in each phase's items, which means you can deal with the first phase having no recurring payment due in one of two ways: use a trial, or use a zero-amount recurring Price.
Either should work, it's up to you which best suits your needs.
That way you get $0 recurring, $10 once in the first phase, then in later phases you can have just the $1 recurring.
So first phase charges $10 once, waits two weeks, then second phase kicks in infinitely?
Yep, you can configure it to do that.
Would it also work if I just added an end_date to my first phase and kept the price under "add_invoice_items"?
Can you show me an example of the API parameters you mean?
'start_date' => $now,
"phases" => [
[
"add_invoice_items" => [
[
"price" => $upfrontStripePrice->id
],
],
"end_date" => $nowPlusintervalAmount,
],
[
"items" => [
[
"price" => $recurringStripePrice->id
],
]
],
],
That won't work. items is required in each Phase.
Ah, I see
I mentioned this above:
So with the Subscription Schedule you need to have a recurring Price in each phase's
items, which means you can deal with the first phase having no recurring payment due in one of two ways: use a trial, or use a zero-amount recurring Price.
How do I do the latter: having a zero recurring price (separate from "unit_amount")?
You create a recurring Price for $0.
Does that make sense?
You would create it the same way you created your $1 recurring price, except it would be for $0 instead.
I was confused and going to ask "But won't it then just charge $0 instead of $10", but am I also adding a separate, third price object under "add_invoice_items" for the $10?
There will be two Prices used in the first phase: $10 one-time, $0 recurring. There will be a single Price used in the next phase(s): $1 recurring.
So:
"phases" => [
[
"add_invoice_items" => [
[
"price" => $upfrontStripePrice->id
],
],
"items" => [
[
"price" => $emptyStripePrice->id
],
],
],
[
"items" => [
[
"price" => $recurringStripePrice->id
],
]
],
],
Yep.
$empty and $recurring need "recurring" data, while $upfront does not, right?
Yep.