#riptired_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1225925964928651426
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
HI ๐
Let's break this down piece by piece. What is the webhook event you are starting with?
Hey, since I am monitoring subscription products I am looking at customer.subscription.created for when subscriptions are created and invoice.payment_succeeded to determine that the payment for the subscription is complete and the subscription is now active
And you want to get down to which Object in the API?
Well I just want to be able to monitor and sort the events based on the product in the subscription
Each link that my product team makes is associated with a different client, so I want to be able to tell these X events are for client A while these Y events are for client B
each product is associated with a different client, but they are all subscription payment links
The Subscription object contains the items property where all of this is stored. https://docs.stripe.com/api/subscriptions/object#subscription_object-items
The Customer object on the Subscription should be able to match it with a client.
Oh wait
No, Payment Links are not designed to be Customer specific
So let me clarify a bit, I have N clients and each client has P customers. The P customers are completing the payment links. Each payment link has a different product (there are N payment links for N clients)
I just want to sort the webhook events by the N clients so I know which customer is purchasing the product from which client
Yeah, that's not how we designed payment links to operate. They were intended to allow quick, anonymous purchases by sharing out a link on, for example, Instagram.
As for "sorting" events. I'm not sure what you mean.
Both the events you are listening to will have the Price ID that conencts them to a Product
It sounds like that is the data you need
is the price ID persistent in all webhook events related to payment links?
and can I get the price ID from the dashboard?
Payment links are generated from Price objects so yes, the same Payment Link will always refer to the same Price ID
You can get the Price ID from the Dashboard or via the API https://docs.stripe.com/api/prices/list
Okay so this id "price_1Oqgk9H3HzTQWXXXXXXXXX" will be in all events in a subscription lifecycle
Specifically, every Subscription or Invoice event that involves that price will have the ID in the items property for Subscriptions and lines property for Invoices
okay I believe that is sufficient since the main events for a subscription lifecycle are invoice and subscription related
regarding getting the price ID from the dashboard where is that?
I have only been able to find it by going to the webhook events and seeing what it is, but I need to know what the price ID is when the payment link is created
The Price objecst are nested inside a Product detail page