#obo_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/1354172021990232165
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
For more info, this was last month's previousAttributes:
{
"current_period_end": 1740509544,
"current_period_start": 1737831144,
"latest_invoice": "in_1QlETvEUqHBlqQXGcXop4rp1"
}
The current month's can be seen here: evt_1R6caXEUqHBlqQXGmx5mY9u2
Sorry, the text is too long, I couldn't upload it to discord
We previously used this webhook to tell when a customer changed their susbcription item so we could hit on that, and my code checked if previousAttributes.items.data was empty, we would know that it was just a typical monthly subscription period renewal. Now it seems that all of the data for the subscription items is sent under previousAttributes.items.data because the
"current_period_start": 1740509544,```
values were updated
Hello
I'm not aware of the recent change.
Do you have an event from the previous month that shows the difference?
yes absolutely, same customer / subscription as well
this is last month: evt_1QwTFdEUqHBlqQXGS8kwkd2K
if you compare the two here, you'll see the only item being changed in the previousAttributes.items.data array is the current_period_end and current_period_start values
Validate, format, and compare two JSON documents. See the differences between the objects instead of just the new lines and mixed up properties.
Is this happening with all of your subscriptions or just one?
Did you change your webhook endpoint API version recently?
really I just need a surefire way to know the difference between:
"this customer.subscription.updated event is the result of a subscription change" (this tells us to change our internal db to reflect the new subscription)
And
"this customer.subscription.updated was the result of the monthly subscription just renewing" (basically do nothing here)
not unless stripe did it for us. are you able to check logs of that?
Hmm not sure if we have logging for that but let me see.
But taking a step back, you can look at the underlying invoice and it's billing reason to know if this event was for a subscription update or renewal
is there a corresponding way to do this for the "customer.subscription.updated" event?
ideally i'd like to change as little as possible here
to minimize code chaos, etc
There's nothing on the subscription event unfortuantely.
I see, is there anything else you could think of that we could hit on here?
or I guess also let me know if you're able to see anything in the logs about API version
it says our API version is: 2018-09-06
which also matches what we have coded in our DB
Yeah
I don't mean the API version on the account but on the webhook endpoint. I do see the endpoint was updated recently but I can't see what update was made
I see, is there anything else you could think of that we could hit on here?
Looking at the invoice's billing reason is the recommended way here
"I do see the endpoint was updated recently but I can't see what update was made" do you have a date of change for that update?
the last update I'm seeing on my end is Dec 26, 2023
Hi, taking over as my teammate needs to step away. Let me catch up.
sounds good, let me know if you have any questions.
From further looking, it appears to be a change that will stick and not an accident. I'm sorry communications were not sent.
I see, are you able elaborate on the larger logic behind that?
Historically speaking we've relied on the "previousAttributes" section of webhooks to contain only things that are actually changing.
I can understand the item being included in that section if the current_period_end / current_period_start values are changing, but it seems odd that all of the values are being included, even if they aren't changing
I'm mainly concerned if this is a one off thing, or if we can basically never trust the previousAttributes section again (of any webhook)