#johann-muller_api
1 messages ยท Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- johann_subscription-billingcycle, 5 days ago, 31 messages
๐ 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/1248183243115859979
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Currently I do this if it's an immediate start
So start trial today until 19 July, then pro-rate from 20.7 to billing anchor 15.8
$subscription = $this->stripe->subscriptions->create([
'customer' => 'cus_QF4fffIQ7uDq5M',
'trial_end' => 1721374371, // 2024.07.19
'billing_cycle_anchor' => 1721114268, // 2024.08.15
'description' => 'Monthly Fixed with Trial',
'items' => [
[
'price' => 'price_1PL73iQeTVnMyqsf7VZ3cfU0' // Subscription full price โฌ90
]
],
'add_invoice_items' => [
[
'price' => 'price_1PMXO5QeTVnMyqsf8sLUBH0Q', // Trial charge for โฌ45
'quantity' => 1,
],
],
], ['stripe_account' => $siteData->StripeAccountId]);
So I understand the schedule but not sure how I do schedule and achieve the other items thats contained in the "subscription-create" - like the invoice items?
You can achieve that using Subscirption scheduler APIs
For example to add an invoice item you can use this param:
https://docs.stripe.com/api/subscription_schedules/create#create_subscription_schedule-phases-add_invoice_items
๐ Wow thanks I didn't see the add invoice in the schedule part - wow great thanks let me code that and test !! thanks again