#colman_docs

1 messages ยท Page 1 of 1 (latest)

rustic ledgeBOT
stiff spindleBOT
#

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.

rustic ledgeBOT
#

๐Ÿ‘‹ 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.

mighty lion
#

hi! metadata is one option, another is to look at invoice->subscription->trial_end when handling the event and compare to the present time

tired schooner
#

Here is a payload from a recent webhook;

#

I would love the invoice->subscription->trial_end option, but I dont see it

mighty lion
#

yes, to be clear I mean, call subscription.retrieve() with the subscription ID

tired schooner
#
"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"
              },

mighty lion
#

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

tired schooner
mighty lion
#

yes, since that's a field specific to the price , not the subscription (and price-level trials aren't really used much)

tired schooner
#

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.

mighty lion
#

yep makes sense, but in general it's normal to make an extra call when handling webhooks , to get the full context

tired schooner
#

Cool.

Thanks, I really learnt alot.