#nadia-subscription-schedule

1 messages · Page 1 of 1 (latest)

cosmic hearth
#

@dry harness What do you need help with?

dry harness
#

hello @cosmic hearth hope you're doing well

#

i contacting you regarding the indication that i received

#

this one

#

i can't find my subscription schedule metadata on the created subscription

cosmic hearth
dry harness
#

yes : req_pR99db7M3xAma8

cosmic hearth
#

Looks like you set it on the subscription schedule object, not the subscription object. Metadata will be on sub_sched_1LOKmiFxsE4pn4oal5Qdkkmn

#

Metadata isn't copied over to the subscription object from the subscription schedule object

dry harness
#

i was told otherwise

cosmic hearth
#

Where

dry harness
#

how can i set the the sub metadata then please ?

#

in this thread

#

i would like to have the subscription schedule metadata on my subscription object

#

is there a way to do it please

#

using create subscription schedule

cosmic hearth
#

I don't see in this thread where someone indicated metadata is copied from sub schedule to sub. Metadata isn't copied across objects in Stripe. You would have to do it in 2 calls. Get the sub id from the sub schedule object: https://stripe.com/docs/api/subscription_schedules/object#subscription_schedule_object-subscription Then set it here https://stripe.com/docs/api/subscriptions/update#update_subscription-metadata

dry harness
#

the subscription id is set to null when i create the sub

#

i cant find it :/

#

can i add it to the phase ?

#

"Set of key-value pairs that you can attach to a phase. Metadata on a schedule’s phase will update the underlying subscription’s metadata when the phase is entered. Updating the underlying subscription’s metadata directly will not affect the current phase’s metadata."

#

as you can see on my request i have only 1 phase

#

"end_behavior": "release",

#

"quantity": "1" => phase

cosmic hearth
#

Ah apologies. Yeah you can do it there. It will update the subscription's metadata once that phase has been entered

#

The subscription id is probably blank on the subscription schedule when you first create it because the first phase hasn't been entered at that point

dry harness
#

thanks

#

i'm testing it right now

#

here is the request id : req_ZvrUmSL0bkkGg8

cosmic hearth
#

It looks like you set it on the subscription schedule again there

#

Not on the phase

dry harness
#

i set it on both

#

to be sure

#

check the Request POST body

cosmic hearth
dry harness
#

ahh my bad

#

i have to add it on the array ?

#

or in the object ?

cosmic hearth
#

Within phases[0]

dry harness
#

thaaanks

#

testing it now !

#

here is the request id : req_52YNqWlHM5zjls

cosmic hearth
#

You passed it correctly

dry harness
#

niceee

#

thanks a lot for your help

subtle juniper
#

Can you elaborate? You have a Subscription Schedule and the subscription field is null? Or is it null on another object somewhere?

dry harness
#

the subscription field is null sorry

subtle juniper
dry harness
#

i dont understand sorry

#

i'd like to retrieve the subscription id

#

i supposed that since the subscription isnt created (subscription starts on august 1st) i have no id

#

but is there a way to get the id ?

#

@subtle juniper is it possible to keep the thread open

#

in case i dont answer please

#

i'm gonna end my shift soon

subtle juniper
#

I can't keep the thread open, but you're welcome to reference it when you come back

#

Someone will create a new thread after reading over this one in that case

dry harness
#

ah you're here nice i can wait a little bit

#

noted

#

thanks

subtle juniper
#

The server is rather busy, so I'm going to be stretched, but I'll try to answer as fast as I'm capable

dry harness
#

thanks

subtle juniper
#

i supposed that since the subscription isnt created (subscription starts on august 1st) i have no id
That's correct

dry harness
#

okay thank you
so i cant have it through the link you sent me right ?

sterile mesa
#

👋 Hopping in to help

dry harness
#

hi @sterile mesa

#

thanks for helping me

sterile mesa
#

Is your question still how to get the subscription ID from a schedule that is starting in the future?

dry harness
#

yes please

#

so i can make the update of the status on a invoice paid

#

renewal

sterile mesa
#

So there isn't a way to get the Subscription ID immediately because the subscription isn't created until it's actually started. You'd have to wait for the subscription_schedule.updated event to be triggered and check that subscription has been updated on the schedule.

I think you're approaching this the wrong way though - what you want to be doing is listening for invoice.created events and updating the Invoice everytime a new Invoice is created for renewal. You shouldn't need the Subscription ID to do that

dry harness
#

thanks for your help
will the metadata be automatically linked to the subscription / invoice ?

#

so i can match the client & invoice ?

#

a client can have multiple subscription
1 sub = 1 beneficiary

sterile mesa
#

No, metadata is not automatically passed through from the Subscription to the Invoice, so if you're relying on Metadata you'll have to retrieve the Subscription to get it

dry harness
#

okay thank you
so when i can a invoice paid event
i should expand the subscription to get the metadata right ?

sterile mesa
#

yup

dry harness
#

noted

#

thanks a lot

#

im good then

#

have a nice day !

sterile mesa
#

you too!

dry harness
#

🙏