#alexbanks-subscription-schedules

1 messages · Page 1 of 1 (latest)

polar forum
#

Hi there 👋 can you elaborate a bit? I'm asking because Subscription Schedules don't have Payment Intents on them. A Subscription Schedules drives changes that are scheduled to be made to a Subscription object.

toxic pine
#

thanks toby - yes. if i create a SubscriptionSchedule without first passing a Subscription, it helpfully creates the Subscription object. But i think I need to access the payment_intent on this to get the client_secret so the client can enter payment details on the website and link back to the Subscription.

#

If i create the Subscription first and then pass this into the SubscriptionSchedule I can get this, but creating the Subscription first requires me to create a list of Items and I'm not sure how these would conflict with Items in the SubscriptionSchedule

#

hope that makes sense!

polar forum
#

Gotcha

From the Subscription you'll reference the latest_invoice parameter
Then from the Invoice you'll look at the payment_intent parameter
Then you can find the client_secret on the Payment Intent object.

toxic pine
#

thanks toby in the Python API i try to do this from the SubscriptionSchedule with an expand=["subscription.latest_invoice.payment_intent"] but this expand doesn't work

#

i wondered if this was because i wasn't able to set the default_behavior on the Subscription object to 'default_incomplete'

#

any tips?

polar forum
#

Apologies, I skipped a step. From the Subscription Schedule you'll want to reference the subscription field to find the related Subscription object.