#feminaagravat_39821
1 messages · Page 1 of 1 (latest)
hi! hmm, theres not really a direct way to do that.
I think what you would do is use SubscriptionSchedules. You can start the subscription now with one item, and then schedule future phases that add the other items later on.
https://stripe.com/docs/billing/subscriptions/subscription-schedules/
This is the array i have created by following above document.
array:1 [▼
8452 => array:4 [▼
"customer" => "cus_OV04mgyKSEMHBX"
"start_date" => 1769209200
"end_behavior" => "release"
"phases" => array:1 [▼
0 => array:3 [▼
"metadata" => array:2 [▶]
"iterations" => "12"
"items" => array:3 [▼
0 => array:2 [▼
"price_data" => array:4 [▼
"currency" => "USD"
"product" => "prod_OV04sJewchFaiJ"
"unit_amount" => 39900
"recurring" => array:1 [▼
"interval" => "year"
]
]
"quantity" => 1
]
1 => array:2 [▼
"price_data" => array:4 [▼
"currency" => "USD"
"product" => "prod_OV048ChxpfI8CD"
"unit_amount" => 17500
"recurring" => array:1 [▼
"interval" => "year"
]
]
"quantity" => 1
]
2 => array:2 [▼
"price_data" => array:4 [▼
"currency" => "USD"
"product" => "prod_OV04OZ81p8Pqrc"
"unit_amount" => 7500
"recurring" => array:1 [▼
"interval" => "year"
]
]
"quantity" => 1
]
]
]
]
]
]
got it! those parameters just add all three items in the first phase though.
But how to add start date for that three items ?
by using other phases
phases is an array; the way it works is along the lines of
{start_date:<now>, items:[{product1}], iterations:12 }, // phase 1 lasts 12 'iterations' (e.g. months), has one item
{ items:[{product1 , product2, product3}] } // phase 2 starts, has all 3 items
]
ok let me try