#tonz18_webhooks
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/1293900459576266826
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- tonz18_api, 3 hours ago, 11 messages
- tonz_subscription-events, 1 day ago, 30 messages
- tonz18_webhooks, 2 days ago, 31 messages
- tonz18_webhooks, 2 days ago, 18 messages
What's the evt_xxx ID of the event?
Yes, it's the line item for the unused time (proration) on the old price/produce before the upgrade
We credit the customer for the unused time if they upgrade mid cycle
The 2nd item has the remaining time in the period on the new price/product (prod_QwIvuu3ObDSTeF)
ohk, so getting ->lines->data[1] wouldnt be a good idea because it might not have a credit on it
Depends what you're trying to do I guess?
im trying to get the metadata from the active plan
Yes then you'd probably want to check for the non-credited item, you can read the lines[data][][proration_details] hash for that. If it's null then it's likely the new plan
otherwise do i get the product metadata when calling $stripe->subscription->retrieve
Yes, that works too. You'd need to 'expand' the product field: https://docs.stripe.com/api/subscriptions/object#subscription_object-items-data-price-product
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 can expand on the 1 call?
On the retrieve call yes
'expand' => ['items.data.price.product']
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!