#nadia-subscription-schedule
1 messages · Page 1 of 1 (latest)
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
Ok. Can you share the request ID of the request where you set the metadata: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
yes : req_pR99db7M3xAma8
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
i was told otherwise
Where
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
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
the subscription id is set to null when i create the sub
i cant find it :/
can i add it to the phase ?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
"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
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
It looks like you set it on the subscription schedule again there
Not on the phase
It's not set in the phase: https://dashboard.stripe.com/test/logs/req_ZvrUmSL0bkkGg8
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Within phases[0]
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You passed it correctly
Can you elaborate? You have a Subscription Schedule and the subscription field is null? Or is it null on another object somewhere?
Yeah, so you set the Schedule on the Customer. The Subscription(s) are defined on the phases array: https://stripe.com/docs/api/subscription_schedules/object#subscription_schedule_object-phases
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
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
The server is rather busy, so I'm going to be stretched, but I'll try to answer as fast as I'm capable
thanks
i supposed that since the subscription isnt created (subscription starts on august 1st) i have no id
That's correct
okay thank you
so i cant have it through the link you sent me right ?
👋 Hopping in to help
Is your question still how to get the subscription ID from a schedule that is starting in the future?
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
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
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
okay thank you
so when i can a invoice paid event
i should expand the subscription to get the metadata right ?
yup
you too!
🙏