#colman_docs
1 messages ยท Page 1 of 1 (latest)
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.
- colman_element-setup, 17 hours ago, 38 messages
- colman_docs, 1 day ago, 10 messages
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1248584864832426055
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
hi! metadata is one option, another is to look at invoice->subscription->trial_end when handling the event and compare to the present time
Here is a payload from a recent webhook;
I would love the invoice->subscription->trial_end option, but I dont see it
yes, to be clear I mean, call subscription.retrieve() with the subscription ID
"plan": {
"id": "price_1PIRhUB9MJRQJCBoXLdbEgrz",
"object": "plan",
"active": true,
"aggregate_usage": null,
"amount": 500,
"amount_decimal": "500",
"billing_scheme": "per_unit",
"created": 1716194168,
"currency": "usd",
"interval": "day",
"interval_count": 1,
"livemode": false,
"metadata": {},
"meter": null,
"nickname": null,
"product": "prod_Q8j9WnpLsj1DFy",
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
or like when you receive an invoice event, call e.g. invoice = stripe.invoices.retrieve(expand=["payment_intent.latest_charge", "subscription"] and then you have a much more rich object to work with
This makes sense
trial_period_days shows up here but it is null.
Is that supposed to be so?
yes, since that's a field specific to the price , not the subscription (and price-level trials aren't really used much)
Ok, got it.
So my best bet is to expand the subscription with invoice = stripe.invoices.retrieve(expand=["payment_intent.latest_charge", "subscription"]?
I'd try that.
Thank you for your quick response.
I was really hoping I could just use the payload without having to make API calls to stripe servers.
yep makes sense, but in general it's normal to make an extra call when handling webhooks , to get the full context
Cool.
Thanks, I really learnt alot.