#jackson-subscription-schedule
1 messages · Page 1 of 1 (latest)
You need to look at the underlying's Subscription associated with the schedule and its latest_invoice
you will have to finalize that invoice first and then you can look at its PaymentIntent's client_secret
There isnt really an underlying subscription.
customer: customerId,
end_behavior: "cancel",
start_date: "now",
phases: [
{
items: [
{
price_data: {
currency: "usd",
product: "prod_Lrp0JmZeQ6CI1b",
recurring: {
interval: "month",
},
unit_amount: price * 100,
},
quantity: 1,
},
],
iterations: 1,
},
{
items: [
{
price_data: {
currency: "usd",
product: "prod_Lrp0JmZeQ6CI1b",
recurring: {
interval: "month",
},
unit_amount: monthlyPrice * 100,
},
quantity: 1,
},
],
iterations: cycle,
},
],
There is though
I created the subscription schedule like that on the backend
you create a Schedule, the first phase starts now, so there is a Subscription created automatically
With custom payment
in the response you should see subscription: 'sub_123'
Yes I see it
Could you direct me on how to finalise the invoice to get a client secret
So you have a SubscriptionSchedule. It's associated with a Subscription. That Subscription is associated with an Invoice in latest_invoice: 'in_123'. Then you can use the API to Finalize the Invoice https://stripe.com/docs/api/invoices/finalize and then that Invoice is associated with a PaymentIntent in payment_intent that you can expand (https://stripe.com/docs/expand) and get the client_secret
Thanks
Also, could you tell me why the subscription I created shows active on the dashboard even when the invoice has not been finalised
because it's how it works, at this point it's active