#max-schedule
1 messages ยท Page 1 of 1 (latest)
@warm meteor that's expected as we don't "chain" metadata across objects
when you get the event for the PI you should look at the underlying invoice/sub
I mean that you should look at the subscription's metadata
PI -> invoice -> subscription and look at that subscription's metadata to find the information you want
How to do it via the api?
Its there in the dashboard
But I need the invoice_number from metadata in my Web Application
Right, and you said the invoice_number metadata is on the subscription object correct?
Yes
So like koopajah said, metadata isn't typically transferred between related objects
Yes
But how to check if user paid?
So you will have to retrieve the related PaymentIntent https://stripe.com/docs/api/payment_intents/object#payment_intent_object-invoice
So the payment Intent will have the invoice_object attached?
Then will get the invoice via the invoice API and from there my metadata?
So the easy way to get the subscription metdata would be to expand the subscription property when you retrieve the invoice https://stripe.com/docs/api/invoices/object#invoice_object-subscription
Of course, happy to help
Can you leave this thread open?
I will reply if its working or not
I have to wait about 1h to finalize the payment ๐
Of course
Sounds good let me know. It should be there if it is in the metadata. Just remember you have to either expand the subscription property
So I need to get the Invoice from the Payment Intent via API first and from the Invoice the Subscription via the API and from there my metadata right?
- Get Invoice ID from Payment Intent
- Find Invoice via API
- Get Subscription ID from the Invoice
- Find Subscription via API
- Extract Metadata
Correct. You can actually look up the Invoice and Subscription at the same time with the Invoice call
If you include subscription in the expand list, the subscription data will be included in the Invoice object rather than just the subscription ID https://stripe.com/docs/api/expanding_objects
Man if this is working I will send you definetely a tip via paypal ๐
You are going to safe my project
Your thanks and working project is plenty! We are always happy to help on questions like this.
What would you recommend:
I use the SubscriptionSchedules API to create an Installments Payment for an online course.
On which Webhook Event should I send the user the credentials and access to the course? In best case he should have direct access without delay
Typically I think we reccommend provisioning based on the invoice.paid event where reason is subscription_created
How long does this usually take for a credit card subscriptionschedules payment?
@warm meteor not sure what you mean
I recommend going through our docs to understand the basics of Billing and billing cycles in general
it's all covered in a lot of details
I have an expensive product (online course) - 1.000$ is the price
User can pay this price in monthly installments like 500$ per month (2 months)
So the user clicks the buy button and a subscriptionSchedule is created
When will the first invoice be successfully finalized normally to release access to the course?
I couldnt find helpful article in the docs
This is the only article:
https://stripe.com/docs/billing/subscriptions/subscription-schedules#updating
But it does not explain on which event I can give the user access
Invoices stay open for a couple of hours before being attempted. You can explicitly finalize the invoice and pay it via the API after the schedule creation: https://stripe.com/docs/api/invoices/pay
Perfect this helps a lot
Thank you!